Skip to content

Commit 1411fe7

Browse files
committed
[IMP] l10n_it_delivery_note: DN integration with Electronic Invoice
1 parent 69f5c66 commit 1411fe7

File tree

5 files changed

+84
-35
lines changed

5 files changed

+84
-35
lines changed

l10n_it_delivery_note/README.rst

+34-31
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ installed together.
4444

4545
There are two available settings:
4646

47-
- Base (default): one picking, one DN.
48-
- Advanced: more picking in one DN.
47+
- Base (default): one picking, one DN.
48+
- Advanced: more picking in one DN.
4949

5050
**Italiano**
5151

@@ -62,8 +62,8 @@ Non è possibile avere installati contemporaneamente ``l10n_it_ddt`` e
6262

6363
Ci sono due impostazioni possibili.
6464

65-
- Base (predefinita): un prelievo, un DDT.
66-
- Avanzata: più prelievi in un DDT.
65+
- Base (predefinita): un prelievo, un DDT.
66+
- Avanzata: più prelievi in un DDT.
6767

6868
**Table of contents**
6969

@@ -96,11 +96,14 @@ To configure this module, go to:
9696
In delivery note type you can specify if the product price have to be
9797
printed in the delivery note report/slip.
9898

99-
- *Inventory → Configuration → Delivery Notes → Conditions of
100-
Transport*
101-
- *Inventory → Configuration → Delivery Notes → Appearances of Goods*
102-
- *Inventory → Configuration → Delivery Notes → Reasons of Transport*
103-
- *Inventory → Configuration → Delivery Notes → Methods of Transport*
99+
- *Inventory → Configuration → Delivery Notes → Conditions of
100+
Transport*
101+
- *Inventory → Configuration → Delivery Notes → Appearances of
102+
Goods*
103+
- *Inventory → Configuration → Delivery Notes → Reasons of
104+
Transport*
105+
- *Inventory → Configuration → Delivery Notes → Methods of
106+
Transport*
104107

105108
3. *Settings → User & Companies → Users*
106109

@@ -138,10 +141,10 @@ Funzionalità avanzata
138141

139142
Vengono attivate varie funzionalità aggiuntive:
140143

141-
- più prelievi per un DDT
142-
- selezione multipla di prelievi e generazione dei DDT
143-
- aggiunta righe nota e righe sezione descrittive.
144-
- lista dei DDT.
144+
- più prelievi per un DDT
145+
- selezione multipla di prelievi e generazione dei DDT
146+
- aggiunta righe nota e righe sezione descrittive.
147+
- lista dei DDT.
145148

146149
Il report DDT stampa in righe aggiuntive i lotti/seriali e le scadenze
147150
del prodotto.
@@ -183,39 +186,39 @@ Authors
183186
Contributors
184187
------------
185188

186-
- Riccardo Bellanova <r.bellanova@apuliasoftware.it>
189+
- Riccardo Bellanova <r.bellanova@apuliasoftware.it>
187190

188-
- Matteo Bilotta <mbilotta@linkeurope.it>
191+
- Matteo Bilotta <mbilotta@linkeurope.it>
189192

190-
- Giuseppe Borruso <gborruso@dinamicheaziendali.it>
193+
- Giuseppe Borruso <gborruso@dinamicheaziendali.it>
191194

192-
- Marco Calcagni <mcalcagni@dinamicheaziendali.it>
195+
- Marco Calcagni <mcalcagni@dinamicheaziendali.it>
193196

194-
- Marco Colombo <marco.colombo@gmail.com>
197+
- Marco Colombo <marco.colombo@gmail.com>
195198

196-
- Gianmarco Conte <gconte@dinamicheaziendali.it>
199+
- Gianmarco Conte <gconte@dinamicheaziendali.it>
197200

198-
- Letizia Freda <letizia.freda@netfarm.it>
201+
- Letizia Freda <letizia.freda@netfarm.it>
199202

200-
- Andrea Piovesana <andrea.m.piovesana@gmail.com>
203+
- Andrea Piovesana <andrea.m.piovesana@gmail.com>
201204

202-
- Alex Comba <alex.comba@agilebg.com>
205+
- Alex Comba <alex.comba@agilebg.com>
203206

204-
- `Ooops <https://www.ooops404.com>`__:
207+
- `Ooops <https://www.ooops404.com>`__:
205208

206-
- Giovanni Serra <giovanni@gslab.it>
207-
- Foresti Francesco <francesco.foresti@ooops404.com>
209+
- Giovanni Serra <giovanni@gslab.it>
210+
- Foresti Francesco <francesco.foresti@ooops404.com>
208211

209-
- Nextev Srl <odoo@nextev.it>
212+
- Nextev Srl <odoo@nextev.it>
210213

211-
- `PyTech-SRL <https://www.pytech.it>`__:
214+
- `PyTech-SRL <https://www.pytech.it>`__:
212215

213-
- Alessandro Uffreduzzi <alessandro.uffreduzzi@pytech.it>
214-
- Sebastiano Picchi <sebastiano.picchi@pytech.it>
216+
- Alessandro Uffreduzzi <alessandro.uffreduzzi@pytech.it>
217+
- Sebastiano Picchi <sebastiano.picchi@pytech.it>
215218

216-
- `Aion Tech <https://aiontech.company/>`__:
219+
- `Aion Tech <https://aiontech.company/>`__:
217220

218-
- Simone Rubino <simone.rubino@aion-tech.it>
221+
- Simone Rubino <simone.rubino@aion-tech.it>
219222

220223
Maintainers
221224
-----------

l10n_it_delivery_note/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"mail",
2323
"sale",
2424
"sale_stock",
25-
# "stock_account",
2625
"stock_delivery",
2726
"portal",
2827
"product",
28+
"l10n_it_edi",
2929
],
3030
"data": [
3131
"security/ir.model.access.csv",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo>
3+
<template
4+
id="delivery_note_edi_template"
5+
inherit_id="l10n_it_edi.account_invoice_it_FatturaPA_export"
6+
>
7+
<xpath expr="//DatiDDT" position="after">
8+
<t
9+
t-if="delivery_note_dict"
10+
t-foreach="delivery_note_dict"
11+
t-as="delivery_note"
12+
>
13+
<DatiDDT>
14+
<NumeroDDT
15+
t-esc="format_alphanumeric(delivery_note.number[-20:])"
16+
/>
17+
<DataDDT t-esc="format_date(delivery_note.date)" />
18+
<t
19+
t-if="len(delivery_note_dict[delivery_note]) > 1"
20+
t-foreach="delivery_note_dict[delivery_note]"
21+
t-as="line_ref"
22+
>
23+
<RiferimentoNumeroLinea t-esc="line_ref" />
24+
</t>
25+
</DatiDDT>
26+
</t>
27+
</xpath>
28+
</template>
29+
</odoo>

l10n_it_delivery_note/models/account_invoice.py

+14
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,17 @@ def button_cancel(self): # pylint: disable=missing-return
167167
dn_lines.sync_invoice_status()
168168
dn_lines.delivery_note_id._compute_invoice_status()
169169
dn_lines.delivery_note_id.state = "confirm"
170+
171+
def _l10n_it_edi_get_delivery_note_values(self):
172+
self.ensure_one()
173+
ddt_dict = {}
174+
for line in self.invoice_line_ids.filtered(lambda il: il.delivery_note_id):
175+
ddt_dict.setdefault(line.delivery_note_id, []).append(line.sequence)
176+
return ddt_dict
177+
178+
def _l10n_it_edi_get_values(self, pdf_values=None):
179+
template_values = super()._l10n_it_edi_get_values(pdf_values)
180+
template_values["delivery_note_dict"] = (
181+
self._l10n_it_edi_get_delivery_note_values()
182+
)
183+
return template_values

l10n_it_delivery_note/static/description/index.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,12 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
438438
<ul class="simple">
439439
<li><em>Inventory → Configuration → Delivery Notes → Conditions of
440440
Transport</em></li>
441-
<li><em>Inventory → Configuration → Delivery Notes → Appearances of Goods</em></li>
442-
<li><em>Inventory → Configuration → Delivery Notes → Reasons of Transport</em></li>
443-
<li><em>Inventory → Configuration → Delivery Notes → Methods of Transport</em></li>
441+
<li><em>Inventory → Configuration → Delivery Notes → Appearances of
442+
Goods</em></li>
443+
<li><em>Inventory → Configuration → Delivery Notes → Reasons of
444+
Transport</em></li>
445+
<li><em>Inventory → Configuration → Delivery Notes → Methods of
446+
Transport</em></li>
444447
</ul>
445448
</li>
446449
<li><p class="first"><em>Settings → User &amp; Companies → Users</em></p>

0 commit comments

Comments
 (0)