Skip to content

Commit

Permalink
Merge branch 'OCA:16.0' into 16-fix-cup-editable
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-bendazzoli authored Dec 20, 2024
2 parents 6ac7658 + d2ac76f commit 7e8941e
Show file tree
Hide file tree
Showing 44 changed files with 2,156 additions and 182 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ addon | version | maintainers | summary
[currency_rate_update_boi](currency_rate_update_boi/) | 16.0.1.0.1 | [![eLBati](https://github.com/eLBati.png?size=30px)](https://github.com/eLBati) | Update exchange rates using www.bancaditalia.it
[fiscal_epos_print](fiscal_epos_print/) | 16.0.1.0.0 | [![eLBati](https://github.com/eLBati.png?size=30px)](https://github.com/eLBati) | ePOS-Print XML Fiscal Printer Driver - Stampanti Epson compatibili: FP81II, FP90III
[l10n_it_abicab](l10n_it_abicab/) | 16.0.1.0.1 | [![Borruso](https://github.com/Borruso.png?size=30px)](https://github.com/Borruso) | Base Bank ABI/CAB codes
[l10n_it_accompanying_invoice](l10n_it_accompanying_invoice/) | 16.0.1.0.1 | | Stampa della fattura accompagnatoria
[l10n_it_account](l10n_it_account/) | 16.0.1.1.2 | | Modulo base usato come dipendenza di altri moduli contabili
[l10n_it_account_stamp](l10n_it_account_stamp/) | 16.0.1.1.0 | | Gestione automatica dell'imposta di bollo
[l10n_it_account_tax_kind](l10n_it_account_tax_kind/) | 16.0.1.0.1 | | Gestione natura delle aliquote IVA
Expand Down Expand Up @@ -78,7 +79,7 @@ addon | version | maintainers | summary
[l10n_it_vat_registries](l10n_it_vat_registries/) | 16.0.1.2.1 | | ITA - Registri IVA
[l10n_it_vat_registries_rc](l10n_it_vat_registries_rc/) | 16.0.1.0.0 | [![eLBati](https://github.com/eLBati.png?size=30px)](https://github.com/eLBati) | Integrazione l10n_it_vat_registries e l10n_it_reverse_charge
[l10n_it_vat_registries_split_payment](l10n_it_vat_registries_split_payment/) | 16.0.1.0.0 | | Modulo di congiunzione tra registri IVA e scissione dei pagamenti
[l10n_it_vat_settlement_date](l10n_it_vat_settlement_date/) | 16.0.1.0.1 | | Settlement date for VAT Statement
[l10n_it_vat_settlement_date](l10n_it_vat_settlement_date/) | 16.0.1.0.2 | | Settlement date for VAT Statement
[l10n_it_vat_settlement_date_rc](l10n_it_vat_settlement_date_rc/) | 16.0.1.0.0 | | Use VAT Settlement Date in reverse charge.
[l10n_it_vat_statement_communication](l10n_it_vat_statement_communication/) | 16.0.1.0.1 | | Comunicazione liquidazione IVA ed esportazione file xmlconforme alle specifiche dell'Agenzia delle Entrate
[l10n_it_vat_statement_split_payment](l10n_it_vat_statement_split_payment/) | 16.0.1.0.0 | | Migliora la liquidazione dell'IVA tenendo in considerazione la scissione dei pagamenti
Expand Down
113 changes: 113 additions & 0 deletions l10n_it_accompanying_invoice/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
=============================
ITA - Fattura accompagnatoria
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6ed703e43ac9bef8abc023b6e9df9958b6ed8fdedab2776b3b4a8db99dafcbff
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_accompanying_invoice
:alt: OCA/l10n-italy
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_accompanying_invoice
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

**Italiano**

Questo modulo consente di stampare una fattura accompagnatoria, per
visualizzare i dati di *Informazioni di spedizione* nella fattura.

**English**

This module allows you to print an accompanying invoice, to view
*Shipping Information* data inside the invoice.

**Table of contents**

.. contents::
:local:

Usage
=====

Valorizzare i campi del foglio *Informazioni di spedizione*.

Usare l'azione *Fattura accompagnatoria* all'interno della lista di
azioni *Stampa*, nella vista delle fatture.

Known issues / Roadmap
======================

**Italiano**

Odoo Italia non supporta più i moduli alla versione 12.0 perciò non ci
siamo occupati ufficialmente della migrazione dei dati da questa
versione.

Tuttavia se non si volessero perdere i dati già presenti nella versione
12.0 si può provare in un ambiente di test la procedura di migrazione a
proprio rischio e non garantita togliendo la dipendenza dal modulo
``l10n_it_ddt`` nel ``__manifest__.py`` e lanciando gli script di
migrazione commentati. Passaggi:

- decommentare il riferimento a ``hooks.py`` in ``__init__.py``
- decommentare ``external_dependencies`` e ``pre_init_hook`` in
``__manifest__.py``
- spostare la cartella ``readme/migrations`` nella root del modulo

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_accompanying_invoice%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Agile Business Group

Contributors
------------

- Lorenzo Battistini <[email protected]>
- Simone Vanin <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions l10n_it_accompanying_invoice/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
# from .hooks import pre_absorb_old_module
30 changes: 30 additions & 0 deletions l10n_it_accompanying_invoice/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2017 Lorenzo Battistini - Agile Business Group
# Copyright 2020 Simone Vanin - Agile Business Group
# Copyright 2023 Simone Rubino - Aion Tech
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "ITA - Fattura accompagnatoria",
"summary": "Stampa della fattura accompagnatoria",
"version": "16.0.1.0.1",
"category": "Accounting",
"website": "https://github.com/OCA/l10n-italy"
"/tree/16.0/l10n_it_accompanying_invoice",
"author": "Agile Business Group, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"l10n_it_delivery_note",
],
"data": [
"views/account.xml",
"views/report_invoice.xml",
],
# "external_dependencies": {
# "python": [
# "openupgradelib",
# ],
# },
# "pre_init_hook": "pre_absorb_old_module",
}
225 changes: 225 additions & 0 deletions l10n_it_accompanying_invoice/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
# Copyright 2023 Simone Rubino - Aion Tech
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade

from odoo.tools import DotDict

RENAMED_FIELDS = [
[
(
"account.invoice",
"note",
),
(
"account.move",
"delivery_note",
),
],
[
(
"account.invoice",
"date_done",
),
(
"account.move",
"delivery_transport_datetime",
),
],
[
(
"account.invoice",
"carriage_condition_id",
),
(
"account.move",
"delivery_transport_condition_id",
),
],
[
(
"account.invoice",
"goods_description_id",
),
(
"account.move",
"delivery_goods_appearance_id",
),
],
[
(
"account.invoice",
"transportation_reason_id",
),
(
"account.move",
"delivery_transport_reason_id",
),
],
[
(
"account.invoice",
"transportation_method_id",
),
(
"account.move",
"delivery_transport_method_id",
),
],
[
(
"account.invoice",
"carrier_id",
),
(
"account.move",
"delivery_carrier_id",
),
],
[
(
"account.invoice",
"parcels",
),
(
"account.move",
"delivery_packages",
),
],
[
(
"account.invoice",
"weight",
),
(
"account.move",
"delivery_net_weight",
),
],
[
(
"account.invoice",
"gross_weight",
),
(
"account.move",
"delivery_gross_weight",
),
],
[
(
"account.invoice",
"volume",
),
(
"account.move",
"delivery_volume",
),
],
[
(
"account.invoice",
"weight_manual_uom_id",
),
(
"account.move",
"delivery_net_weight_uom_id",
),
],
[
(
"account.invoice",
"gross_weight_uom_id",
),
(
"account.move",
"delivery_gross_weight_uom_id",
),
],
[
(
"account.invoice",
"volume_uom_id",
),
(
"account.move",
"delivery_volume_uom_id",
),
],
]

RENAMED_XMLIDS = [
(
"invoice_form_view_uom",
"view_move_form",
),
(
"invoice_form_view_uom",
"shipping_invoice_report",
),
(
"invoice_form_view_uom",
"shipping_invoice_template",
),
(
"invoice_form_view_uom",
"report_shipping_invoice",
),
]


# def remove_models(cr, model_spec):
# for name in model_spec:
# logged_query(
# cr,
# "DELETE FROM ir_model WHERE model = %s",
# (name,),
# )


def migrate_old_module(cr):
field_spec = []
for renamed_field in RENAMED_FIELDS:
(old_model, old_field), (new_model, new_field) = renamed_field
field_spec.append(
(
old_model,
old_model.replace(".", "_"),
old_field,
new_field,
)
)
openupgrade.rename_fields(
# The method only needs the cursor, not the whole Environment
DotDict(
cr=cr,
),
field_spec,
# Prevent Environment usage
# whenever it will be implemented.
no_deep=True,
)

full_renamed_xmlids = [
(
".".join(("l10n_it_accompanying_invoice", old_xmlid)),
".".join(("l10n_it_accompanying_invoice", new_xmlid)),
)
for old_xmlid, new_xmlid in RENAMED_XMLIDS
]
openupgrade.rename_xmlids(
cr,
full_renamed_xmlids,
)


def pre_absorb_old_module(cr):
if openupgrade.is_module_installed(cr, "l10n_it_accompanying_invoice"):
openupgrade.update_module_names(
cr,
[
("l10n_it_fattura_accompagnatoria", "l10n_it_accompanying_invoice"),
],
merge_modules=True,
)
migrate_old_module(cr)
Loading

0 comments on commit 7e8941e

Please sign in to comment.