Brazilian DeRE
l10n_br_dere · OCA/l10n-brazil
-
Security10/251 grave, 0 minor
-
Activity25/25Last human commit 1 month ago
-
Required by5/250 modules depend on it
-
Maturity5/25In 1 Odoo series since 18.0
Heuristic over the facts below, not an audit · How it's computed
Security warnings
res.company— Adds credential fields (dere_token_url) with no `groups=` to 'res.company', which every user (portal/public included) can read under core's access rights: they can read them over RPC. Restrict the fields with `groups=` (e.g. base.group_system). CWE-200. acl-public-read-secret
Found by automated static analysis: these patterns are usually risky, but only a manual review of the module can confirm a real issue. Methodology
Migration considerations
DereActivity— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceDereDeclaration— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceDereEvent— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceDereReserveAsset— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceDereTablePeriod— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceDereTaxCode— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceDereToken— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · source- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `DELETE FROM l10n_br_dere_pgcc_account AS pgcc WHERE pgcc.table_period_id IS NULL AND NOT EXISTS ( SELECT 1 FROM l10n_br_dere_trial_line AS trial WHERE trial.pgcc_account_id = pgcc.id ) AND NOT EXISTS ( SELECT 1 FROM l10n_br_dere_reserve_line AS reserve WHERE reserve.pgcc_account_id = pgcc.id )` - re-check the table/column names still match after upgrading. (2 occurrences in this file) migration-raw-sql-write · source
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `SELECT id FROM l10n_br_dere_token WHERE client_id = %s FOR UPDATE` - re-check the table/column names still match after upgrading. (2 occurrences in this file) migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
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) eaccount.account(analítico), com ocodTribescolhido 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
- Odoo dependencies
- Python dependencies
- erpbrasil.assinatura, lxml, requests, signxml, erpbrasil-base>=2.5.0, email-validator, erpbrasil-base>=2.4.2, num2words, phonenumbers
- System dependencies
- None
- Required by
- None
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 23
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
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) | Handler | Auth | Type | Methods | Flags |
|---|---|---|---|---|---|
/l10n_br_dere/xlsx/<string:model>/<int:res_id> |
DereXlsxController.download_xlsx |
user | http | ALL |
Models touched 28
-
l10n_br_dere_cod_natSelectionhelp='Leave empty to inherit the nature code from the account group.'string='DeRE nature code' args: COD_NAT -
l10n_br_dere_cod_tribMany2one → l10n_br_dere.tax.codecomodel_name='l10n_br_dere.tax.code'string='DeRE taxation code' -
l10n_br_dere_cod_trib_descriptionTextrelated='l10n_br_dere_cod_trib.description'string='Taxation code description' -
l10n_br_dere_ctaCharcompute='_compute_l10n_br_dere_cta'size=53store=Truestring='DeRE full account' -
l10n_br_dere_cta_internaCharhelp='Alphanumeric internal code without dots or dashes.'size=50string='DeRE internal account' -
l10n_br_dere_cta_refCharhelp='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=13string='DeRE referential account' -
l10n_br_dere_cta_sup_idMany2one → account.groupcomodel_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_mistaChardefault='000'size=3string='DeRE mixed-account split' -
l10n_br_dere_desc_ctaCharsize=600string='DeRE account description' -
l10n_br_dere_id_lei_dispCharhelp='Official DeRE code idLeiDisp (mask 99-99). Leave empty to omit it from the event.'size=5string='DeRE legal-provision id' -
l10n_br_dere_ind_ctaSelectioncompute='_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_issSelectionstring='DeRE ISS indicator' args: IND_TRIB_ISS -
l10n_br_dere_nat_ctaSelectionhelp='Leave empty to inherit the nature from the account group.'string='DeRE account nature' args: NAT_CTA -
l10n_br_dere_nivel_ctaIntegercompute='_compute_l10n_br_dere_hierarchy'string='DeRE account level' -
l10n_br_dere_reserve_income_account_idMany2one → account.accountcomodel_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_investBooleanhelp='Mark analytic accounts that hold technical-reserve investments reported on D-1106.'string='DeRE technical-reserve investment'
No public methods.
-
l10n_br_dere_cod_natSelectionstring='DeRE nature code' args: COD_NAT -
l10n_br_dere_ctaCharcompute='_compute_l10n_br_dere_cta'size=53store=Truestring='DeRE full account' -
l10n_br_dere_cta_internaCharhelp='Alphanumeric internal code without dots or dashes. Defaults to the group prefix.'size=50string='DeRE internal account' -
l10n_br_dere_cta_refCharsize=13string='DeRE referential account' -
l10n_br_dere_cta_supCharcompute='_compute_l10n_br_dere_hierarchy'size=53string='DeRE parent account' -
l10n_br_dere_dbr_mistaChardefault='000'size=3string='DeRE mixed-account split' -
l10n_br_dere_desc_ctaCharsize=600string='DeRE account description' -
l10n_br_dere_id_lei_dispCharhelp='Official DeRE code idLeiDisp (mask 99-99). Leave empty to omit it from the event.'size=5string='DeRE legal-provision id' -
l10n_br_dere_nat_ctaSelectionstring='DeRE account nature' args: NAT_CTA -
l10n_br_dere_nivel_ctaIntegercompute='_compute_l10n_br_dere_hierarchy'recursive=Truestring='DeRE account level'
No public methods.
-
activeBooleandefault=True -
codeCharrequired=Truesize=3 -
nameCharrequired=Truetranslate=True -
table_codeSelectiondefault='31'required=True args: [('21', 'Table 21 - Financial services'), ('31', 'Table 31 - Health-care plans'), ('41', 'Table 41 - Prize contests')]
No public methods.
-
company_idMany2one → res.companycomodel_name='res.company'compute='_compute_company_id'index=Truestore=True -
consult_attemptsIntegerdefault=0 -
declaration_idMany2one → l10n_br_dere.declarationcomodel_name='l10n_br_dere.declaration'ondelete='cascade' -
event_idsMany2many → l10n_br_dere.eventcomodel_name='l10n_br_dere.event'string='Events' -
nameChardefault='New'required=True -
next_consult_atDatetimestring='Next consult' -
protocolCharsize=28string='Batch protocol' -
response_prettyTextcompute='_compute_response_pretty'string='Indented response' -
response_textTextstring='Response' -
stateSelectiondefault='draft'required=True args: [('draft', 'Draft'), ('sent', 'Sent'), ('unknown', 'Unknown'), ('done', 'Done'), ('error', 'Error')] -
table_period_idMany2one → l10n_br_dere.table.periodcomodel_name='l10n_br_dere.table.period'ondelete='cascade' -
tp_ambSelectionrequired=Truestring='Environment' args: TP_AMB -
xml_contentTextstring='XML' -
xml_prettyTextcompute='_compute_xml_pretty'string='Indented XML'
-
action_consult(self)
-
batch_idsOne2many → l10n_br_dere.batchcomodel_name='l10n_br_dere.batch'inverse_name='declaration_id' -
can_close_periodBooleancompute='_compute_closing_actions'string='Can close period' -
can_consult_resultsBooleancompute='_compute_closing_actions'string='Can consult results' -
can_discard_local_closingBooleancompute='_compute_closing_actions'string='Can discard local closing' -
can_discard_local_reopeningBooleancompute='_compute_closing_actions'string='Can discard local reopening' -
can_generate_d1106Booleancompute='_compute_closing_actions'string='Can generate D-1106' -
can_generate_d1121Booleancompute='_compute_closing_actions'string='Can generate D-1121' -
can_generate_trialBooleancompute='_compute_closing_actions'string='Can generate trial balance' -
can_load_deductionsBooleancompute='_compute_closing_actions'string='Can load deductions' -
can_rectify_d1121Booleancompute='_compute_closing_actions' -
can_reopen_periodBooleancompute='_compute_closing_actions'string='Can reopen period' -
can_replace_d1106Booleancompute='_compute_closing_actions' -
can_replace_d1121Booleancompute='_compute_closing_actions' -
can_replace_trialBooleancompute='_compute_closing_actions' -
can_send_periodicsBooleancompute='_compute_closing_actions'string='Can send periodics' -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>index=Truerequired=True -
date_fromDatecompute='_compute_period_dates'store=True -
date_toDatecompute='_compute_period_dates'store=True -
deduction_line_idsOne2many → l10n_br_dere.deduction.linecomodel_name='l10n_br_dere.deduction.line'inverse_name='declaration_id' -
event_idsOne2many → l10n_br_dere.eventcomodel_name='l10n_br_dere.event'inverse_name='declaration_id' -
fim_validDaterelated='table_period_id.fim_valid'string='Table validity end' -
ind_inexist_deduBooleanhelp='Only if the company is subject to D-1121 and has no deductions.'string='Declare no deductions' -
ini_validDaterelated='table_period_id.ini_valid'string='Table validity start' -
nameCharcompute='_compute_name'store=True -
per_apurCharhelp='Format YYYY-MM.'required=Truesize=7string='Assessment period'tracking=True -
pgcc_account_idsOne2manyhelp='Read-only snapshot of the table period. Edit PGCC on Fiscal → DeRE → Table Periods before D-1011 is accepted.'readonly=Truerelated='table_period_id.pgcc_account_ids' -
primary_actionSelectioncompute='_compute_closing_actions'selection=PRIMARY_ACTIONSstring='Primary action' -
reserve_line_idsOne2many → l10n_br_dere.reserve.linecomodel_name='l10n_br_dere.reserve.line'inverse_name='declaration_id' -
stateSelectiondefault='draft'required=Truetracking=True args: [('draft', 'Draft'), ('trial_ok', 'Trial balance ready'), ('closed', 'Closed'), ('reopened', 'Reopened')] -
subject_d1106Booleanrelated='company_id.dere_subject_d1106' -
subject_d1121Booleanrelated='company_id.dere_subject_d1121' -
table_period_idMany2one → l10n_br_dere.table.periodcomodel_name='l10n_br_dere.table.period'compute='_compute_table_period_id'index=Truereadonly=Falsestore=True -
trial_line_idsOne2many → l10n_br_dere.trial.linecomodel_name='l10n_br_dere.trial.line'inverse_name='declaration_id'
-
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)
-
rfb_assessment_event_idMany2one → l10n_br_dere.eventcomodel_name='l10n_br_dere.event'copy=Falsehelp='Accepted D-1199 whose D-9199 return filled the RFB assessment.'readonly=Truestring='Assessment return' -
rfb_mismatchBooleancompute='_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_finCharcopy=Falsereadonly=Truesize=31string='Technical-reserve receipt used' -
rfb_nr_recibo_balanceteCharcopy=Falsereadonly=Truesize=31string='Trial balance receipt used' -
rfb_nr_recibo_rel_deduCharcopy=Falsereadonly=Truestring='Deduction receipts used' -
rfb_total_idsMany2many → l10n_br_dere.event.totalcomodel_name='l10n_br_dere.event.total'compute='_compute_rfb_assessment'string='RFB totals' -
rfb_v_cbsMonetarycopy=Falsecurrency_field='brl_currency_id'readonly=Truestring='RFB CBS' -
rfb_v_ibs_munMonetarycopy=Falsecurrency_field='brl_currency_id'readonly=Truestring='RFB municipal IBS' -
rfb_v_ibs_totMonetarycopy=Falsecurrency_field='brl_currency_id'readonly=Truestring='RFB total IBS' -
rfb_v_ibs_ufMonetarycopy=Falsecurrency_field='brl_currency_id'readonly=Truestring='RFB state IBS' -
rfb_v_isMonetarycopy=Falsecurrency_field='brl_currency_id'readonly=Truestring='RFB IS' -
tax_assessment_line_idsOne2many → l10n_br_dere.tax.assessment.linecomodel_name='l10n_br_dere.tax.assessment.line'inverse_name='declaration_id'string='RFB tax bases'
No public methods.
-
company_idMany2oneindex=Truerelated='line_id.company_id'store=True -
dere12_nItemCharhelp='Official DeRE field nItem.'required=Truesize=3string='Item number' -
dere12_vItemMonetarycurrency_field='brl_currency_id'help='Official DeRE field vItem.'required=Truestring='Item amount' -
dere12_vItemDedMonetarycurrency_field='brl_currency_id'help='Official DeRE field vItemDed.'required=Truestring='Item deduction this period' -
dere12_vItemDedTotalMonetarycurrency_field='brl_currency_id'help='Official DeRE field vItemDedTotal.'string='Item deductible total' -
line_idMany2one → l10n_br_dere.deduction.linecomodel_name='l10n_br_dere.deduction.line'index=Trueondelete='cascade'required=True
-
unlink(self) -
write(self, vals)
-
company_idMany2oneindex=Truerelated='declaration_id.company_id'store=True -
declaration_idMany2one → l10n_br_dere.declarationcomodel_name='l10n_br_dere.declaration'index=Trueondelete='cascade'required=True -
dere12_chDFeCharhelp='Official DeRE field chDFe.'size=53string='Access key' -
dere12_dtEmiDatehelp='Official DeRE field dtEmi.'required=Truestring='Issue date' -
dere12_tpAtivSelectionhelp='Official DeRE field tpAtiv.'required=Truestring='Activity type' args: TP_ATIV -
dere12_tpDFeSelectionhelp='Official DeRE field tpDFe.'string='Fiscal document type' args: TP_DFE -
dere12_vDedMonetarycurrency_field='brl_currency_id'help='Official DeRE field vDed.'required=Truestring='Deduction this period' -
dere12_vDedTotalMonetarycurrency_field='brl_currency_id'help='Official DeRE field vDedTotal. Only in the issue month.'string='Total deductible' -
dere12_vOperMonetarycurrency_field='brl_currency_id'help='Official DeRE field vOper.'required=Truestring='Operation amount' -
document_idMany2one → l10n_br_fiscal.documentcomodel_name='l10n_br_fiscal.document'ondelete='restrict'string='Fiscal document' -
item_idsOne2many → l10n_br_dere.deduction.itemcomodel_name='l10n_br_dere.deduction.item'inverse_name='line_id'string='Deduction items'
-
unlink(self) -
write(self, vals)
-
aplic_emiSelectiondefault='1'required=Truestring='Issuer' args: APLIC_EMI -
can_exclude_eventBooleancompute='_compute_event_operations'string='Can exclude event' -
can_rectify_eventBooleancompute='_compute_event_operations'string='Can rectify event' -
can_replace_eventBooleancompute='_compute_event_operations'string='Can replace event' -
cd_retornoSelectionstring='Return code' args: CD_RETORNO -
company_idMany2one → res.companycomodel_name='res.company'compute='_compute_company_id'index=Truestore=True -
declaration_idMany2one → l10n_br_dere.declarationcomodel_name='l10n_br_dere.declaration'index=Trueondelete='cascade' -
desc_retornoCharstring='Return description' -
dh_processDatetimecopy=Falsestring='Processed at' -
dh_recepcaoDatetimecopy=Falsestring='Received at' -
event_id_attrCharcopy=Falsesize=42string='Official event id' -
event_typeSelectionrequired=Truetracking=True args: EVENT_TYPES -
mot_exclSelectionstring='Exclusion reason' args: MOT_EXCL -
nameCharcompute='_compute_name'store=True -
nr_procCharsize=21string='Process number' -
nr_reciboCharsize=31string='Processing receipt'tracking=True -
nr_recibo_pgccCharcopy=Falsesize=31string='PGCC receipt used' -
nr_recibo_prevCharsize=31string='Previous receipt' -
occurrence_idsOne2many → l10n_br_dere.event.occurrencecomodel_name='l10n_br_dere.event.occurrence'inverse_name='event_id' -
protocolCharsize=28string='Batch protocol'tracking=True -
return_typeSelectioncopy=Falsestring='Return event' args: RETURN_TYPES -
return_xmlTextcopy=Falsestring='Return XML' -
return_xml_prettyTextcompute='_compute_return_xml_pretty'string='Indented return XML' -
seq_eventoCharcopy=Falsesize=2string='Event version sequence' -
stateSelectiondefault='draft'required=Truetracking=True args: [('draft', 'Draft'), ('generated', 'Generated'), ('sent', 'Sent'), ('accepted', 'Accepted'), ('rejected', 'Rejected')] -
table_period_idMany2one → l10n_br_dere.table.periodcomodel_name='l10n_br_dere.table.period'index=Trueondelete='cascade' -
total_idsOne2many → l10n_br_dere.event.totalcomodel_name='l10n_br_dere.event.total'inverse_name='event_id'string='RFB totals' -
tp_ambSelectionrequired=Truestring='Environment' args: TP_AMB -
tp_operSelectiondefault='1'required=Truestring='Operation type' args: TP_OPER_DEDUCAO -
ver_aplicCharrequired=Truesize=20string='Application version' -
xml_contentTextstring='XML' -
xml_hashCharsize=64string='XML hash' -
xml_prettyTextcompute='_compute_xml_pretty'string='Indented XML'
-
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)
-
codigoCharrequired=Truesize=6string='Code' -
company_idMany2one → res.companycomodel_name='res.company'index=Truerelated='event_id.company_id'store=True -
descricaoCharrequired=Truestring='Description' -
event_idMany2one → l10n_br_dere.eventcomodel_name='l10n_br_dere.event'ondelete='cascade'required=True -
localizacaoCharstring='Location' -
tipoSelectionrequired=Truestring='Type' args: [('1', 'Error'), ('2', 'Warning')]
No public methods.
-
change_validityBooleanstring='Change table validity' -
declaration_idMany2one → l10n_br_dere.declarationcomodel_name='l10n_br_dere.declaration' -
deduction_line_idsMany2many → l10n_br_dere.deduction.linecomodel_name='l10n_br_dere.deduction.line'relation='dere_evt_oper_wiz_deduction_rel'string='Deduction documents' -
event_typeSelectionrequired=True args: EVENT_TYPES -
fin_evtSelectionstring='Rectification purpose' args: FIN_EVT -
mot_exclSelectionstring='Exclusion reason' args: MOT_EXCL_WAVE2 -
nova_fim_validDatestring='New validity end' -
nova_ini_validDatestring='New validity start' -
table_period_idMany2one → l10n_br_dere.table.periodcomodel_name='l10n_br_dere.table.period' -
tp_operSelectionrequired=True args: [('2', 'Replacement'), ('3', 'Exclusion'), ('4', 'Rectification after monthly closing')]
-
action_confirm(self)
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)
-
company_idMany2onerelated='event_id.company_id'store=True -
dere12_vApurTotMonetarycurrency_field='brl_currency_id'help='Official DeRE field vApurTot.'string='Assessed total' -
dere12_vTotSaldoFinalMonetarycurrency_field='brl_currency_id'help='Official DeRE field vTotSaldoFinal.'string='Closing balance total' -
dere12_vTotSaldoInicMonetarycurrency_field='brl_currency_id'help='Official DeRE field vTotSaldoInic.'string='Opening balance total' -
differenceMonetarycompute='_compute_difference'currency_field='brl_currency_id'store=True -
event_idMany2one → l10n_br_dere.eventcomodel_name='l10n_br_dere.event'index=Trueondelete='cascade'required=True -
event_typeSelectionrelated='event_id.event_type'store=True -
has_differenceBooleancompute='_compute_difference'store=True -
local_v_apurMonetarycurrency_field='brl_currency_id'help='Sum of the vApur sent in the event for this taxation code.'string='Local assessed total'
No public methods.
-
account_idMany2one → account.accountcomodel_name='account.account'ondelete='restrict'string='Accounting account' -
account_nameCharcompute='_compute_account_name'help='Accounting account or group name, translated for the current user.'string='Chart account name' -
company_idMany2oneindex=Truerelated='table_period_id.company_id'store=True -
dere12_cCtaCharhelp='Official DeRE field cCta.'required=Truesize=53string='Account' -
dere12_cCtaInternaCharhelp='Official DeRE field cCtaInterna.'required=Truesize=50string='Internal account' -
dere12_cCtaRefCharhelp='Official DeRE field cCtaRef.'required=Truesize=13string='Referential account' -
dere12_cCtaSupCharhelp='Official DeRE field cCtaSup.'size=53string='Parent account' -
dere12_cDbrMistaChardefault='000'help='Official DeRE field cDbrMista.'required=Truesize=3string='Mixed-account split' -
dere12_codNatSelectionhelp='Official DeRE field codNat.'required=Truestring='Nature' args: COD_NAT -
dere12_codTribCharhelp='Official DeRE field codTrib.'related='tax_code_id.code'store=Truestring='Official taxation code' -
dere12_descCtaCharhelp='Official DeRE field descCta.'size=600string='Description' -
dere12_fimVigDatehelp='Official DeRE field fimVig.'string='Validity end' -
dere12_idLeiDispCharhelp='Official DeRE field idLeiDisp.'size=5string='Legal-provision id' -
dere12_indCtaSelectionhelp='Official DeRE field indCta.'required=Truestring='Account type' args: IND_CTA -
dere12_indTribISSSelectionhelp='Official DeRE field indTribISS.'string='ISS indicator' args: IND_TRIB_ISS -
dere12_iniVigDatehelp='Official DeRE field iniVig.'required=Truestring='Validity start' -
dere12_natCtaSelectionhelp='Official DeRE field natCta.'required=Truestring='Balance nature' args: NAT_CTA -
dere12_nivelCtaIntegerdefault=1help='Official DeRE field nivelCta.'required=Truestring='Level' -
dere12_nomeCtaCharhelp='Official DeRE field nomeCta.'required=Truesize=100string='Account name' -
group_idMany2one → account.groupcomodel_name='account.group'ondelete='restrict'string='Account group' -
table_period_idMany2one → l10n_br_dere.table.periodcomodel_name='l10n_br_dere.table.period'index=Trueondelete='cascade'required=True -
tax_code_idMany2one → l10n_br_dere.tax.codecomodel_name='l10n_br_dere.tax.code'help='Official DeRE field codTrib.'string='Taxation code'
-
unlink(self) -
write(self, vals)
No new fields.
Public methods (2)-
consult_batch(self, company, protocol) -
send_batch(self, company, xml_content)
-
account_idMany2one → account.accountcomodel_name='account.account'domain="[('company_ids', 'in', company_id), ('l10n_br_dere_reserve_invest', '=', True)]"ondelete='restrict'required=Truestring='Accounting account' -
activeBooleandefault=True -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>index=Truerequired=True -
desc_ativoCharhelp='Official DeRE field descAtivo.'required=Truesize=255string='Asset description' -
id_ativoCharhelp='Official DeRE field idAtivo.'required=Truesize=30string='Asset id' -
nameCharcompute='_compute_name'store=True
No public methods.
-
asset_idMany2one → l10n_br_dere.reserve.assetcomodel_name='l10n_br_dere.reserve.asset'ondelete='restrict'string='Reserve asset' -
company_idMany2oneindex=Truerelated='declaration_id.company_id'store=True -
declaration_idMany2one → l10n_br_dere.declarationcomodel_name='l10n_br_dere.declaration'index=Trueondelete='cascade'required=True -
dere12_cCtaCharhelp='Official DeRE field cCta.'required=Truesize=53string='Account' -
dere12_descAtivoCharhelp='Official DeRE field descAtivo.'required=Truesize=255string='Asset description' -
dere12_idAtivoCharhelp='Official DeRE field idAtivo.'required=Truesize=30string='Asset id' -
dere12_vApurMonetarycompute='_compute_amounts'currency_field='brl_currency_id'help='Official DeRE field vApur.'store=Truestring='Taxable amount' -
dere12_vPrincLiqResgMonetarycurrency_field='brl_currency_id'help='Official DeRE field vPrincLiqResg.'required=Truestring='Principal redeemed' -
dere12_vRendLiqResgMonetarycurrency_field='brl_currency_id'help='Official DeRE field vRendLiqResg.'string='Income on redemption' -
dere12_vRendPerRecebMonetarycurrency_field='brl_currency_id'help='Official DeRE field vRendPerReceb.'string='Period income received' -
dere12_vSaldoFinalMonetarycompute='_compute_amounts'currency_field='brl_currency_id'help='Official DeRE field vSaldoFinal.'store=Truestring='Closing balance' -
dere12_vSaldoInicMonetarycurrency_field='brl_currency_id'help='Official DeRE field vSaldoInic.'required=Truestring='Opening balance' -
dere12_vVarMensalMonetarycurrency_field='brl_currency_id'help='Official DeRE field vVarMensal.'string='Monthly variation' -
pgcc_account_idMany2one → l10n_br_dere.pgcc.accountcomodel_name='l10n_br_dere.pgcc.account'ondelete='restrict'string='PGCC account'
-
unlink(self) -
write(self, vals)
-
company_idMany2one → res.companycomodel_name='res.company'index=Truereadonly=Truerequired=True -
event_idMany2one → l10n_br_dere.eventcomodel_name='l10n_br_dere.event'index=Trueondelete='cascade'readonly=Truestring='D-9001 source' -
event_typeSelectionreadonly=Truerequired=True args: TABLE_EVENT_TYPES
No public methods.
-
batch_idsOne2many → l10n_br_dere.batchcomodel_name='l10n_br_dere.batch'inverse_name='table_period_id' -
can_consult_resultsBooleancompute='_compute_actions' -
can_exclude_tablesBooleancompute='_compute_actions' -
can_generate_tablesBooleancompute='_compute_actions' -
can_replace_tablesBooleancompute='_compute_actions' -
can_send_tablesBooleancompute='_compute_actions' -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>index=Truerequired=True -
declaration_idsOne2many → l10n_br_dere.declarationcomodel_name='l10n_br_dere.declaration'inverse_name='table_period_id' -
event_idsOne2many → l10n_br_dere.eventcomodel_name='l10n_br_dere.event'inverse_name='table_period_id' -
fim_validDatestring='Validity end'tracking=True -
fim_valid_efetivaDatecompute='_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=Truestring='Effective validity end'tracking=True -
ini_validDaterequired=Truestring='Validity start'tracking=True -
nameCharcompute='_compute_name'store=True -
pgcc_account_idsOne2many → l10n_br_dere.pgcc.accountcomodel_name='l10n_br_dere.pgcc.account'inverse_name='table_period_id' -
rfb_extract_validity_idsMany2many → l10n_br_dere.table.validitycomodel_name='l10n_br_dere.table.validity'compute='_compute_rfb_extract'string='RFB validity extract' -
rfb_gap_idsMany2many → l10n_br_dere.table.gapcomodel_name='l10n_br_dere.table.gap'compute='_compute_rfb_extract'string='RFB gaps' -
rfb_validity_idsOne2many → l10n_br_dere.table.validitycomodel_name='l10n_br_dere.table.validity'inverse_name='table_period_id'string='RFB validity of this period' -
stateSelectiondefault='draft'required=Truetracking=True args: [('draft', 'Draft'), ('generated', 'Generated'), ('accepted', 'Accepted')]
-
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)
-
company_idMany2one → res.companycomodel_name='res.company'index=Truereadonly=Truerequired=True -
event_idMany2one → l10n_br_dere.eventcomodel_name='l10n_br_dere.event'help='Table event whose D-9001 return carried this extract.'index=Trueondelete='cascade'readonly=Truestring='D-9001 source' -
event_typeSelectionreadonly=Truerequired=True args: TABLE_EVENT_TYPES -
table_period_idMany2one → l10n_br_dere.table.periodcomodel_name='l10n_br_dere.table.period'help='Table period whose accepted event has this receipt.'index=Trueondelete='set null'readonly=Truestring='Local period'
No public methods.
-
company_idMany2onerelated='declaration_id.company_id'store=True -
declaration_idMany2one → l10n_br_dere.declarationcomodel_name='l10n_br_dere.declaration'index=Trueondelete='cascade'required=True -
event_idMany2one → l10n_br_dere.eventcomodel_name='l10n_br_dere.event'index=Trueondelete='cascade'string='D-1199 event' -
regimeSelectionrequired=Truestring='Specific regime' args: REG_TRIB_SECUND
No public methods.
-
activeBooleandefault=True -
codeCharrequired=Truesize=9 -
descriptionTexthelp='Official table 11 text that explains what to classify under this code.' -
legal_refCharstring='Legal reference' -
nameCharrequired=True
No public methods.
-
access_tokenChargroups='l10n_br_dere.group_manager' -
client_idCharindex=Truerequired=True -
emission_logTextgroups='l10n_br_dere.group_manager'help='JSON list of token emission times for this client id.' -
expires_atDatetimegroups='l10n_br_dere.group_manager' -
issued_atDatetimegroups='l10n_br_dere.group_manager'
No public methods.
-
account_nameCharhelp='Accounting account name, translated for the current user.'related='pgcc_account_id.account_id.name'string='Account name' -
company_idMany2oneindex=Truerelated='declaration_id.company_id'store=True -
declaration_idMany2one → l10n_br_dere.declarationcomodel_name='l10n_br_dere.declaration'index=Trueondelete='cascade'required=True -
dere12_cCtaCharhelp='Official DeRE field cCta.'related='pgcc_account_id.dere12_cCta'store=Truestring='Account' -
dere12_natSaldoFinalSelectionhelp='Official DeRE field natSaldoFinal.'required=Truestring='Closing nature' args: NAT_SALDO -
dere12_natSaldoInicSelectionhelp='Official DeRE field natSaldoInic.'required=Truestring='Opening nature' args: NAT_SALDO -
dere12_natVApurSelectionhelp='Official DeRE field natVApur.'string='Taxable nature' args: NAT_SALDO -
dere12_vAjusteCredMonetarycurrency_field='brl_currency_id'help='Official DeRE field vAjusteCred.'string='Credit adjustment' -
dere12_vAjusteDebtMonetarycurrency_field='brl_currency_id'help='Official DeRE field vAjusteDebt.'string='Debit adjustment' -
dere12_vApurMonetarycurrency_field='brl_currency_id'help='Official DeRE field vApur.'required=Truestring='Taxable amount' -
dere12_vMovCredMonetarycurrency_field='brl_currency_id'help='Official DeRE field vMovCred.'required=Truestring='Credit' -
dere12_vMovDebtMonetarycurrency_field='brl_currency_id'help='Official DeRE field vMovDebt.'required=Truestring='Debit' -
dere12_vSaldoFinalMonetarycurrency_field='brl_currency_id'help='Official DeRE field vSaldoFinal.'required=Truestring='Closing balance' -
dere12_vSaldoInicMonetarycurrency_field='brl_currency_id'help='Official DeRE field vSaldoInic.'required=Truestring='Opening balance' -
pgcc_account_idMany2one → l10n_br_dere.pgcc.accountcomodel_name='l10n_br_dere.pgcc.account'ondelete='restrict'required=Truestring='PGCC account'
-
unlink(self) -
write(self, vals)
No new fields.
Public methods (1)-
action_download_xlsx(self)
-
l10n_br_dere_deductibleBooleanhelp='Inbound documents of this operation are loaded into D-1121.'string='DeRE deductible' -
l10n_br_dere_tp_ativSelectionhelp='Overrides the company default when loading D-1121 deductions.'string='DeRE deduction activity' args: TP_ATIV
No public methods.
No new fields.
Public methods (0)No public methods.
-
dere_activity_idsMany2many → l10n_br_dere.activitycomodel_name='l10n_br_dere.activity'string='DeRE activities' -
dere_allow_force_deleteBooleangroups='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_pathChardefault=DEFAULT_API_PATHhelp='Path appended to the API URL when posting a batch.'string='DeRE batch path' -
dere_api_urlChardefault=DEFAULT_API_URLstring='Receita Integra API URL' -
dere_client_idChargroups='l10n_br_dere.group_manager'string='Receita Integra client id' -
dere_client_secretChargroups='l10n_br_dere.group_manager'string='Receita Integra client secret' -
dere_consult_pathChardefault=DEFAULT_CONSULT_PATHhelp='Path appended to the API URL when consulting a batch. Use {protocol}.'string='DeRE consult path' -
dere_freq_encerrSelectiondefault='M'string='DeRE closing frequency' args: FREQ_ENCERR -
dere_ind_nat_tribSelectiondefault='0'string='DeRE tax nature' args: IND_NAT_TRIB -
dere_plano_cta_refSelectionstring='DeRE referential chart' args: PLANO_CTA_REF -
dere_reg_trib_princSelectionstring='DeRE main tax regime' args: REG_TRIB_PRINC -
dere_reg_trib_secundSelectionstring='DeRE secondary tax regime' args: [('1', 'Financial services'), ('2', 'Health-care plans'), ('3', 'Prize contests')] -
dere_subject_d1106Booleanhelp='Set if the taxpayer must send the technical-reserve investment event.'string='Subject to D-1106' -
dere_subject_d1121Booleanhelp='Set if the taxpayer must send the deduction event when it applies.'string='Subject to D-1121' -
dere_token_urlChardefault=TOKEN_URL_PRODstring='Receita Integra token URL' -
dere_tp_ambSelectiondefault='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_aplicChardefault=DEFAULT_VER_APLICsize=20string='DeRE application version'
No public methods.