diff --git a/l10n_br_purchase_stock/__manifest__.py b/l10n_br_purchase_stock/__manifest__.py index 3e76007f3c1d..c03a99ef05a3 100644 --- a/l10n_br_purchase_stock/__manifest__.py +++ b/l10n_br_purchase_stock/__manifest__.py @@ -7,7 +7,7 @@ "category": "Localisation", "author": "Akretion, Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.3.5", + "version": "14.0.2.0.0", "depends": [ "l10n_br_purchase", "l10n_br_stock_account", diff --git a/l10n_br_purchase_stock/demo/purchase_order.xml b/l10n_br_purchase_stock/demo/purchase_order.xml index fc5a83b0c6a0..2f47face97aa 100644 --- a/l10n_br_purchase_stock/demo/purchase_order.xml +++ b/l10n_br_purchase_stock/demo/purchase_order.xml @@ -3,15 +3,15 @@ - - stock_picking + + stock_picking diff --git a/l10n_br_purchase_stock/migrations/14.0.2.0.0/pre-migration.py b/l10n_br_purchase_stock/migrations/14.0.2.0.0/pre-migration.py new file mode 100644 index 000000000000..ef93feac4ca3 --- /dev/null +++ b/l10n_br_purchase_stock/migrations/14.0.2.0.0/pre-migration.py @@ -0,0 +1,16 @@ +# Copyright (C) 2024-Today - Akretion (). +# @author Magno Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_column_renames = { + "res_company": [ + ("purchase_create_invoice_policy", "purchase_invoicing_policy"), + ], +} + + +@openupgrade.migrate(use_env=True) +def migrate(env, version): + openupgrade.rename_columns(env.cr, _column_renames) diff --git a/l10n_br_purchase_stock/models/__init__.py b/l10n_br_purchase_stock/models/__init__.py index 19a6d6d1a02d..307bead04c23 100644 --- a/l10n_br_purchase_stock/models/__init__.py +++ b/l10n_br_purchase_stock/models/__init__.py @@ -1,6 +1,3 @@ -# Copyright (C) 2015 Renato Lima - Akretion -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - from . import res_company from . import purchase_order from . import purchase_order_line diff --git a/l10n_br_purchase_stock/models/purchase_order.py b/l10n_br_purchase_stock/models/purchase_order.py index 7ade7287e5f6..4ae3e89bf185 100644 --- a/l10n_br_purchase_stock/models/purchase_order.py +++ b/l10n_br_purchase_stock/models/purchase_order.py @@ -8,8 +8,8 @@ class PurchaseOrder(models.Model): _inherit = "purchase.order" - purchase_create_invoice_policy = fields.Selection( - related="company_id.purchase_create_invoice_policy", + purchase_invoicing_policy = fields.Selection( + related="company_id.purchase_invoicing_policy", ) # Make Invisible Invoice Button @@ -30,7 +30,7 @@ def _compute_get_button_create_invoice_invisible(self): ): button_create_invoice_invisible = True else: - if record.purchase_create_invoice_policy == "stock_picking": + if record.purchase_invoicing_policy == "stock_picking": # A criação de Fatura de Serviços deve ser possível via Pedido if not any( line.product_id.type == "service" for line in record.order_line @@ -44,7 +44,7 @@ def _prepare_picking(self): values = super()._prepare_picking() if self.fiscal_operation_id: values.update(self._prepare_br_fiscal_dict()) - if self.company_id.purchase_create_invoice_policy == "stock_picking": + if self.company_id.purchase_invoicing_policy == "stock_picking": values["invoice_state"] = "2binvoiced" return values diff --git a/l10n_br_purchase_stock/models/purchase_order_line.py b/l10n_br_purchase_stock/models/purchase_order_line.py index d351dc91f5b7..054aa9c06add 100644 --- a/l10n_br_purchase_stock/models/purchase_order_line.py +++ b/l10n_br_purchase_stock/models/purchase_order_line.py @@ -17,7 +17,7 @@ def _prepare_stock_moves(self, picking): for v in values: if self.order_id.fiscal_operation_id: v.update(self._prepare_br_fiscal_dict()) - if self.order_id.purchase_create_invoice_policy == "stock_picking": + if self.order_id.purchase_invoicing_policy == "stock_picking": v["invoice_state"] = "2binvoiced" return values diff --git a/l10n_br_purchase_stock/models/res_company.py b/l10n_br_purchase_stock/models/res_company.py index c704b8025a02..cb05f0f29615 100644 --- a/l10n_br_purchase_stock/models/res_company.py +++ b/l10n_br_purchase_stock/models/res_company.py @@ -13,7 +13,7 @@ class Company(models.Model): domain=[("state", "=", "approved"), ("fiscal_type", "=", "purchase")], ) - purchase_create_invoice_policy = fields.Selection( + purchase_invoicing_policy = fields.Selection( selection=[ ("purchase_order", _("Purchase Order")), ("stock_picking", _("Stock Picking")), diff --git a/l10n_br_purchase_stock/models/res_config_settings.py b/l10n_br_purchase_stock/models/res_config_settings.py index d6f0c61f76c7..afc09d2dda55 100644 --- a/l10n_br_purchase_stock/models/res_config_settings.py +++ b/l10n_br_purchase_stock/models/res_config_settings.py @@ -7,7 +7,7 @@ class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" - purchase_create_invoice_policy = fields.Selection( - related="company_id.purchase_create_invoice_policy", + purchase_invoicing_policy = fields.Selection( + related="company_id.purchase_invoicing_policy", readonly=False, ) diff --git a/l10n_br_purchase_stock/views/res_company_view.xml b/l10n_br_purchase_stock/views/res_company_view.xml index ca7a6ac404fd..d60cf2bd0b66 100644 --- a/l10n_br_purchase_stock/views/res_company_view.xml +++ b/l10n_br_purchase_stock/views/res_company_view.xml @@ -7,7 +7,7 @@ - + diff --git a/l10n_br_purchase_stock/views/res_config_settings.xml b/l10n_br_purchase_stock/views/res_config_settings.xml index e4e697b48ab6..2fe951328702 100644 --- a/l10n_br_purchase_stock/views/res_config_settings.xml +++ b/l10n_br_purchase_stock/views/res_config_settings.xml @@ -19,7 +19,7 @@ >
-