From 8fea3e837cfcaa256087430c06fbc0ff5a252f99 Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Mon, 8 Apr 2024 11:24:18 -0300 Subject: [PATCH 1/8] [ADD] FCPST fields in NFe --- l10n_br_nfe/models/document_line.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/l10n_br_nfe/models/document_line.py b/l10n_br_nfe/models/document_line.py index 6952943f5037..18671eda3629 100644 --- a/l10n_br_nfe/models/document_line.py +++ b/l10n_br_nfe/models/document_line.py @@ -1300,6 +1300,11 @@ def map_binding_attr(attr, odoo_attr=None): map_binding_attr("pFCPST", "icmsfcpst_percent") map_binding_attr("vFCPST", "icmsfcpst_value") + # ICMS FCP ST Fields + map_binding_attr("vBCFCPST", "icmsfcpst_base") + map_binding_attr("pFCPST", "icmsfcpst_percent") + map_binding_attr("vFCPST", "icmsfcpst_value") + # ICMS DIFAL Fields map_binding_attr("vBCUFDest", "icms_destination_base") map_binding_attr("pICMSUFDest", "icms_origin_percent") From aa41a66e5d6700d2582b129f0155f5fc3f12ffa3 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Mon, 22 Jul 2024 18:56:12 -0300 Subject: [PATCH 2/8] [IMP] l10n_br_fiscal: change page name recipient to Partners --- l10n_br_fiscal/views/document_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_fiscal/views/document_view.xml b/l10n_br_fiscal/views/document_view.xml index 81d9a121230b..aa395189d450 100644 --- a/l10n_br_fiscal/views/document_view.xml +++ b/l10n_br_fiscal/views/document_view.xml @@ -329,7 +329,7 @@ - + From 41c7ad03e85a3974fdb060cb9ee47bc318bce8d8 Mon Sep 17 00:00:00 2001 From: Felipe Zago Date: Wed, 25 Sep 2024 15:52:53 -0300 Subject: [PATCH 3/8] [IMP] l10n_br_fiscal: imp document_supplement --- l10n_br_fiscal/models/__init__.py | 1 + l10n_br_fiscal/models/document_supplement.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 l10n_br_fiscal/models/document_supplement.py diff --git a/l10n_br_fiscal/models/__init__.py b/l10n_br_fiscal/models/__init__.py index ac376ef584d0..e0562968855e 100644 --- a/l10n_br_fiscal/models/__init__.py +++ b/l10n_br_fiscal/models/__init__.py @@ -58,3 +58,4 @@ from . import subsequent_document from . import document_email from . import city_taxation_code +from . import document_supplement diff --git a/l10n_br_fiscal/models/document_supplement.py b/l10n_br_fiscal/models/document_supplement.py new file mode 100644 index 000000000000..939a5cceff37 --- /dev/null +++ b/l10n_br_fiscal/models/document_supplement.py @@ -0,0 +1,13 @@ +# Copyright 2023 KMEE (Felipe Zago Rodrigues ) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class DocumentSupplement(models.Model): + _name = "l10n_br_fiscal.document.supplement" + _description = "Document Supplement Data" + + qrcode = fields.Char(string="QR Code") + + url_key = fields.Char(string="QR Code URL Key") From f450e888abc1eaa44fae1cf872084990a88f3063 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Wed, 16 Oct 2024 10:28:08 -0300 Subject: [PATCH 4/8] [RFC] l10n_br_nfe: document.supplement refactor --- l10n_br_nfe/models/document_supplement.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/l10n_br_nfe/models/document_supplement.py b/l10n_br_nfe/models/document_supplement.py index 1b875ea694b4..5fd8dde30201 100644 --- a/l10n_br_nfe/models/document_supplement.py +++ b/l10n_br_nfe/models/document_supplement.py @@ -1,14 +1,15 @@ # Copyright 2023 KMEE (Felipe Zago Rodrigues ) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import fields from odoo.addons.spec_driven_model.models import spec_models -class NFeSupplement(spec_models.StackedModel): +class NFeSupplement(spec_models.SpecModel): _name = "l10n_br_fiscal.document.supplement" - _description = "NFe Supplement Document" - _inherit = "nfe.40.infnfesupl" + _inherit = ["l10n_br_fiscal.document.supplement", "nfe.40.infnfesupl"] - _nfe40_odoo_module = "odoo.addons.l10n_br_nfe_spec.models.v4_0.leiaute_nfe_v4_00" - _nfe40_stacking_mixin = "nfe.40.infnfesupl" + nfe40_qrCode = fields.Char(related="qrcode") + + nfe40_urlChave = fields.Char(related="url_key") From e1e385492e9a55bc486f43ced82dbcf8d149663f Mon Sep 17 00:00:00 2001 From: kaynnan Date: Wed, 30 Oct 2024 13:32:41 -0300 Subject: [PATCH 5/8] [IMP] l10n_br_fiscal: Add onchange for service type in Document Line Mixin [IMP] l10n_br_fiscal: Add onchange for service type in Document Line Mixin --- l10n_br_fiscal/models/document_line_mixin_methods.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/l10n_br_fiscal/models/document_line_mixin_methods.py b/l10n_br_fiscal/models/document_line_mixin_methods.py index 6338d4d15ad3..53675d590f9b 100644 --- a/l10n_br_fiscal/models/document_line_mixin_methods.py +++ b/l10n_br_fiscal/models/document_line_mixin_methods.py @@ -897,6 +897,11 @@ def _onchange_city_taxation_code_id(self): if self.city_taxation_code_id.city_id: self.update({"issqn_fg_city_id": self.city_taxation_code_id.city_id}) + @api.onchange("service_type_id") + def _onchange_service_type_id(self): + if self.service_type_id: + self._onchange_fiscal_operation_id() + @api.model def _add_fields_to_amount(self): fields_to_amount = ["insurance_value", "other_value", "freight_value"] From 168a338f27a91c2e48bd3febdc45f4ae8e89cc99 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Tue, 26 Nov 2024 16:34:55 -0300 Subject: [PATCH 6/8] [IMP] l10n_br_fiscal: add l10n_br_fiscal.document.supplement security --- l10n_br_fiscal/security/ir.model.access.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/l10n_br_fiscal/security/ir.model.access.csv b/l10n_br_fiscal/security/ir.model.access.csv index a7f680f0b2b5..5242c8d02d2f 100644 --- a/l10n_br_fiscal/security/ir.model.access.csv +++ b/l10n_br_fiscal/security/ir.model.access.csv @@ -75,6 +75,8 @@ "l10n_br_fiscal_document_manager","Fiscal Document for Manager","model_l10n_br_fiscal_document","l10n_br_fiscal.group_manager",1,1,1,1 "l10n_br_fiscal_document_related_user","Fiscal Document Related for User","model_l10n_br_fiscal_document_related","l10n_br_fiscal.group_user",1,0,0,0 "l10n_br_fiscal_document_related_manager","Fiscal Document Related for Manager","model_l10n_br_fiscal_document_related","l10n_br_fiscal.group_manager",1,1,1,1 +"l10n_br_fiscal_document_supplement_user","Fiscal Document Supplement for User","model_l10n_br_fiscal_document_supplement","l10n_br_fiscal.group_user",1,0,0,0 +"l10n_br_fiscal_document_supplement_manager","Fiscal Document Supplement for Manager","model_l10n_br_fiscal_document_supplement","l10n_br_fiscal.group_manager",1,1,1,1 "l10n_br_fiscal_document_line_user","Fiscal Document Line for User","model_l10n_br_fiscal_document_line","l10n_br_fiscal.group_user",1,1,1,0 "l10n_br_fiscal_document_line_manager","Fiscal Document Line for Manager","model_l10n_br_fiscal_document_line","l10n_br_fiscal.group_manager",1,1,1,1 "l10n_br_fiscal_comment_user","Comment for User","model_l10n_br_fiscal_comment","l10n_br_fiscal.group_user",1,0,0,0 From 986b5131c6beb0eea287a3519bec8146948dc59f Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Tue, 26 Nov 2024 16:55:11 -0300 Subject: [PATCH 7/8] [IMP] l10n_br_nfe: remove l10n_br_fiscal.document.supplement security --- l10n_br_nfe/security/ir.model.access.csv | 2 -- 1 file changed, 2 deletions(-) diff --git a/l10n_br_nfe/security/ir.model.access.csv b/l10n_br_nfe/security/ir.model.access.csv index 717ea2f64112..672e48737f9e 100644 --- a/l10n_br_nfe/security/ir.model.access.csv +++ b/l10n_br_nfe/security/ir.model.access.csv @@ -11,7 +11,5 @@ access_l10n_br_account_product_nfe_export_user,access_l10n_br_account_product_nf access_l10n_br_account_product_nfe_export_manager,access_l10n_br_account_product_nfe_export_manager,model_l10n_br_account_product_nfe_export,l10n_br_nfe.group_manager,1,1,1,1 access_l10n_br_account_product_nfe_export_result_user,access_l10n_br_account_product_nfe_export_result_user,model_l10n_br_account_product_nfe_export_result,l10n_br_nfe.group_user,1,0,0,0 access_l10n_br_account_product_nfe_export_result_manager,access_l10n_br_account_product_nfe_export_result_manager,model_l10n_br_account_product_nfe_export_result,l10n_br_nfe.group_manager,1,1,1,1 -access_l10n_br_fiscal_document_supplement_user,access_l10n_br_fiscal_document_supplement_user,model_l10n_br_fiscal_document_supplement,l10n_br_nfe.group_user,1,0,0,0 -access_l10n_br_fiscal_document_supplement_manager,access_l10n_br_fiscal_document_supplement_manager,model_l10n_br_fiscal_document_supplement,l10n_br_nfe.group_manager,1,1,1,1 access_l10n_br_nfe_mde_user,access_l10n_br_nfe_mde_user,model_l10n_br_nfe_mde,l10n_br_nfe.group_user,1,0,0,0 access_l10n_br_nfe_mde_manager,access_l10n_br_nfe_mde_manager,model_l10n_br_nfe_mde,l10n_br_nfe.group_manager,1,1,1,1 From 7535ec4d28d85e1b499fb67cb0df4822eb9deea7 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Wed, 23 Oct 2024 09:26:03 -0300 Subject: [PATCH 8/8] [RFC] l10n_br_nfe: document.supplement refactor to stackedmodel --- l10n_br_nfe/models/document_supplement.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/l10n_br_nfe/models/document_supplement.py b/l10n_br_nfe/models/document_supplement.py index 5fd8dde30201..b8fd623215ea 100644 --- a/l10n_br_nfe/models/document_supplement.py +++ b/l10n_br_nfe/models/document_supplement.py @@ -6,10 +6,17 @@ from odoo.addons.spec_driven_model.models import spec_models -class NFeSupplement(spec_models.SpecModel): +class NFeSupplement(spec_models.StackedModel): + # FIXME: NFeSupplement should actually inherit from spec_models.SpecModel + # but it seems we had broken NFe or MDFe or CTe tests with SpecModel + # it's probably a spec_driven_model framework issue... So it has been reverted + # to StackedModel in https://github.com/OCA/l10n-brazil/pull/3445 _name = "l10n_br_fiscal.document.supplement" _inherit = ["l10n_br_fiscal.document.supplement", "nfe.40.infnfesupl"] + _nfe40_odoo_module = "odoo.addons.l10n_br_nfe_spec.models.v4_0.leiaute_nfe_v4_00" + _nfe40_stacking_mixin = "nfe.40.infnfesupl" + nfe40_qrCode = fields.Char(related="qrcode") nfe40_urlChave = fields.Char(related="url_key")