From 9521c077038675acceb208aa2cb7bab9b66a9d05 Mon Sep 17 00:00:00 2001 From: chaule97 Date: Thu, 7 Nov 2024 15:46:14 +0700 Subject: [PATCH] [MIG] partner_invoicing_mode_at_shipping: Migration to 18.0 --- partner_invoicing_mode_at_shipping/__manifest__.py | 2 +- partner_invoicing_mode_at_shipping/models/res_partner.py | 6 +++--- partner_invoicing_mode_at_shipping/models/sale_order.py | 4 ++-- partner_invoicing_mode_at_shipping/models/stock_picking.py | 4 ++-- requirements.txt | 2 ++ 5 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 requirements.txt diff --git a/partner_invoicing_mode_at_shipping/__manifest__.py b/partner_invoicing_mode_at_shipping/__manifest__.py index cfb64ef27fd..2e1ae7e39fc 100644 --- a/partner_invoicing_mode_at_shipping/__manifest__.py +++ b/partner_invoicing_mode_at_shipping/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Partner Invoicing Mode At Shipping", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "summary": "Create invoices automatically when goods are shipped.", "author": "Camptocamp, Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-invoicing", diff --git a/partner_invoicing_mode_at_shipping/models/res_partner.py b/partner_invoicing_mode_at_shipping/models/res_partner.py index 7c3fa457544..6b3351fa5d3 100644 --- a/partner_invoicing_mode_at_shipping/models/res_partner.py +++ b/partner_invoicing_mode_at_shipping/models/res_partner.py @@ -1,7 +1,7 @@ # Copyright 2020 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) -from odoo import _, api, fields, models +from odoo import api, fields, models from odoo.exceptions import ValidationError @@ -35,7 +35,7 @@ def _check_invoicing_mode_one_invoice_per_shipping(self): and partner.one_invoice_per_shipping ): raise ValidationError( - _( + self.env._( "You cannot configure the partner %(partner)s with " "Invoicing Mode 'At Shipping' and 'One Invoice Per Shipping'!", partner=partner.name, @@ -43,7 +43,7 @@ def _check_invoicing_mode_one_invoice_per_shipping(self): ) if partner.one_invoice_per_shipping and partner.one_invoice_per_order: raise ValidationError( - _( + self.env._( "You cannot configure the partner %(partner)s with " "'One Invoice Per Order' and 'One Invoice Per Shipping'!", partner=partner.name, diff --git a/partner_invoicing_mode_at_shipping/models/sale_order.py b/partner_invoicing_mode_at_shipping/models/sale_order.py index 4b1093cf310..d570971210f 100644 --- a/partner_invoicing_mode_at_shipping/models/sale_order.py +++ b/partner_invoicing_mode_at_shipping/models/sale_order.py @@ -1,6 +1,6 @@ # Copyright 2023 ACSONE SA/NV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import api, fields, models class SaleOrder(models.Model): @@ -35,7 +35,7 @@ def generate_invoices( last_execution_field=last_execution_field, ) # Validate the preceding generated invoices in draft mode. - description = _( + description = self.env._( "Validate the invoices generated by shipping for the " "invoicing mode %(invoicing_mode_name)s" ) diff --git a/partner_invoicing_mode_at_shipping/models/stock_picking.py b/partner_invoicing_mode_at_shipping/models/stock_picking.py index ae4d5208967..74ac087ae24 100644 --- a/partner_invoicing_mode_at_shipping/models/stock_picking.py +++ b/partner_invoicing_mode_at_shipping/models/stock_picking.py @@ -1,7 +1,7 @@ # Copyright 2020 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) -from odoo import _, api, models +from odoo import api, models class StockPicking(models.Model): @@ -44,7 +44,7 @@ def _invoicing_at_shipping(self): # The invoices per picking will use the invoicing_mode for invoice in self._invoicing_at_shipping_validation(invoices): invoice.with_delay()._validate_invoice() - return invoices or _("Nothing to invoice.") + return invoices or self.env._("Nothing to invoice.") def _get_sales_order_to_invoice(self): return self.move_ids.sale_line_id.order_id.filtered( diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000000..180fc49789b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# generated from manifests external_dependencies +openupgradelib