diff --git a/l10n_it_delivery_note/README.rst b/l10n_it_delivery_note/README.rst index f75cc4516d2a..f1d652754a57 100644 --- a/l10n_it_delivery_note/README.rst +++ b/l10n_it_delivery_note/README.rst @@ -7,7 +7,7 @@ ITA - Documento di trasporto !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:48fb8a0d085dce618e7696ef8bdb30aa56d61f48d3db5f895cf477ddf0d3505c + !! source digest: sha256:e389fbd4dff70da2d65271df7684c21141a86b5e861217fe285b4df642e5a57a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/l10n_it_delivery_note/__manifest__.py b/l10n_it_delivery_note/__manifest__.py index 5aca02197b07..b94f657811ac 100644 --- a/l10n_it_delivery_note/__manifest__.py +++ b/l10n_it_delivery_note/__manifest__.py @@ -13,12 +13,12 @@ "author": "Marco Calcagni, Gianmarco Conte, Link IT Europe Srl, " "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-italy", - "version": "14.0.2.5.0", + "version": "14.0.2.6.0", "category": "Localization/Italy", "license": "AGPL-3", "maintainers": ["MarcoCalcagni", "aleuffre", "renda-dev"], "depends": [ - "delivery", + "delivery_carrier_partner", "l10n_it_delivery_note_base", "mail", "sale_stock", diff --git a/l10n_it_delivery_note/migrations/14.0.2.6.0/post-migrate.py b/l10n_it_delivery_note/migrations/14.0.2.6.0/post-migrate.py new file mode 100644 index 000000000000..b761e4031c6b --- /dev/null +++ b/l10n_it_delivery_note/migrations/14.0.2.6.0/post-migrate.py @@ -0,0 +1,11 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + note_ids = env["stock.delivery.note"].search( + [("carrier_id", "!=", False), ("delivery_method_id", "!=", False)] + ) + + for note_id in note_ids: + note_id.carrier_id.write({"carrier_ids": [(4, note_id.delivery_method_id.id)]}) diff --git a/l10n_it_delivery_note/models/res_partner.py b/l10n_it_delivery_note/models/res_partner.py index 31a36e66eaf4..d71e3d68cc06 100644 --- a/l10n_it_delivery_note/models/res_partner.py +++ b/l10n_it_delivery_note/models/res_partner.py @@ -19,4 +19,4 @@ class ResPartner(models.Model): default_transport_method_id = fields.Many2one( "stock.picking.transport.method", string="Method of transport" ) - is_carrier = fields.Boolean("Is Carrier") + carrier_ids = fields.One2many("delivery.carrier", "partner_id", string="Carrier") diff --git a/l10n_it_delivery_note/models/stock_delivery_note.py b/l10n_it_delivery_note/models/stock_delivery_note.py index b99dccecf0b2..1c502b838c46 100644 --- a/l10n_it_delivery_note/models/stock_delivery_note.py +++ b/l10n_it_delivery_note/models/stock_delivery_note.py @@ -143,7 +143,7 @@ def _domain_weight_uom(self): string="Carrier", states=DONE_READONLY_STATE, tracking=True, - domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", + related="delivery_method_id.partner_id", ) delivery_method_id = fields.Many2one( "delivery.carrier", diff --git a/l10n_it_delivery_note/static/description/index.html b/l10n_it_delivery_note/static/description/index.html index 21b5b801a86f..43fba4276a7d 100644 --- a/l10n_it_delivery_note/static/description/index.html +++ b/l10n_it_delivery_note/static/description/index.html @@ -1,3 +1,4 @@ +
@@ -366,7 +367,7 @@English
diff --git a/l10n_it_delivery_note/views/res_partner.xml b/l10n_it_delivery_note/views/res_partner.xml index 965c49b0a1ed..186739fe4475 100644 --- a/l10n_it_delivery_note/views/res_partner.xml +++ b/l10n_it_delivery_note/views/res_partner.xml @@ -12,7 +12,6 @@
+
+