Skip to content

Commit

Permalink
[UPD] l10n_it_delivery_note: aggiornato modulo e aggiunto PR 4293 e 4385
Browse files Browse the repository at this point in the history
  • Loading branch information
Borruso committed Feb 28, 2025
1 parent 51981ca commit 066a553
Show file tree
Hide file tree
Showing 20 changed files with 326 additions and 649 deletions.
88 changes: 42 additions & 46 deletions l10n_it_delivery_note/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
ITA - Documento di trasporto
============================

..
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8ad1d29f09bc751aae76546b9f41c539c808225fe92d9d29585609e29395dab6
!! source digest: sha256:8212493e4b864ce0e891e5e01964e6dbe7f393ca3fb053088722c88022fe02d2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -44,8 +44,8 @@ installed together.

There are two available settings:

- Base (default): one picking, one DN.
- Advanced: more picking in one DN.
- Base (default): one picking, one DN.
- Advanced: more picking in one DN.

**Italiano**

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

Ci sono due impostazioni possibili.

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

**Table of contents**

Expand All @@ -78,10 +78,7 @@ To configure this module, go to:
1. *Inventory → Configuration → Settings - Delivery Notes*

Checking 'Use Advanced DN Features' allows you to manage more picking
on one delivery note. Checking 'Group Invoice Lines by Delivery Note
which generated them' too, you will have invoice lines grouped and it
can be useful if you invoice many DNs with same product and you want
to show the details to your customer.
on one delivery note.

Checking 'Display Ref. Order in Delivery Note Report' or 'Display
Ref. Customer in Delivery Note Report" enables in report fields
Expand All @@ -99,14 +96,11 @@ To configure this module, go to:
In delivery note type you can specify if the product price have to be
printed in the delivery note report/slip.

- *Inventory → Configuration → Delivery Notes → Conditions of
Transport*
- *Inventory → Configuration → Delivery Notes → Appearances of
Goods*
- *Inventory → Configuration → Delivery Notes → Reasons of
Transport*
- *Inventory → Configuration → Delivery Notes → Methods of
Transport*
- *Inventory → Configuration → Delivery Notes → Conditions of
Transport*
- *Inventory → Configuration → Delivery Notes → Appearances of Goods*
- *Inventory → Configuration → Delivery Notes → Reasons of Transport*
- *Inventory → Configuration → Delivery Notes → Methods of Transport*

3. *Settings → User & Companies → Users*

Expand Down Expand Up @@ -144,10 +138,10 @@ Funzionalità avanzata

Vengono attivate varie funzionalità aggiuntive:

- più prelievi per un DDT
- selezione multipla di prelievi e generazione dei DDT
- aggiunta righe nota e righe sezione descrittive.
- lista dei DDT.
- più prelievi per un DDT
- selezione multipla di prelievi e generazione dei DDT
- aggiunta righe nota e righe sezione descrittive.
- lista dei DDT.

Il report DDT stampa in righe aggiuntive i lotti/seriali e le scadenze
del prodotto.
Expand All @@ -159,12 +153,14 @@ permessi dell'utente.
Le fatture generate dai DDT contengono i riferimenti al DDT stesso nelle
righe nota.

Raggruppa righe fattura per DDT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fatturazione da DN
------------------

Attivando le funzionalità avanzate viene mostrata l'opzione per
abilitare il raggruppamento delle righe fattura in base al DDT che le ha
generate ("Raggruppa righe fattura per le DN che le hanno generate").
E' possibile creare una fattura selezionando una o più DN dello stesso
partner dalla tree view tramite il wizard "crea fattura". Si può
scegliere se includere anche i servizi non ancora fatturati dell'ordine
di vendita correlato o considerare solo le righe nei DN. In maniera
predefinita vengono dedotti gli eventuali anticipi fatturati.

Accesso da portale
------------------
Expand Down Expand Up @@ -196,39 +192,39 @@ Authors
Contributors
------------

- Riccardo Bellanova <[email protected]>
- Riccardo Bellanova <[email protected]>

- Matteo Bilotta <[email protected]>
- Matteo Bilotta <[email protected]>

- Giuseppe Borruso <[email protected]>
- Giuseppe Borruso <[email protected]>

- Marco Calcagni <[email protected]>
- Marco Calcagni <[email protected]>

- Marco Colombo <[email protected]>
- Marco Colombo <[email protected]>

- Gianmarco Conte <[email protected]>
- Gianmarco Conte <[email protected]>

- Letizia Freda <[email protected]>
- Letizia Freda <[email protected]>

- Andrea Piovesana <[email protected]>
- Andrea Piovesana <[email protected]>

- Alex Comba <[email protected]>
- Alex Comba <[email protected]>

- `Ooops <https://www.ooops404.com>`__:
- `Ooops <https://www.ooops404.com>`__:

- Giovanni Serra <[email protected]>
- Foresti Francesco <[email protected]>
- Giovanni Serra <[email protected]>
- Foresti Francesco <[email protected]>

- Nextev Srl <[email protected]>
- Nextev Srl <[email protected]>

- `PyTech-SRL <https://www.pytech.it>`__:
- `PyTech-SRL <https://www.pytech.it>`__:

- Alessandro Uffreduzzi <[email protected]>
- Sebastiano Picchi <[email protected]>
- Alessandro Uffreduzzi <[email protected]>
- Sebastiano Picchi <[email protected]>

- `Aion Tech <https://aiontech.company/>`__:
- `Aion Tech <https://aiontech.company/>`__:

- Simone Rubino <[email protected]>
- Simone Rubino <[email protected]>

Maintainers
-----------
Expand All @@ -255,7 +251,7 @@ promote its widespread use.

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-MarcoCalcagni| |maintainer-aleuffre| |maintainer-renda-dev|
|maintainer-MarcoCalcagni| |maintainer-aleuffre| |maintainer-renda-dev|

This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_delivery_note>`_ project on GitHub.

Expand Down
2 changes: 1 addition & 1 deletion l10n_it_delivery_note/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Marco Calcagni, Gianmarco Conte, Link IT Europe Srl, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-italy",
"version": "16.0.1.4.7",
"version": "16.0.1.5.2",
"category": "Localization/Italy",
"license": "AGPL-3",
"maintainers": ["MarcoCalcagni", "aleuffre", "renda-dev"],
Expand Down
15 changes: 13 additions & 2 deletions l10n_it_delivery_note/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-08 14:45+0000\n"
"PO-Revision-Date: 2024-12-20 19:06+0000\n"
"PO-Revision-Date: 2025-01-20 17:06+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: \n"
"Language: it\n"
Expand Down Expand Up @@ -850,7 +850,8 @@ msgstr "Se selezionata, alcuni messaggi hanno un errore di consegna."
#. module: l10n_it_delivery_note
#: model_terms:ir.ui.view,arch_db:l10n_it_delivery_note.stock_delivery_note_wizard_error_message_template
msgid "If these problems persist, don't hesitate to contact the helpdesk."
msgstr "Se questi problemi persistono, non esitate a contattare l'helpdesk."
msgstr ""
"Se questi problemi persistono, non esitate a contattare l'assistenza clienti."

#. module: l10n_it_delivery_note
#. odoo-python
Expand Down Expand Up @@ -1575,6 +1576,16 @@ msgstr ""
msgid "Summary"
msgstr "Riepilogo"

#. module: l10n_it_delivery_note
#: model:ir.model.fields,field_description:l10n_it_delivery_note.field_stock_picking__dn_supplier_date
msgid "Supplier DN Date"
msgstr "Data DDT fornitore"

#. module: l10n_it_delivery_note
#: model:ir.model.fields,field_description:l10n_it_delivery_note.field_stock_picking__dn_supplier_number
msgid "Supplier DN Number"
msgstr "Numero DDT fornitore"

#. module: l10n_it_delivery_note
#: model_terms:ir.ui.view,arch_db:l10n_it_delivery_note.stock_delivery_note_form_view
msgid "Tax"
Expand Down
10 changes: 10 additions & 0 deletions l10n_it_delivery_note/i18n/l10n_it_delivery_note.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,16 @@ msgstr ""
msgid "Summary"
msgstr ""

#. module: l10n_it_delivery_note
#: model:ir.model.fields,field_description:l10n_it_delivery_note.field_stock_picking__dn_supplier_date
msgid "Supplier DN Date"
msgstr ""

#. module: l10n_it_delivery_note
#: model:ir.model.fields,field_description:l10n_it_delivery_note.field_stock_picking__dn_supplier_number
msgid "Supplier DN Number"
msgstr ""

#. module: l10n_it_delivery_note
#: model_terms:ir.ui.view,arch_db:l10n_it_delivery_note.stock_delivery_note_form_view
msgid "Tax"
Expand Down
55 changes: 5 additions & 50 deletions l10n_it_delivery_note/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# @author: Gianmarco Conte <[email protected]>
# Copyright (c) 2019, Link IT Europe Srl
# @author: Matteo Bilotta <[email protected]>
# Copyright (c) 2024, Nextev Srl <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import _, fields, models
Expand Down Expand Up @@ -75,12 +76,6 @@ def goto_invoice(self, **kwargs):
}

def _prepare_note_dn_value(self, sequence, delivery_note_id):
if self.env.company.invoice_lines_grouped_by_dn:
delivery_note_line_sequence = self.invoice_line_ids.filtered(
lambda x: x.delivery_note_id == delivery_note_id
).mapped("sequence")
if delivery_note_line_sequence:
sequence = min(delivery_note_line_sequence) - 1
return {
"sequence": sequence,
"display_type": "line_note",
Expand Down Expand Up @@ -129,44 +124,6 @@ def update_delivery_note_lines(self):
),
)
)
elif self.env.company.invoice_lines_grouped_by_dn:
sequence = 1
done_invoice_lines = self.env["account.move.line"]
delivery_notes = invoice.mapped(
"invoice_line_ids.sale_line_ids.delivery_note_line_ids."
"delivery_note_id"
).sorted(key="name")
for dn in delivery_notes:
dn_invoice_lines = invoice.invoice_line_ids.filtered(
lambda x, dn=dn, done_invoice_lines=done_invoice_lines: x
not in done_invoice_lines
and dn
in x.mapped(
"sale_line_ids.delivery_note_line_ids.delivery_note_id"
)
# fixme test invoice from 2 sale lines
)
done_invoice_lines |= dn_invoice_lines
for note_line in dn.line_ids.filtered(
lambda line: line.invoice_status == DOMAIN_INVOICE_STATUSES[2]
):
for invoice_line in dn_invoice_lines.filtered(
lambda x: not x.delivery_note_id
):
if (
note_line
in invoice_line.sale_line_ids.delivery_note_line_ids
):
invoice_line.delivery_note_id = (
note_line.delivery_note_id.id
)
new_lines.append(
(
0,
False,
self._prepare_note_dn_value(sequence, dn),
)
)
else:
for line in invoice.invoice_line_ids:
sequence = line.sequence - 1
Expand All @@ -192,13 +149,11 @@ def unlink(self):
# Ripristino il valore delle delivery note
# per poterle rifatturare
inv_lines = self.mapped("invoice_line_ids")
all_dnls = inv_lines.mapped("sale_line_ids").mapped("delivery_note_line_ids")
inv_dnls = self.mapped("delivery_note_ids").mapped("line_ids")
dnls_to_unlink = all_dnls & inv_dnls
inv_dnls = inv_lines.mapped("delivery_note_line_id")
res = super().unlink()
dnls_to_unlink.sync_invoice_status()
dnls_to_unlink.mapped("delivery_note_id")._compute_invoice_status()
for dn in dnls_to_unlink.mapped("delivery_note_id"):
inv_dnls.sync_invoice_status()
inv_dnls.mapped("delivery_note_id")._compute_invoice_status()
for dn in inv_dnls.mapped("delivery_note_id"):
dn.state = "confirm"
return res

Expand Down
6 changes: 6 additions & 0 deletions l10n_it_delivery_note/models/account_invoice_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ class AccountInvoiceLine(models.Model):
delivery_note_id = fields.Many2one(
"stock.delivery.note", string="Delivery Note", readonly=True, copy=False
)
delivery_note_line_id = fields.Many2one(
"stock.delivery.note.line",
string="Delivery Note Line",
readonly=True,
copy=False,
)
note_dn = fields.Boolean(string="Note DN")
4 changes: 0 additions & 4 deletions l10n_it_delivery_note/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ class ResCompany(models.Model):
"Display Delivery Method in Delivery Note Report",
default=False,
)
invoice_lines_grouped_by_dn = fields.Boolean(
"Group Delivery note invoices by quantity",
default=False,
)
5 changes: 0 additions & 5 deletions l10n_it_delivery_note/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,3 @@ def _default_virtual_locations_root(self):
related="company_id.display_delivery_method_dn_report",
readonly=False,
)
invoice_lines_grouped_by_dn = fields.Boolean(
string="Group Invoice Lines by Delivery Note",
related="company_id.invoice_lines_grouped_by_dn",
readonly=False,
)
Loading

0 comments on commit 066a553

Please sign in to comment.