diff --git a/l10n_br_cte/models/__init__.py b/l10n_br_cte/models/__init__.py index 612c3174db49..10114c0129e2 100644 --- a/l10n_br_cte/models/__init__.py +++ b/l10n_br_cte/models/__init__.py @@ -4,3 +4,9 @@ from . import document_related from . import document_line from . import res_config_settings +from . import ferroviario +from . import rodoviario +from . import aereo +from . import dutoviario +from . import aquaviario +from . import rodo_occ diff --git a/l10n_br_cte/models/aereo.py b/l10n_br_cte/models/aereo.py new file mode 100644 index 000000000000..53bc75a88f02 --- /dev/null +++ b/l10n_br_cte/models/aereo.py @@ -0,0 +1,61 @@ +# Copyright 2023 KMEE INFORMATICA LTDA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields + +from odoo.addons.spec_driven_model.models import spec_models + + +class Aereo(spec_models.SpecModel): + _name = "l10n_br_cte.aereo" + _inherit = "cte.40.aereo" + + document_id = fields.One2many( + comodel_name="l10n_br_fiscal.document", inverse_name="cte40_aereo" + ) + + cte40_dPrevAereo = fields.Date(related="dPrevAereo", store=True) + + dPrevAereo = fields.Date( + string="Data prevista da entrega", + help="Data prevista da entrega\nFormato AAAA-MM-DD", + store="True", + ) + + cte40_natCarga = fields.One2many( + related="document_id.fiscal_line_ids", + ) + + cte40_tarifa = fields.Many2one(comodel_name="l10n_br_cte.tarifa") + + def export_data(self): + return { + "cte40_dPrevAereo": self.cte40_dPrevAereo, + "cte40_natCarga": {"cte40_xDime": self.cte40_natCarga.xDime}, + "cte40_tarifa": { + "cte40_CL": self.cte40_tarifa.cte40_CL, + "cte40_vTar": self.cte40_tarifa.cte40_vTar, + }, + } + + +class Tarifa(spec_models.SpecModel): + _name = "l10n_br_cte.tarifa" + _inherit = "cte.40.tarifa" + + cte40_CL = fields.Selection(related="CL", store=True) + + CL = fields.Selection( + string="Classe", + selection=[ + ("M", "Tarifa Mínima"), + ("G", "Tarifa Geral"), + ("E", "Tarifa Específica"), + ], + store=True, + default="G", + ) + + cte40_vTar = fields.Monetary(related="vTar") + + vTar = fields.Monetary(currency_field="brl_currency_id") diff --git a/l10n_br_cte/models/aquaviario.py b/l10n_br_cte/models/aquaviario.py new file mode 100644 index 000000000000..1d2ced2f76b4 --- /dev/null +++ b/l10n_br_cte/models/aquaviario.py @@ -0,0 +1,86 @@ +# Copyright 2023 KMEE INFORMATICA LTDA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields + +from odoo.addons.spec_driven_model.models import spec_models + + +class Aquaviario(spec_models.SpecModel): + _name = "l10n_br_cte.aquaviario" + _inherit = "cte.40.aquav" + + document_id = fields.One2many( + comodel_name="l10n_br_fiscal.document", inverse_name="cte40_aquav" + ) + + cte40_vPrest = fields.Monetary(compute="_compute_vPrest", store=True) + + cte40_vAFRMM = fields.Monetary(related="vAFRMM", store=True) + + vAFRMM = fields.Monetary( + string="AFRMM", + currency_field="brl_currency_id", + help=("AFRMM (Adicional de Frete para Renovação da Marinha Mercante)"), + store=True, + ) + + cte40_xNavio = fields.Char(related="xNavio", store=True) + + xNavio = fields.Char(string="Identificação do Navio", store=True) + + cte40_nViag = fields.Char(related="nViag", store=True) + + nViag = fields.Char(string="Número da Viagem", store=True) + + cte40_direc = fields.Selection(related="direc", store=True) + + direc = fields.Selection( + selection=[ + ("N", "Norte, L-Leste, S-Sul, O-Oeste"), + ("S", "Sul, O-Oeste"), + ("L", "Leste, S-Sul, O-Oeste"), + ("O", "Oeste"), + ], + string="Direção", + store=True, + help="Direção\nPreencher com: N-Norte, L-Leste, S-Sul, O-Oeste", + ) + + cte40_irin = fields.Char(related="irin", store=True) + + irin = fields.Char( + string="Irin do navio sempre deverá", + help="Irin do navio sempre deverá ser informado", + store=True, + ) + + cte40_tpNav = fields.Selection(related="tpNav", store=True) + + tpNav = fields.Selection( + selection=[ + ("0", "Interior"), + ("1", "Cabotagem"), + ], + string="Tipo de Navegação", + help=( + "Tipo de Navegação\nPreencher com: \n\t\t\t\t\t\t0 - " + "Interior;\n\t\t\t\t\t\t1 - Cabotagem" + ), + store=True, + ) + + def _compute_vPrest(self): + for record in self.document_id.fiscal_line_ids: + record.cte40_vPrest += record.cte40_vTPrest + + def export_data(self): + return { + "cte40_vPrest": self.cte40_vPrest, + "cte40_vAFRMM": self.cte40_vAFRMM, + "cte40_xNavio": self.cte40_xNavio, + "cte40_nViag": self.cte40_nViag, + "cte40_direc": self.cte40_direc, + "cte40_irin": self.cte40_irin, + "cte40_tpNav": self.cte40_tpNav, + } diff --git a/l10n_br_cte/models/document.py b/l10n_br_cte/models/document.py index 145f74b51239..c90d4b3611ea 100644 --- a/l10n_br_cte/models/document.py +++ b/l10n_br_cte/models/document.py @@ -349,15 +349,13 @@ def _compute_dest_data(self): # CT-e tag: imp ########################## - cte40_imp = fields.One2many( - comodel_name="l10n_br_fiscal.document.line", related="fiscal_line_ids" - ) + cte40_imp = fields.One2many(related="fiscal_line_ids") ##################################### # CT-e tag: infCTeNorm and infCteComp ##################################### - cte40_choice244 = fields.Selection( + cte40_choice_infcteNorm_infcteComp = fields.Selection( selection=[ ("cte40_infCTeComp", "infCTeComp"), ("cte40_infCTeNorm", "infCTeNorm"), @@ -396,9 +394,9 @@ def _compute_cte_doc(self): """Set schema data which are not just related fields""" for rec in self: if rec.document_type_id: - if rec.cte40_choice244 == "cte40_infNorm": + if rec.cte40_choice_infcteNorm_infcteComp == "cte40_infCTeNorm": rec.cte40_infCTeNorm = rec - elif rec.cte40_choice244 == "cte40_infComp": + elif rec.cte40_choice_infcteNorm_infcteComp == "infCTeComp": rec.cte40_infCTeComp = rec ########################## @@ -464,3 +462,50 @@ def _default_cte40_autxml(self): tpImp = fields.Selection( selection=[("1", "Retrato"), ("2", "Paisagem")], default="1" ) + + ########################## + # CT-e tag: modal + ########################## + + cte40_modal = fields.Selection(related="transport_modal") + + cte40_infModal = fields.Many2one(compute="_compute_modal") + + ########################## + # CT-e tag: modal + # Compute Methods + ########################## + + def _compute_modal(self): + if self.cte40_modal == "1": + self.cte40_infModal = self.cte40_rodoviario + elif self.cte40_modal == "2": + self.cte40_infModal = self.cte40_aereo + elif self.cte40_modal == "3": + self.cte40_infModal = self.cte40_aquav + elif self.cte40_modal == "4": + self.cte40_infModal = self.cte40_ferroviario + elif self.cte40_modal == "5": + self.cte40_infModal = self.cte40_dutoviario + elif self.cte40_modal == "6": + pass # TODO + + cte40_aquav = fields.Many2one( + comodel_name="l10n_br_cte.aquaviario", inverse_name="document_id" + ) + + cte40_dutoviario = fields.Many2one( + comodel_name="l10n_br_cte.dutoviario", inverse_name="document_id" + ) + + cte40_rodoviario = fields.Many2one( + comodel_name="l10n_br_cte.rodoviario", inverse_name="document_id" + ) + + cte40_ferroviario = fields.Many2one( + comodel_name="l10n_br_cte.ferroviario", inverse_name="document_id" + ) + + cte40_aereo = fields.Many2one( + comodel_name="l10n_br_cte.aereo", inverse_name="document_id" + ) diff --git a/l10n_br_cte/models/document_line.py b/l10n_br_cte/models/document_line.py index 01325e4c9549..af8c4e5901ef 100644 --- a/l10n_br_cte/models/document_line.py +++ b/l10n_br_cte/models/document_line.py @@ -40,7 +40,7 @@ class CTeLine(spec_models.StackedModel): # Grupo N06. Grupo Tributação do ICMS= 01 - ISSN ################################################# - cte40_choice11 = fields.Selection( + cte40_choice_ICMS = fields.Selection( selection=[ ("cte40_ICMS00", "ICMS00"), ("cte40_ICMS20", "ICMS20"), @@ -51,7 +51,7 @@ class CTeLine(spec_models.StackedModel): ("cte40_ICMSSN", "ICMSSN"), ], string="Tipo de ICMS", - compute="_compute_choice11", + compute="_compute_choice_icms", store=True, ) @@ -89,7 +89,7 @@ class CTeLine(spec_models.StackedModel): ########################## @api.depends("icms_cst_id") - def _compute_choice11(self): + def _compute_choice_icms(self): for record in self: icms_choice = "" if record.icms_cst_id.code in ICMS_CST: @@ -104,7 +104,7 @@ def _compute_choice11(self): icms_choice = "{}{}".format("cte40_ICMS", record.icms_cst_id.code) elif record.icms_cst_id.code in ICMS_SN_CST: icms_choice = "cte40_ICMSSN" - record.cte40_choice11 = icms_choice + record.cte40_choice_ICMS = icms_choice indSN = fields.Selection( selection=[ @@ -138,3 +138,16 @@ def _compute_cte40_ICMSUFFim(self): cte40_vFCPUFfim = fields.Monetary(related="icmsfcp_value", store=True) cte40_vICMSUFFim = fields.Monetary(related="icms_destination_value", store=True) cte40_vICMSUFIni = fields.Monetary(related="icms_origin_value", store=True) + + ########################## + # CT-e tag: natCarga + ########################## + + cte40_xDime = fields.Char(compute="_compute_dime", store=True) + + def _compute_dime(self): + for record in self: + for package in record.product_id.packaging_ids: + record.cte40_xDime = ( + package.width + "X" + package.packaging_length + "X" + package.width + ) diff --git a/l10n_br_cte/models/document_related.py b/l10n_br_cte/models/document_related.py index 9d6c77c08a5a..abbf2cc7ae4e 100644 --- a/l10n_br_cte/models/document_related.py +++ b/l10n_br_cte/models/document_related.py @@ -23,7 +23,7 @@ class CTeRelated(spec_models.StackedModel): _spec_module = "odoo.addons.l10n_br_cte_spec.models.v4_0.cte_tipos_basico_v4_00" _spec_tab_name = "CTe" - # infQ + # infQ TODO computes/relateds cte40_cUnid = fields.Selection(related="cUnid") cte40_tpMed = fields.Char() @@ -69,7 +69,7 @@ class CTeRelated(spec_models.StackedModel): inverse="_inverse_cte40_tpDoc", ) - cte40_infDoc = fields.Selection(related="cte40_choice254") + cte40_infDoc = fields.Selection(related="cte40_choice_infNF_infNFE_infOutros") # infCteNorm cte40_chCTe = fields.Char(compute="_compute_chCte", string="chCte") @@ -86,14 +86,14 @@ def _compute_chCTe(self): records += rec.document_key self.cte40_chCTe = records - cte40_choice254 = fields.Selection( + cte40_choice_infNF_infNFE_infOutros = fields.Selection( selection=[ - ("cte40_infNF", "infNF"), + ("cte40_infNF", "infNF"), # TODO ("cte40_infNFe", "infNFe"), ("cte40_infOutros", "Outros"), ], compute="_compute_cte_data", - inverse="_inverse_cte40_choice254", + inverse="_inverse_cte40_choice_infNF_infNFE_infOutros", ) def _compute_vCarga(self): @@ -107,10 +107,10 @@ def _compute_cte_data(self): for rec in self: if rec.document_type_id: if rec.document_type_id.code in ("55",): - rec.cte40_choice254 = "cte40_infNFe" + rec.cte40_choice_infNF_infNFE_infOutros = "cte40_infNFe" rec.cte40_chave = rec.document_key elif rec.document_type_id.code in ("00", "10", "59", "65", "99"): - rec.cte40_choice254 = "cte40_infOutros" + rec.cte40_choice_infNF_infNFE_infOutros = "cte40_infOutros" rec.cte40_tpDoc = rec.document_type_id.code def _inverse_cte40_chave(self): @@ -123,7 +123,7 @@ def _inverse_cte40_tpDoc(self): if rec.cte40_tpDoc: rec.document_type_id = rec.cte40_tpDoc - def _inverse_cte40_choice254(self): + def _inverse_cte40_choice_infNF_infNFE_infOutros(self): for rec in self: - if rec.cte40_choice254 == "cte40_infNFe": + if rec.cte40_choice_infNF_infNFE_infOutros == "cte40_infNFe": rec.document_type_id = self.env.ref("l10n_br_fiscal.document_55") diff --git a/l10n_br_cte/models/dutoviario.py b/l10n_br_cte/models/dutoviario.py new file mode 100644 index 000000000000..f075f9593215 --- /dev/null +++ b/l10n_br_cte/models/dutoviario.py @@ -0,0 +1,34 @@ +# Copyright 2023 KMEE INFORMATICA LTDA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields + +from odoo.addons.spec_driven_model.models import spec_models + + +class Dutoviario(spec_models.SpecModel): + _name = "l10n_br_cte.dutoviario" + _inherit = ["cte.40.duto"] + + document_id = fields.One2many( + comodel_name="l10n_br_fiscal.document", inverse_name="cte40_dutoviario" + ) + + cte40_dIni = fields.Date(related="dIni") + + dIni = fields.Date(string="Data de Início da prestação do serviço") + + cte40_dFim = fields.Date(related="dFim") + + dFim = fields.Date(string="Data de Fim da prestação do serviço") + + cte40_vTar = fields.Float(related="vTar") + + vTar = fields.Float(string="Valor da tarifa") + + def export_data(self): + return { + "cte40_dIni": self.cte40_dIni, + "cte40_dFim": self.cte40_dFim, + "cte40_vTar": self.cte40_vTar, + } diff --git a/l10n_br_cte/models/ferroviario.py b/l10n_br_cte/models/ferroviario.py new file mode 100644 index 000000000000..b7ec54352624 --- /dev/null +++ b/l10n_br_cte/models/ferroviario.py @@ -0,0 +1,126 @@ +# Copyright 2023 KMEE INFORMATICA LTDA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields + +from odoo.addons.spec_driven_model.models import spec_models + + +class Ferroviario(spec_models.SpecModel): + _name = "l10n_br_cte.ferroviario" + _inherit = "cte.40.ferrov" + + document_id = fields.One2many( + comodel_name="l10n_br_fiscal.document", inverse_name="cte40_ferroviario" + ) + + cte40_tpTraf = fields.Selection(related="tpTraf", store=True) + + cte40_fluxo = fields.Char(related="fluxo", store=True) + + tpTraf = fields.Selection( + selection=[ + ("0", "Próprio"), + ("1", "Mútuo"), + ("2", "Rodoferroviário"), + ("3", "Rodoviário."), + ], + default="0", + ) + + fluxo = fields.Char( + string="Fluxo Ferroviário", + help=( + "Fluxo Ferroviário\nTrata-se de um número identificador do " + "contrato firmado com o cliente" + ), + ) + + # TRAFMUT + cte40_trafMut = fields.Many2one( + comodel_name="l10n_br_fiscal.document", + string="Detalhamento de informações", + help="Detalhamento de informações para o tráfego mútuo", + ) + + cte40_vFrete = fields.Monetary( + related="cte40_trafMut.amount_freight_value", + currency_field="brl_currency_id", + ) + + cte40_respFat = fields.Selection(related="respFat") + + respFat = fields.Selection( + selection=[ + ("1", "Ferrovia de origem"), + ("2", "Ferrovia de destino"), + ] + ) + + cte40_ferrEmi = fields.Selection( + related="ferrEmi", + string="Ferrovia Emitente do CTe", + xsd_required=True, + help=( + "Ferrovia Emitente do CTe\nPreencher com: " + "\n\t\t\t\t\t\t\t\t\t1-Ferrovia de origem; " + "\n\t\t\t\t\t\t\t\t\t2-Ferrovia de destino" + ), + ) + + ferrEmi = fields.Selection( + selection=[ + ("1", "Ferrovia de origem"), + ("2", "Ferrovia de destino"), + ] + ) + + cte40_ferroEnv = fields.One2many( + comodel_name="l10n_br_cte.ferroenv", + inverse_name="cte40_cInt", + string="Informações das Ferrovias Envolvidas", + ) + + def export_data(self): + return { + "cte40_tpTraf": self.cte40_tpTraf, + "cte40_fluxo": self.cte40_fluxo, + "cte40_vFrete": self.cte40_vFrete, + "cte40_respFat": self.cte40_respFat, + "cte40_ferrEmi": self.cte40_ferrEmi, + "cte40_ferroEnv": self.cte40_ferroEnv, + } + + +class FerroEnv(spec_models.SpecModel): + _name = "l10n_br_cte.ferroenv" + _inherit = "cte.40.ferroenv" + + partner_id = fields.Many2one( + comodel_name="res.partner", + string="Ferrovias Envolvidas", + ) + + cte40_cInt = fields.Char( + related="cInt", + string="Código interno da Ferrovia envolvida", + help="Código interno da Ferrovia envolvida\nUso da transportadora", + ) + + cInt = fields.Char() + + def export_data(self): + return { + "cte40_cInt": self.cte40_cInt, + "cte40_CNPJ": self.partner_id.cte40_CNPJ, + "cte40_IE": self.partner_id.cte40_IE, + "cte40_xNome": self.partner_id.cte40_xNome, + "cte40_nro": self.partner_id.cte40_nro, + "cte40_xLgr": self.partner_id.cte40_xLgr, + "cte40_xCPL": self.partner_id.cte40_xCPL, + "cte40_xBairro": self.partner_id.cte40_xBairro, + "cte40_cMun": self.partner_id.cte40_cMun, + "cte40_xMun": self.partner_id.cte40_xMun, + "cte40_CEP": self.partner_id.cte40_CEP, + "cte40_UF": self.partner_id.cte40_UF, + } diff --git a/l10n_br_cte/models/res_company.py b/l10n_br_cte/models/res_company.py index 1a71f3098d2d..4985e4aae6c6 100644 --- a/l10n_br_cte/models/res_company.py +++ b/l10n_br_cte/models/res_company.py @@ -51,12 +51,6 @@ class ResCompany(spec_models.SpecModel): # CT-e models fields ########################## - rntrc_code = fields.Char( - string="RNTRC", - store=True, - help="Registro Nacional de Transportadores Rodoviários de Carga", - ) - cte_default_serie_id = fields.Many2one( comodel_name="l10n_br_fiscal.document.serie", string="CT-e Default Serie", diff --git a/l10n_br_cte/models/res_partner.py b/l10n_br_cte/models/res_partner.py index 8b59e0d471a3..a6a331fe558c 100644 --- a/l10n_br_cte/models/res_partner.py +++ b/l10n_br_cte/models/res_partner.py @@ -10,7 +10,6 @@ _logger = logging.getLogger(__name__) try: - from erpbrasil.base.fiscal import cnpj_cpf from erpbrasil.base.misc import format_zipcode, punctuation_rm except ImportError: _logger.error("Biblioteca erpbrasil.base não instalada") @@ -37,7 +36,6 @@ class ResPartner(spec_models.SpecModel): cte40_CPF = fields.Char( compute="_compute_cte_data", - inverse="_inverse_cte40_CPF", store=True, ) @@ -64,6 +62,8 @@ class ResPartner(spec_models.SpecModel): store=True, ) + cte40_IE = fields.Char(related="inscr_est") + cte40_xNome = fields.Char(related="legal_name", store=True) @api.depends("company_type", "inscr_est", "cnpj_cpf", "country_id") @@ -78,35 +78,6 @@ def _compute_cte_data(self): rec.cte40_CNPJ = None rec.cte40_CPF = cnpj_cpf - def _inverse_cte40_CNPJ(self): - for rec in self: - if rec.cte40_CNPJ: - rec.is_company = True - rec.cte40_choice2 = "cte40_CPF" - rec.cte40_choice6 = "cte40_CPF" - if rec.country_id.code != "BR": - rec.cte40_choice7 = "cte40_idEstrangeiro" - else: - rec.cte40_choice7 = "cte40_CNPJ" - rec.cte40_choice7 = "cte40_CPF" - rec.cte40_choice8 = "cte40_CPF" - rec.cte40_choice19 = "cte40_CPF" - rec.cnpj_cpf = cnpj_cpf.formata(str(rec.cte40_CNPJ)) - - def _inverse_cte40_CPF(self): - for rec in self: - if rec.cte40_CPF: - rec.is_company = False - rec.cte40_choice2 = "cte40_CNPJ" - rec.cte40_choice6 = "cte40_CNPJ" - if rec.country_id.code != "BR": - rec.cte40_choice7 = "cte40_idEstrangeiro" - else: - rec.cte40_choice7 = "cte40_CPF" - rec.cte40_choice8 = "cte40_CNPJ" - rec.cte40_choice19 = "cte40_CNPJ" - rec.cnpj_cpf = cnpj_cpf.formata(str(rec.cte40_CPF)) - def _inverse_cte40_CEP(self): for rec in self: if rec.cte40_CEP: diff --git a/l10n_br_cte/models/rodo_occ.py b/l10n_br_cte/models/rodo_occ.py new file mode 100644 index 000000000000..e223b49f760a --- /dev/null +++ b/l10n_br_cte/models/rodo_occ.py @@ -0,0 +1,44 @@ +# Copyright 2023 KMEE INFORMATICA LTDA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields + +from odoo.addons.spec_driven_model.models import spec_models + + +class Occ(spec_models.SpecModel): + _name = "l10n_br_cte.occ" + _inherit = ["cte.40.occ"] + + cte40_occ_rodo_id = fields.Many2one( + comodel_name="l10n_br_fiscal.rodo", ondelete="cascade" + ) + + cte40_serie = fields.Char(related="serie") + + serie = fields.Char(string="Série da OCC") + + cte40_nOcc = fields.Char(related="nOcc") + + nOcc = fields.Char(string="Número da Ordem de coleta") + + cte40_dEmi = fields.Date(related="dEmi") + + dEmi = fields.Date( + string="Data de emissão da ordem de coleta", + help="Data de emissão da ordem de coleta\nFormato AAAA-MM-DD", + ) + + cte40_emiOcc = fields.Many2one(comodel_name="res.partner", string="emiOcc") + + def export_data(self): + return { + "cte40_serie": self.cte40_serie, + "cte40_nOcc": self.cte40_nOcc, + "cte40_dEmi": self.cte40_dEmi, + "cte40_emiOcc": { + "cte40_CNPJ": self.cte40_emiOcc.cte40_serie, + "cte40_IE": self.cte40_emiOcc.cte40_IE, + "cte40_UF": self.cte40_emiOcc.cte40_UF, + }, + } diff --git a/l10n_br_cte/models/rodoviario.py b/l10n_br_cte/models/rodoviario.py new file mode 100644 index 000000000000..5819dc460ba0 --- /dev/null +++ b/l10n_br_cte/models/rodoviario.py @@ -0,0 +1,34 @@ +# Copyright 2023 KMEE INFORMATICA LTDA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields + +from odoo.addons.spec_driven_model.models import spec_models + + +class Rodoviario(spec_models.SpecModel): + _name = "l10n_br_cte.rodoviario" + _inherit = ["cte.40.rodo"] + + document_id = fields.One2many( + comodel_name="l10n_br_fiscal.document", inverse_name="cte40_rodoviario" + ) + + cte40_RNTRC = fields.Char( + string="RNTRC", + store=True, + related="document_id.cte40_emit.partner_id.rntrc_code", + help="Registro Nacional de Transportadores Rodoviários de Carga", + ) + + cte40_occ = fields.One2many( + comodel_name="l10n_br_cte.occ", + inverse_name="cte40_occ_rodo_id", + string="Ordens de Coleta associados", + ) + + def export_data(self): + return { + "cte40_RNTRC": self.cte40_RNTRC, + "cte40_occ": self.cte40_occ, + }