Skip to content
Health
45/100
poor
  • Security10/25
    1 grave, 0 minor
  • Activity25/25
    Last human commit 1 month ago
  • Required by5/25
    0 modules depend on it
  • Maturity5/25
    In 1 Odoo series since 18.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
0
Modules depending on it
External deps
9 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
1.22 MB
Module directory on disk
Code analysis 9 migration notes 28 models 23 views 1 HTTP endpoint

Description

Este módulo implementa a Onda 1 da Declaração de Regimes Específicos (DeRE) brasileira, leiaute 1.2.0.

Ele permite que uma empresa no Odoo:

  • grave o regime tributário DeRE, as atividades e o plano referencial
  • mapeie os campos do PGCC em account.group (sintético) e account.account (analítico), com o codTrib escolhido na Tabela 11 do Anexo I, versão 1.3.0
  • mantenha D-1001 / D-1011 e o snapshot do PGCC em um período de vigência da empresa, reutilizado pelas declarações mensais
  • monte o balancete do D-1101 a partir dos lançamentos contábeis, as aplicações da reserva técnica do D-1106 a partir dos ativos cadastrados e as deduções do D-1121 a partir dos documentos fiscais de entrada das operações marcadas como dedutíveis
  • gere o XML local de D-1001, D-1011, D-1101, D-1106, D-1121, D-1198 e D-1199, conferido contra o XSD oficial
  • envie lotes assinados à Receita Integra, consulte o processamento (manual ou por cron com backoff) e grave protocolo, recibo e retornos D-9xxx
  • mantenha os totais da RFB (D-9101 / D-9106 / D-9112), o retorno de reabertura D-9198, a apuração IBS/CBS do D-9199 e o extrato de vigência do D-9001 ao lado dos dados locais, sem lançar um account.move
  • exporte as grades dos eventos em XLSX e imprima a apuração da RFB em PDF

Não implementa regras setoriais (por exemplo conciliação de contraprestação versus taxa de administração em planos de saúde). Isso fica nos dados da empresa ou em um módulo extra dedicado.

Quem é obrigado ao D-2101 (débito em operações com títulos de dívida com oferta pública) não encerra o mês só com este módulo. A RFB rejeita o D-1199 pela regra EVENTOS_OBRIGATORIOS_PERIODO (MOD 1.3.0, 3.1.2).

Dependencies

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

Views touched 23

XML IDNameModelTypeStatus
report_dere_rfb_assessment report_dere_rfb_assessment ir.ui.view qweb New
view_account_form account.account.form.l10n.br.dere account.account form Inherits account.view_account_form
view_account_group_form account.group.form.l10n.br.dere account.group form Inherits account.view_account_group_form
view_account_group_list account.group.list.l10n.br.dere account.group list Inherits account.view_account_group_tree
view_account_list account.account.list.l10n.br.dere account.account list Inherits account.view_account_list
view_company_form res.company.form.l10n.br.dere res.company form Inherits base.view_company_form
view_dere_activity_form l10n_br_dere.activity.form l10n_br_dere.activity form New
view_dere_activity_tree l10n_br_dere.activity.list l10n_br_dere.activity list New
view_dere_batch_form l10n_br_dere.batch.form l10n_br_dere.batch form New
view_dere_declaration_form l10n_br_dere.declaration.form l10n_br_dere.declaration form New
view_dere_declaration_tree l10n_br_dere.declaration.list l10n_br_dere.declaration list New
view_dere_event_form l10n_br_dere.event.form l10n_br_dere.event form New
view_dere_event_operation_wizard_form l10n_br_dere.event.operation.wizard.form l10n_br_dere.event.operation.wizard form New
view_dere_event_tree l10n_br_dere.event.list l10n_br_dere.event list New
view_dere_pgcc_account_form l10n_br_dere.pgcc.account.form l10n_br_dere.pgcc.account form New
view_dere_pgcc_account_tree l10n_br_dere.pgcc.account.list l10n_br_dere.pgcc.account list New
view_dere_reserve_asset_form l10n_br_dere.reserve.asset.form l10n_br_dere.reserve.asset form New
view_dere_reserve_asset_tree l10n_br_dere.reserve.asset.list l10n_br_dere.reserve.asset list New
view_dere_table_period_form l10n_br_dere.table.period.form l10n_br_dere.table.period form New
view_dere_table_period_tree l10n_br_dere.table.period.list l10n_br_dere.table.period list New
view_dere_tax_code_form l10n_br_dere.tax.code.form l10n_br_dere.tax.code form New
view_dere_tax_code_tree l10n_br_dere.tax.code.list l10n_br_dere.tax.code list New
view_fiscal_operation_form l10n_br_fiscal.operation.form.l10n.br.dere l10n_br_fiscal.operation form Inherits l10n_br_fiscal.operation_form

HTTP endpoints 1

Route(s)HandlerAuthTypeMethodsFlags
/l10n_br_dere/xlsx/<string:model>/<int:res_id> DereXlsxController.download_xlsx user http ALL

Models touched 28

New fields (16)
  • l10n_br_dere_cod_nat Selection
    help='Leave empty to inherit the nature code from the account group.' string='DeRE nature code' args: COD_NAT
  • l10n_br_dere_cod_trib Many2one → l10n_br_dere.tax.code
    comodel_name='l10n_br_dere.tax.code' string='DeRE taxation code'
  • l10n_br_dere_cod_trib_description Text
    related='l10n_br_dere_cod_trib.description' string='Taxation code description'
  • l10n_br_dere_cta Char
    compute='_compute_l10n_br_dere_cta' size=53 store=True string='DeRE full account'
  • l10n_br_dere_cta_interna Char
    help='Alphanumeric internal code without dots or dashes.' size=50 string='DeRE internal account'
  • l10n_br_dere_cta_ref Char
    help='Filled from the account group when you set the account code and this field is still empty. Clear it to keep the account out of the PGCC.' size=13 string='DeRE referential account'
  • l10n_br_dere_cta_sup_id Many2one → account.group
    comodel_name='account.group' help='Leave empty to use the prefix account group. Set only when the chart is not prefix-based.' ondelete='restrict' string='DeRE parent group'
  • l10n_br_dere_dbr_mista Char
    default='000' size=3 string='DeRE mixed-account split'
  • l10n_br_dere_desc_cta Char
    size=600 string='DeRE account description'
  • l10n_br_dere_id_lei_disp Char
    help='Official DeRE code idLeiDisp (mask 99-99). Leave empty to omit it from the event.' size=5 string='DeRE legal-provision id'
  • l10n_br_dere_ind_cta Selection
    compute='_compute_l10n_br_dere_hierarchy' help='Analytic accounts are always A. Synthetic nodes live on account groups.' string='DeRE account indicator' args: IND_CTA
  • l10n_br_dere_ind_trib_iss Selection
    string='DeRE ISS indicator' args: IND_TRIB_ISS
  • l10n_br_dere_nat_cta Selection
    help='Leave empty to inherit the nature from the account group.' string='DeRE account nature' args: NAT_CTA
  • l10n_br_dere_nivel_cta Integer
    compute='_compute_l10n_br_dere_hierarchy' string='DeRE account level'
  • l10n_br_dere_reserve_income_account_id Many2one → account.account
    comodel_name='account.account' help='Optional income account whose period credits fill D-1106 vRendPerReceb when the coupon does not hit the investment account.' ondelete='restrict' string='DeRE reserve income account'
  • l10n_br_dere_reserve_invest Boolean
    help='Mark analytic accounts that hold technical-reserve investments reported on D-1106.' string='DeRE technical-reserve investment'
Public methods (0)

No public methods.

New fields (10)
  • l10n_br_dere_cod_nat Selection
    string='DeRE nature code' args: COD_NAT
  • l10n_br_dere_cta Char
    compute='_compute_l10n_br_dere_cta' size=53 store=True string='DeRE full account'
  • l10n_br_dere_cta_interna Char
    help='Alphanumeric internal code without dots or dashes. Defaults to the group prefix.' size=50 string='DeRE internal account'
  • l10n_br_dere_cta_ref Char
    size=13 string='DeRE referential account'
  • l10n_br_dere_cta_sup Char
    compute='_compute_l10n_br_dere_hierarchy' size=53 string='DeRE parent account'
  • l10n_br_dere_dbr_mista Char
    default='000' size=3 string='DeRE mixed-account split'
  • l10n_br_dere_desc_cta Char
    size=600 string='DeRE account description'
  • l10n_br_dere_id_lei_disp Char
    help='Official DeRE code idLeiDisp (mask 99-99). Leave empty to omit it from the event.' size=5 string='DeRE legal-provision id'
  • l10n_br_dere_nat_cta Selection
    string='DeRE account nature' args: NAT_CTA
  • l10n_br_dere_nivel_cta Integer
    compute='_compute_l10n_br_dere_hierarchy' recursive=True string='DeRE account level'
Public methods (0)

No public methods.

New fields (4)
  • active Boolean
    default=True
  • code Char
    required=True size=3
  • name Char
    required=True translate=True
  • table_code Selection
    default='31' required=True args: [('21', 'Table 21 - Financial services'), ('31', 'Table 31 - Health-care plans'), ('41', 'Table 41 - Prize contests')]
Public methods (0)

No public methods.

New fields (14)
  • company_id Many2one → res.company
    comodel_name='res.company' compute='_compute_company_id' index=True store=True
  • consult_attempts Integer
    default=0
  • declaration_id Many2one → l10n_br_dere.declaration
    comodel_name='l10n_br_dere.declaration' ondelete='cascade'
  • event_ids Many2many → l10n_br_dere.event
    comodel_name='l10n_br_dere.event' string='Events'
  • name Char
    default='New' required=True
  • next_consult_at Datetime
    string='Next consult'
  • protocol Char
    size=28 string='Batch protocol'
  • response_pretty Text
    compute='_compute_response_pretty' string='Indented response'
  • response_text Text
    string='Response'
  • state Selection
    default='draft' required=True args: [('draft', 'Draft'), ('sent', 'Sent'), ('unknown', 'Unknown'), ('done', 'Done'), ('error', 'Error')]
  • table_period_id Many2one → l10n_br_dere.table.period
    comodel_name='l10n_br_dere.table.period' ondelete='cascade'
  • tp_amb Selection
    required=True string='Environment' args: TP_AMB
  • xml_content Text
    string='XML'
  • xml_pretty Text
    compute='_compute_xml_pretty' string='Indented XML'
Public methods (1)
  • action_consult(self)

New fields (33)
  • batch_ids One2many → l10n_br_dere.batch
    comodel_name='l10n_br_dere.batch' inverse_name='declaration_id'
  • can_close_period Boolean
    compute='_compute_closing_actions' string='Can close period'
  • can_consult_results Boolean
    compute='_compute_closing_actions' string='Can consult results'
  • can_discard_local_closing Boolean
    compute='_compute_closing_actions' string='Can discard local closing'
  • can_discard_local_reopening Boolean
    compute='_compute_closing_actions' string='Can discard local reopening'
  • can_generate_d1106 Boolean
    compute='_compute_closing_actions' string='Can generate D-1106'
  • can_generate_d1121 Boolean
    compute='_compute_closing_actions' string='Can generate D-1121'
  • can_generate_trial Boolean
    compute='_compute_closing_actions' string='Can generate trial balance'
  • can_load_deductions Boolean
    compute='_compute_closing_actions' string='Can load deductions'
  • can_rectify_d1121 Boolean
    compute='_compute_closing_actions'
  • can_reopen_period Boolean
    compute='_compute_closing_actions' string='Can reopen period'
  • can_replace_d1106 Boolean
    compute='_compute_closing_actions'
  • can_replace_d1121 Boolean
    compute='_compute_closing_actions'
  • can_replace_trial Boolean
    compute='_compute_closing_actions'
  • can_send_periodics Boolean
    compute='_compute_closing_actions' string='Can send periodics'
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> index=True required=True
  • date_from Date
    compute='_compute_period_dates' store=True
  • date_to Date
    compute='_compute_period_dates' store=True
  • deduction_line_ids One2many → l10n_br_dere.deduction.line
    comodel_name='l10n_br_dere.deduction.line' inverse_name='declaration_id'
  • event_ids One2many → l10n_br_dere.event
    comodel_name='l10n_br_dere.event' inverse_name='declaration_id'
  • fim_valid Date
    related='table_period_id.fim_valid' string='Table validity end'
  • ind_inexist_dedu Boolean
    help='Only if the company is subject to D-1121 and has no deductions.' string='Declare no deductions'
  • ini_valid Date
    related='table_period_id.ini_valid' string='Table validity start'
  • name Char
    compute='_compute_name' store=True
  • per_apur Char
    help='Format YYYY-MM.' required=True size=7 string='Assessment period' tracking=True
  • pgcc_account_ids One2many
    help='Read-only snapshot of the table period. Edit PGCC on Fiscal → DeRE → Table Periods before D-1011 is accepted.' readonly=True related='table_period_id.pgcc_account_ids'
  • primary_action Selection
    compute='_compute_closing_actions' selection=PRIMARY_ACTIONS string='Primary action'
  • reserve_line_ids One2many → l10n_br_dere.reserve.line
    comodel_name='l10n_br_dere.reserve.line' inverse_name='declaration_id'
  • state Selection
    default='draft' required=True tracking=True args: [('draft', 'Draft'), ('trial_ok', 'Trial balance ready'), ('closed', 'Closed'), ('reopened', 'Reopened')]
  • subject_d1106 Boolean
    related='company_id.dere_subject_d1106'
  • subject_d1121 Boolean
    related='company_id.dere_subject_d1121'
  • table_period_id Many2one → l10n_br_dere.table.period
    comodel_name='l10n_br_dere.table.period' compute='_compute_table_period_id' index=True readonly=False store=True
  • trial_line_ids One2many → l10n_br_dere.trial.line
    comodel_name='l10n_br_dere.trial.line' inverse_name='declaration_id'
Public methods (20)
  • action_apply_return_xml(self, xml_content)
  • action_discard_local_closing(self)
  • action_discard_local_reopening(self)
  • action_exclude_d1101(self)
  • action_exclude_d1106(self)
  • action_exclude_d1121(self)
  • action_generate_d1101(self)
  • action_generate_d1106(self)
  • action_generate_d1121(self)
  • action_generate_d1199(self)
  • action_load_deductions(self)
  • action_mark_reopened(self)
  • action_rectify_d1121(self)
  • action_replace_d1101(self)
  • action_replace_d1106(self)
  • action_replace_d1121(self)
  • action_send_periodics(self)
  • create(self, vals_list)
    @api.model_create_multi
  • unlink(self)
  • write(self, vals)

New fields (12)
  • rfb_assessment_event_id Many2one → l10n_br_dere.event
    comodel_name='l10n_br_dere.event' copy=False help='Accepted D-1199 whose D-9199 return filled the RFB assessment.' readonly=True string='Assessment return'
  • rfb_mismatch Boolean
    compute='_compute_rfb_assessment' help='The RFB return differs from the local data or used another receipt than the events in force.' string='RFB mismatch'
  • rfb_nr_recibo_aplic_fin Char
    copy=False readonly=True size=31 string='Technical-reserve receipt used'
  • rfb_nr_recibo_balancete Char
    copy=False readonly=True size=31 string='Trial balance receipt used'
  • rfb_nr_recibo_rel_dedu Char
    copy=False readonly=True string='Deduction receipts used'
  • rfb_total_ids Many2many → l10n_br_dere.event.total
    comodel_name='l10n_br_dere.event.total' compute='_compute_rfb_assessment' string='RFB totals'
  • rfb_v_cbs Monetary
    copy=False currency_field='brl_currency_id' readonly=True string='RFB CBS'
  • rfb_v_ibs_mun Monetary
    copy=False currency_field='brl_currency_id' readonly=True string='RFB municipal IBS'
  • rfb_v_ibs_tot Monetary
    copy=False currency_field='brl_currency_id' readonly=True string='RFB total IBS'
  • rfb_v_ibs_uf Monetary
    copy=False currency_field='brl_currency_id' readonly=True string='RFB state IBS'
  • rfb_v_is Monetary
    copy=False currency_field='brl_currency_id' readonly=True string='RFB IS'
  • tax_assessment_line_ids One2many → l10n_br_dere.tax.assessment.line
    comodel_name='l10n_br_dere.tax.assessment.line' inverse_name='declaration_id' string='RFB tax bases'
Public methods (0)

No public methods.

New fields (6)
  • company_id Many2one
    index=True related='line_id.company_id' store=True
  • dere12_nItem Char
    help='Official DeRE field nItem.' required=True size=3 string='Item number'
  • dere12_vItem Monetary
    currency_field='brl_currency_id' help='Official DeRE field vItem.' required=True string='Item amount'
  • dere12_vItemDed Monetary
    currency_field='brl_currency_id' help='Official DeRE field vItemDed.' required=True string='Item deduction this period'
  • dere12_vItemDedTotal Monetary
    currency_field='brl_currency_id' help='Official DeRE field vItemDedTotal.' string='Item deductible total'
  • line_id Many2one → l10n_br_dere.deduction.line
    comodel_name='l10n_br_dere.deduction.line' index=True ondelete='cascade' required=True
Public methods (2)
  • unlink(self)
  • write(self, vals)

New fields (11)
  • company_id Many2one
    index=True related='declaration_id.company_id' store=True
  • declaration_id Many2one → l10n_br_dere.declaration
    comodel_name='l10n_br_dere.declaration' index=True ondelete='cascade' required=True
  • dere12_chDFe Char
    help='Official DeRE field chDFe.' size=53 string='Access key'
  • dere12_dtEmi Date
    help='Official DeRE field dtEmi.' required=True string='Issue date'
  • dere12_tpAtiv Selection
    help='Official DeRE field tpAtiv.' required=True string='Activity type' args: TP_ATIV
  • dere12_tpDFe Selection
    help='Official DeRE field tpDFe.' string='Fiscal document type' args: TP_DFE
  • dere12_vDed Monetary
    currency_field='brl_currency_id' help='Official DeRE field vDed.' required=True string='Deduction this period'
  • dere12_vDedTotal Monetary
    currency_field='brl_currency_id' help='Official DeRE field vDedTotal. Only in the issue month.' string='Total deductible'
  • dere12_vOper Monetary
    currency_field='brl_currency_id' help='Official DeRE field vOper.' required=True string='Operation amount'
  • document_id Many2one → l10n_br_fiscal.document
    comodel_name='l10n_br_fiscal.document' ondelete='restrict' string='Fiscal document'
  • item_ids One2many → l10n_br_dere.deduction.item
    comodel_name='l10n_br_dere.deduction.item' inverse_name='line_id' string='Deduction items'
Public methods (2)
  • unlink(self)
  • write(self, vals)

New fields (33)
  • aplic_emi Selection
    default='1' required=True string='Issuer' args: APLIC_EMI
  • can_exclude_event Boolean
    compute='_compute_event_operations' string='Can exclude event'
  • can_rectify_event Boolean
    compute='_compute_event_operations' string='Can rectify event'
  • can_replace_event Boolean
    compute='_compute_event_operations' string='Can replace event'
  • cd_retorno Selection
    string='Return code' args: CD_RETORNO
  • company_id Many2one → res.company
    comodel_name='res.company' compute='_compute_company_id' index=True store=True
  • declaration_id Many2one → l10n_br_dere.declaration
    comodel_name='l10n_br_dere.declaration' index=True ondelete='cascade'
  • desc_retorno Char
    string='Return description'
  • dh_process Datetime
    copy=False string='Processed at'
  • dh_recepcao Datetime
    copy=False string='Received at'
  • event_id_attr Char
    copy=False size=42 string='Official event id'
  • event_type Selection
    required=True tracking=True args: EVENT_TYPES
  • mot_excl Selection
    string='Exclusion reason' args: MOT_EXCL
  • name Char
    compute='_compute_name' store=True
  • nr_proc Char
    size=21 string='Process number'
  • nr_recibo Char
    size=31 string='Processing receipt' tracking=True
  • nr_recibo_pgcc Char
    copy=False size=31 string='PGCC receipt used'
  • nr_recibo_prev Char
    size=31 string='Previous receipt'
  • occurrence_ids One2many → l10n_br_dere.event.occurrence
    comodel_name='l10n_br_dere.event.occurrence' inverse_name='event_id'
  • protocol Char
    size=28 string='Batch protocol' tracking=True
  • return_type Selection
    copy=False string='Return event' args: RETURN_TYPES
  • return_xml Text
    copy=False string='Return XML'
  • return_xml_pretty Text
    compute='_compute_return_xml_pretty' string='Indented return XML'
  • seq_evento Char
    copy=False size=2 string='Event version sequence'
  • state Selection
    default='draft' required=True tracking=True args: [('draft', 'Draft'), ('generated', 'Generated'), ('sent', 'Sent'), ('accepted', 'Accepted'), ('rejected', 'Rejected')]
  • table_period_id Many2one → l10n_br_dere.table.period
    comodel_name='l10n_br_dere.table.period' index=True ondelete='cascade'
  • total_ids One2many → l10n_br_dere.event.total
    comodel_name='l10n_br_dere.event.total' inverse_name='event_id' string='RFB totals'
  • tp_amb Selection
    required=True string='Environment' args: TP_AMB
  • tp_oper Selection
    default='1' required=True string='Operation type' args: TP_OPER_DEDUCAO
  • ver_aplic Char
    required=True size=20 string='Application version'
  • xml_content Text
    string='XML'
  • xml_hash Char
    size=64 string='XML hash'
  • xml_pretty Text
    compute='_compute_xml_pretty' string='Indented XML'
Public methods (7)
  • action_delete_local_event(self)
    Drop one event that was never sent to the RFB.
  • action_exclude_event(self)
  • action_rectify_event(self)
  • action_replace_event(self)
  • init(self)
  • unlink(self)
  • write(self, vals)

New fields (6)
  • codigo Char
    required=True size=6 string='Code'
  • company_id Many2one → res.company
    comodel_name='res.company' index=True related='event_id.company_id' store=True
  • descricao Char
    required=True string='Description'
  • event_id Many2one → l10n_br_dere.event
    comodel_name='l10n_br_dere.event' ondelete='cascade' required=True
  • localizacao Char
    string='Location'
  • tipo Selection
    required=True string='Type' args: [('1', 'Error'), ('2', 'Warning')]
Public methods (0)

No public methods.

New fields (10)
  • change_validity Boolean
    string='Change table validity'
  • declaration_id Many2one → l10n_br_dere.declaration
    comodel_name='l10n_br_dere.declaration'
  • deduction_line_ids Many2many → l10n_br_dere.deduction.line
    comodel_name='l10n_br_dere.deduction.line' relation='dere_evt_oper_wiz_deduction_rel' string='Deduction documents'
  • event_type Selection
    required=True args: EVENT_TYPES
  • fin_evt Selection
    string='Rectification purpose' args: FIN_EVT
  • mot_excl Selection
    string='Exclusion reason' args: MOT_EXCL_WAVE2
  • nova_fim_valid Date
    string='New validity end'
  • nova_ini_valid Date
    string='New validity start'
  • table_period_id Many2one → l10n_br_dere.table.period
    comodel_name='l10n_br_dere.table.period'
  • tp_oper Selection
    required=True args: [('2', 'Replacement'), ('3', 'Exclusion'), ('4', 'Rectification after monthly closing')]
Public methods (1)
  • action_confirm(self)

New fields (0)

No new fields.

Public methods (2)
  • action_consult_results(self)
  • apply_return(self, event, cd_retorno, desc_retorno=None, nr_recibo=None, protocol=None, occurrences=None, payload=None)

New fields (9)
  • company_id Many2one
    related='event_id.company_id' store=True
  • dere12_vApurTot Monetary
    currency_field='brl_currency_id' help='Official DeRE field vApurTot.' string='Assessed total'
  • dere12_vTotSaldoFinal Monetary
    currency_field='brl_currency_id' help='Official DeRE field vTotSaldoFinal.' string='Closing balance total'
  • dere12_vTotSaldoInic Monetary
    currency_field='brl_currency_id' help='Official DeRE field vTotSaldoInic.' string='Opening balance total'
  • difference Monetary
    compute='_compute_difference' currency_field='brl_currency_id' store=True
  • event_id Many2one → l10n_br_dere.event
    comodel_name='l10n_br_dere.event' index=True ondelete='cascade' required=True
  • event_type Selection
    related='event_id.event_type' store=True
  • has_difference Boolean
    compute='_compute_difference' store=True
  • local_v_apur Monetary
    currency_field='brl_currency_id' help='Sum of the vApur sent in the event for this taxation code.' string='Local assessed total'
Public methods (0)

No public methods.

New fields (22)
  • account_id Many2one → account.account
    comodel_name='account.account' ondelete='restrict' string='Accounting account'
  • account_name Char
    compute='_compute_account_name' help='Accounting account or group name, translated for the current user.' string='Chart account name'
  • company_id Many2one
    index=True related='table_period_id.company_id' store=True
  • dere12_cCta Char
    help='Official DeRE field cCta.' required=True size=53 string='Account'
  • dere12_cCtaInterna Char
    help='Official DeRE field cCtaInterna.' required=True size=50 string='Internal account'
  • dere12_cCtaRef Char
    help='Official DeRE field cCtaRef.' required=True size=13 string='Referential account'
  • dere12_cCtaSup Char
    help='Official DeRE field cCtaSup.' size=53 string='Parent account'
  • dere12_cDbrMista Char
    default='000' help='Official DeRE field cDbrMista.' required=True size=3 string='Mixed-account split'
  • dere12_codNat Selection
    help='Official DeRE field codNat.' required=True string='Nature' args: COD_NAT
  • dere12_codTrib Char
    help='Official DeRE field codTrib.' related='tax_code_id.code' store=True string='Official taxation code'
  • dere12_descCta Char
    help='Official DeRE field descCta.' size=600 string='Description'
  • dere12_fimVig Date
    help='Official DeRE field fimVig.' string='Validity end'
  • dere12_idLeiDisp Char
    help='Official DeRE field idLeiDisp.' size=5 string='Legal-provision id'
  • dere12_indCta Selection
    help='Official DeRE field indCta.' required=True string='Account type' args: IND_CTA
  • dere12_indTribISS Selection
    help='Official DeRE field indTribISS.' string='ISS indicator' args: IND_TRIB_ISS
  • dere12_iniVig Date
    help='Official DeRE field iniVig.' required=True string='Validity start'
  • dere12_natCta Selection
    help='Official DeRE field natCta.' required=True string='Balance nature' args: NAT_CTA
  • dere12_nivelCta Integer
    default=1 help='Official DeRE field nivelCta.' required=True string='Level'
  • dere12_nomeCta Char
    help='Official DeRE field nomeCta.' required=True size=100 string='Account name'
  • group_id Many2one → account.group
    comodel_name='account.group' ondelete='restrict' string='Account group'
  • table_period_id Many2one → l10n_br_dere.table.period
    comodel_name='l10n_br_dere.table.period' index=True ondelete='cascade' required=True
  • tax_code_id Many2one → l10n_br_dere.tax.code
    comodel_name='l10n_br_dere.tax.code' help='Official DeRE field codTrib.' string='Taxation code'
Public methods (2)
  • unlink(self)
  • write(self, vals)

New fields (0)

No new fields.

Public methods (2)
  • consult_batch(self, company, protocol)
  • send_batch(self, company, xml_content)

New fields (6)
  • account_id Many2one → account.account
    comodel_name='account.account' domain="[('company_ids', 'in', company_id), ('l10n_br_dere_reserve_invest', '=', True)]" ondelete='restrict' required=True string='Accounting account'
  • active Boolean
    default=True
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> index=True required=True
  • desc_ativo Char
    help='Official DeRE field descAtivo.' required=True size=255 string='Asset description'
  • id_ativo Char
    help='Official DeRE field idAtivo.' required=True size=30 string='Asset id'
  • name Char
    compute='_compute_name' store=True
Public methods (0)

No public methods.

New fields (14)
  • asset_id Many2one → l10n_br_dere.reserve.asset
    comodel_name='l10n_br_dere.reserve.asset' ondelete='restrict' string='Reserve asset'
  • company_id Many2one
    index=True related='declaration_id.company_id' store=True
  • declaration_id Many2one → l10n_br_dere.declaration
    comodel_name='l10n_br_dere.declaration' index=True ondelete='cascade' required=True
  • dere12_cCta Char
    help='Official DeRE field cCta.' required=True size=53 string='Account'
  • dere12_descAtivo Char
    help='Official DeRE field descAtivo.' required=True size=255 string='Asset description'
  • dere12_idAtivo Char
    help='Official DeRE field idAtivo.' required=True size=30 string='Asset id'
  • dere12_vApur Monetary
    compute='_compute_amounts' currency_field='brl_currency_id' help='Official DeRE field vApur.' store=True string='Taxable amount'
  • dere12_vPrincLiqResg Monetary
    currency_field='brl_currency_id' help='Official DeRE field vPrincLiqResg.' required=True string='Principal redeemed'
  • dere12_vRendLiqResg Monetary
    currency_field='brl_currency_id' help='Official DeRE field vRendLiqResg.' string='Income on redemption'
  • dere12_vRendPerReceb Monetary
    currency_field='brl_currency_id' help='Official DeRE field vRendPerReceb.' string='Period income received'
  • dere12_vSaldoFinal Monetary
    compute='_compute_amounts' currency_field='brl_currency_id' help='Official DeRE field vSaldoFinal.' store=True string='Closing balance'
  • dere12_vSaldoInic Monetary
    currency_field='brl_currency_id' help='Official DeRE field vSaldoInic.' required=True string='Opening balance'
  • dere12_vVarMensal Monetary
    currency_field='brl_currency_id' help='Official DeRE field vVarMensal.' string='Monthly variation'
  • pgcc_account_id Many2one → l10n_br_dere.pgcc.account
    comodel_name='l10n_br_dere.pgcc.account' ondelete='restrict' string='PGCC account'
Public methods (2)
  • unlink(self)
  • write(self, vals)

New fields (3)
  • company_id Many2one → res.company
    comodel_name='res.company' index=True readonly=True required=True
  • event_id Many2one → l10n_br_dere.event
    comodel_name='l10n_br_dere.event' index=True ondelete='cascade' readonly=True string='D-9001 source'
  • event_type Selection
    readonly=True required=True args: TABLE_EVENT_TYPES
Public methods (0)

No public methods.

New fields (18)
  • batch_ids One2many → l10n_br_dere.batch
    comodel_name='l10n_br_dere.batch' inverse_name='table_period_id'
  • can_consult_results Boolean
    compute='_compute_actions'
  • can_exclude_tables Boolean
    compute='_compute_actions'
  • can_generate_tables Boolean
    compute='_compute_actions'
  • can_replace_tables Boolean
    compute='_compute_actions'
  • can_send_tables Boolean
    compute='_compute_actions'
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> index=True required=True
  • declaration_ids One2many → l10n_br_dere.declaration
    comodel_name='l10n_br_dere.declaration' inverse_name='table_period_id'
  • event_ids One2many → l10n_br_dere.event
    comodel_name='l10n_br_dere.event' inverse_name='table_period_id'
  • fim_valid Date
    string='Validity end' tracking=True
  • fim_valid_efetiva Date
    compute='_compute_fim_valid_efetiva' help='End date applied by the RFB (D-9001) when a later validity of the same table cut this period.' store=True string='Effective validity end' tracking=True
  • ini_valid Date
    required=True string='Validity start' tracking=True
  • name Char
    compute='_compute_name' store=True
  • pgcc_account_ids One2many → l10n_br_dere.pgcc.account
    comodel_name='l10n_br_dere.pgcc.account' inverse_name='table_period_id'
  • rfb_extract_validity_ids Many2many → l10n_br_dere.table.validity
    comodel_name='l10n_br_dere.table.validity' compute='_compute_rfb_extract' string='RFB validity extract'
  • rfb_gap_ids Many2many → l10n_br_dere.table.gap
    comodel_name='l10n_br_dere.table.gap' compute='_compute_rfb_extract' string='RFB gaps'
  • rfb_validity_ids One2many → l10n_br_dere.table.validity
    comodel_name='l10n_br_dere.table.validity' inverse_name='table_period_id' string='RFB validity of this period'
  • state Selection
    default='draft' required=True tracking=True args: [('draft', 'Draft'), ('generated', 'Generated'), ('accepted', 'Accepted')]
Public methods (10)
  • action_exclude_tables(self)
  • action_generate_d1001(self)
  • action_generate_d1011(self)
  • action_generate_tables(self)
  • action_replace_tables(self)
  • action_send_tables(self)
  • create(self, vals_list)
    @api.model_create_multi
  • tables_accepted(self)
  • unlink(self)
  • write(self, vals)

New fields (4)
  • company_id Many2one → res.company
    comodel_name='res.company' index=True readonly=True required=True
  • event_id Many2one → l10n_br_dere.event
    comodel_name='l10n_br_dere.event' help='Table event whose D-9001 return carried this extract.' index=True ondelete='cascade' readonly=True string='D-9001 source'
  • event_type Selection
    readonly=True required=True args: TABLE_EVENT_TYPES
  • table_period_id Many2one → l10n_br_dere.table.period
    comodel_name='l10n_br_dere.table.period' help='Table period whose accepted event has this receipt.' index=True ondelete='set null' readonly=True string='Local period'
Public methods (0)

No public methods.

New fields (4)
  • company_id Many2one
    related='declaration_id.company_id' store=True
  • declaration_id Many2one → l10n_br_dere.declaration
    comodel_name='l10n_br_dere.declaration' index=True ondelete='cascade' required=True
  • event_id Many2one → l10n_br_dere.event
    comodel_name='l10n_br_dere.event' index=True ondelete='cascade' string='D-1199 event'
  • regime Selection
    required=True string='Specific regime' args: REG_TRIB_SECUND
Public methods (0)

No public methods.

New fields (5)
  • active Boolean
    default=True
  • code Char
    required=True size=9
  • description Text
    help='Official table 11 text that explains what to classify under this code.'
  • legal_ref Char
    string='Legal reference'
  • name Char
    required=True
Public methods (0)

No public methods.

New fields (5)
  • access_token Char
    groups='l10n_br_dere.group_manager'
  • client_id Char
    index=True required=True
  • emission_log Text
    groups='l10n_br_dere.group_manager' help='JSON list of token emission times for this client id.'
  • expires_at Datetime
    groups='l10n_br_dere.group_manager'
  • issued_at Datetime
    groups='l10n_br_dere.group_manager'
Public methods (0)

No public methods.

New fields (15)
  • account_name Char
    help='Accounting account name, translated for the current user.' related='pgcc_account_id.account_id.name' string='Account name'
  • company_id Many2one
    index=True related='declaration_id.company_id' store=True
  • declaration_id Many2one → l10n_br_dere.declaration
    comodel_name='l10n_br_dere.declaration' index=True ondelete='cascade' required=True
  • dere12_cCta Char
    help='Official DeRE field cCta.' related='pgcc_account_id.dere12_cCta' store=True string='Account'
  • dere12_natSaldoFinal Selection
    help='Official DeRE field natSaldoFinal.' required=True string='Closing nature' args: NAT_SALDO
  • dere12_natSaldoInic Selection
    help='Official DeRE field natSaldoInic.' required=True string='Opening nature' args: NAT_SALDO
  • dere12_natVApur Selection
    help='Official DeRE field natVApur.' string='Taxable nature' args: NAT_SALDO
  • dere12_vAjusteCred Monetary
    currency_field='brl_currency_id' help='Official DeRE field vAjusteCred.' string='Credit adjustment'
  • dere12_vAjusteDebt Monetary
    currency_field='brl_currency_id' help='Official DeRE field vAjusteDebt.' string='Debit adjustment'
  • dere12_vApur Monetary
    currency_field='brl_currency_id' help='Official DeRE field vApur.' required=True string='Taxable amount'
  • dere12_vMovCred Monetary
    currency_field='brl_currency_id' help='Official DeRE field vMovCred.' required=True string='Credit'
  • dere12_vMovDebt Monetary
    currency_field='brl_currency_id' help='Official DeRE field vMovDebt.' required=True string='Debit'
  • dere12_vSaldoFinal Monetary
    currency_field='brl_currency_id' help='Official DeRE field vSaldoFinal.' required=True string='Closing balance'
  • dere12_vSaldoInic Monetary
    currency_field='brl_currency_id' help='Official DeRE field vSaldoInic.' required=True string='Opening balance'
  • pgcc_account_id Many2one → l10n_br_dere.pgcc.account
    comodel_name='l10n_br_dere.pgcc.account' ondelete='restrict' required=True string='PGCC account'
Public methods (2)
  • unlink(self)
  • write(self, vals)

New fields (0)

No new fields.

Public methods (1)
  • action_download_xlsx(self)

New fields (2)
  • l10n_br_dere_deductible Boolean
    help='Inbound documents of this operation are loaded into D-1121.' string='DeRE deductible'
  • l10n_br_dere_tp_ativ Selection
    help='Overrides the company default when loading D-1121 deductions.' string='DeRE deduction activity' args: TP_ATIV
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (17)
  • dere_activity_ids Many2many → l10n_br_dere.activity
    comodel_name='l10n_br_dere.activity' string='DeRE activities'
  • dere_allow_force_delete Boolean
    groups='l10n_br_dere.group_manager' help='Testing only. Managers may delete sent or accepted declarations and table periods while the environment is restricted (tpAmb 2). This does not void receipts at the RFB.' string='Allow deleting accepted DeRE records'
  • dere_api_path Char
    default=DEFAULT_API_PATH help='Path appended to the API URL when posting a batch.' string='DeRE batch path'
  • dere_api_url Char
    default=DEFAULT_API_URL string='Receita Integra API URL'
  • dere_client_id Char
    groups='l10n_br_dere.group_manager' string='Receita Integra client id'
  • dere_client_secret Char
    groups='l10n_br_dere.group_manager' string='Receita Integra client secret'
  • dere_consult_path Char
    default=DEFAULT_CONSULT_PATH help='Path appended to the API URL when consulting a batch. Use {protocol}.' string='DeRE consult path'
  • dere_freq_encerr Selection
    default='M' string='DeRE closing frequency' args: FREQ_ENCERR
  • dere_ind_nat_trib Selection
    default='0' string='DeRE tax nature' args: IND_NAT_TRIB
  • dere_plano_cta_ref Selection
    string='DeRE referential chart' args: PLANO_CTA_REF
  • dere_reg_trib_princ Selection
    string='DeRE main tax regime' args: REG_TRIB_PRINC
  • dere_reg_trib_secund Selection
    string='DeRE secondary tax regime' args: [('1', 'Financial services'), ('2', 'Health-care plans'), ('3', 'Prize contests')]
  • dere_subject_d1106 Boolean
    help='Set if the taxpayer must send the technical-reserve investment event.' string='Subject to D-1106'
  • dere_subject_d1121 Boolean
    help='Set if the taxpayer must send the deduction event when it applies.' string='Subject to D-1121'
  • dere_token_url Char
    default=TOKEN_URL_PROD string='Receita Integra token URL'
  • dere_tp_amb Selection
    default='2' help='Restricted production (2) is the default and only accepts companies enrolled in the tax reform pilot (Developer Manual 1.0.2, section 1.3.1). A company outside the pilot gets an authorization error on the first send; the events stay generated.' string='DeRE environment' args: TP_AMB
  • dere_ver_aplic Char
    default=DEFAULT_VER_APLIC size=20 string='DeRE application version'
Public methods (0)

No public methods.