diff --git a/l10n_br_fiscal/__manifest__.py b/l10n_br_fiscal/__manifest__.py index 607830d50b4d..7dd1ef0b677b 100644 --- a/l10n_br_fiscal/__manifest__.py +++ b/l10n_br_fiscal/__manifest__.py @@ -3,14 +3,14 @@ { "name": "Módulo fiscal brasileiro", - "summary": "Fiscal module/tax engine for Brazil", + "summary": "root fiscal module for Brazil", "category": "Localisation", "license": "AGPL-3", "author": "Akretion, Odoo Community Association (OCA)", "maintainers": ["renatonlima"], "website": "https://github.com/OCA/l10n-brazil", "development_status": "Production/Stable", - "version": "16.0.2.8.2", + "version": "16.0.2.9.0", "depends": [ "product", "l10n_br_base", 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_line_mixin_methods.py b/l10n_br_fiscal/models/document_line_mixin_methods.py index 0442dbd36b41..c584abb7d6ed 100644 --- a/l10n_br_fiscal/models/document_line_mixin_methods.py +++ b/l10n_br_fiscal/models/document_line_mixin_methods.py @@ -886,6 +886,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"] 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") 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 diff --git a/l10n_br_fiscal/views/document_view.xml b/l10n_br_fiscal/views/document_view.xml index e6a3ffc91937..c243228b79bb 100644 --- a/l10n_br_fiscal/views/document_view.xml +++ b/l10n_br_fiscal/views/document_view.xml @@ -329,7 +329,7 @@ - + diff --git a/l10n_br_nfe/models/document_line.py b/l10n_br_nfe/models/document_line.py index d11fd09cb72b..f6fdeb568330 100644 --- a/l10n_br_nfe/models/document_line.py +++ b/l10n_br_nfe/models/document_line.py @@ -1301,6 +1301,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") diff --git a/l10n_br_nfe/models/document_supplement.py b/l10n_br_nfe/models/document_supplement.py index 85590853eec7..5fd8dde30201 100644 --- a/l10n_br_nfe/models/document_supplement.py +++ b/l10n_br_nfe/models/document_supplement.py @@ -1,18 +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" - _stacked = "nfe.40.infnfesupl" - _field_prefix = "nfe40_" - _schema_name = "nfe" - _schema_version = "4.0.0" - _odoo_module = "l10n_br_nfe" - _spec_module = "odoo.addons.l10n_br_nfe_spec.models.v4_0.leiaute_nfe_v4_00" - _spec_tab_name = "NFe" + _inherit = ["l10n_br_fiscal.document.supplement", "nfe.40.infnfesupl"] + + nfe40_qrCode = fields.Char(related="qrcode") + + nfe40_urlChave = fields.Char(related="url_key") 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