Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][l10n_br_fiscal] Oca port 14.0 to 16.0 7ffa39 #3516

Draft
wants to merge 8 commits into
base: 16.0
Choose a base branch
from
4 changes: 2 additions & 2 deletions l10n_br_fiscal/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
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 @@ -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"]
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 @@ -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")
Expand Down
17 changes: 7 additions & 10 deletions l10n_br_nfe/models/document_supplement.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# 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):
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")
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
Loading