Skip to content

Commit

Permalink
Merge PR #3516 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rvalyi
  • Loading branch information
OCA-git-bot committed Jan 15, 2025
2 parents 495128a + b6504b1 commit 1ae5896
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 5 deletions.
1 change: 1 addition & 0 deletions l10n_br_fiscal/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@
from . import subsequent_document
from . import document_email
from . import city_taxation_code
from . import document_supplement
5 changes: 5 additions & 0 deletions l10n_br_fiscal/models/document_line_mixin_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,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"]
Expand Down
13 changes: 13 additions & 0 deletions l10n_br_fiscal/models/document_supplement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 KMEE (Felipe Zago Rodrigues <[email protected]>)
# 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")
2 changes: 2 additions & 0 deletions l10n_br_fiscal/security/ir.model.access.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_fiscal/views/document_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
</group>
</group>
</page>
<page name="recipient" string="Recipient">
<page name="partners" string="Partners">
<group name="partner">
<field name="partner_id" />
</group>
Expand Down
5 changes: 5 additions & 0 deletions l10n_br_nfe/models/document_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,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")
Expand Down
12 changes: 10 additions & 2 deletions l10n_br_nfe/models/document_supplement.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# Copyright 2023 KMEE (Felipe Zago Rodrigues <[email protected]>)
# 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):
# 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"
_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")
2 changes: 0 additions & 2 deletions l10n_br_nfe/security/ir.model.access.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1ae5896

Please sign in to comment.