CNAB Structure

l10n_br_cnab_structure
REPOSITORY
REPOSITORYOCA/l10n-brazil
GIT
GIThttps://github.com/OCA/l10n-brazil.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-brazil/tree/16.0/l10n_br_cnab_structure
VERSION
VERSION 3.2.0
CATEGORY
CATEGORYUncategorized
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Escodoo, Engenere
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Escodoo, Engenere
COMMITTERS
COMMITTERSRaphaël Valyi, Weblate, OCA-git-bot, oca-ci, Antonio Neto, Antônio Neto, Kaynnan Lemes, CristianoMafraJunior, kaynnan
WEBSITE
WEBSITEhttps://github.com/OCA/l10n-brazil
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:11:55
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/account-payment:
    - account_due_list
    - account_due_list_payment_mode
OCA/bank-payment:
    - account_payment_order
    - account_payment_partner
    - account_payment_mode
OCA/l10n-brazil:
    - l10n_br_account_payment_order
    - l10n_br_base
    - l10n_br_account_due_list
    - l10n_br_coa_generic
    - l10n_br_coa
odoo/odoo:
    - base
    - base_setup
    - web
    - base_address_extended
    - account
    - product
    - mail
    - bus
    - web_tour
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - base_iban
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES pyyaml
unidecode
erpbrasil.base
email-validator
num2words
phonenumbers
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module adds functionality for implementing brazilian banking
automation by CNAB file exchange.

Code Analysis

Views touched (25)
XML IDNameModelTypeStatus
cnab_batch_form_view l10n_br_cnab.batch form New
cnab_batch_tree_view l10n_br_cnab.batch tree New
cnab_import_wizard cnab.import.wizard.form cnab.import.wizard form New
cnab_line_field_form_view l10n_br_cnab.line.field form New
cnab_line_field_group_condition_form_view cnab.line.group.field.condition form New
cnab_line_field_group_form_view cnab.line.field.group form New
cnab_line_field_tree_view l10n_br_cnab.line.field tree New
cnab_line_fields_group_condition_tree_view cnab.line.group.field.condition tree New
cnab_line_fields_group_tree_view cnab.line.field.group tree New
cnab_line_form_view l10n_br_cnab.line form New
cnab_line_tree_view l10n_br_cnab.line tree New
cnab_operation_form cnab.data.management.form cnab.data.management form New
cnab_operation_kanban cnab.data.management.kanban cnab.data.management kanban New
cnab_operation_search cnab.data.management.search cnab.data.management search New
cnab_operation_tree cnab.data.management.tree cnab.data.management tree New
cnab_preview_wizard_form cnab.preview.wizard.form cnab.preview.wizard form New
cnab_structure_form_view l10n_br_cnab.structure form New
cnab_structure_payment_mode_form cnab_structure_payment_mode_form account.payment.mode group Inherits l10n_br_account_payment_order.l10n_br_account_payment_mode_form
cnab_structure_payment_order_form cnab_structure_payment_order_form account.payment.order field Inherits account_payment_order.account_payment_order_form
cnab_structure_tree_view l10n_br_cnab.structure tree New
field_select_wizard_form field.select.wizard.form field.select.wizard form New
journal_cnab_import_view_form journal.cnab.import.view.form account.journal xpath Inherits account.view_account_journal_form
l10n_br_cnab_return_event_form_view_structure l10n_br_cnab.return.event.form.view.structure l10n_br_cnab.return.event form New
l10n_br_cnab_return_log_form_view_structure l10n_br_cnab.return.log.form.view.structure l10n_br_cnab.return.log form New
l10n_br_cnab_return_log_tree_view_structure l10n_br_cnab.return.log.tree l10n_br_cnab.return.log tree New
Models touched (22)

New fields (10)
  • default_outbound_cnab_processor Selection
    help='CNAB Processor to be used in a payment order when it is not defined in the payment mode' selection=[('oca_processor', 'OCA Processor')] string='CNAB Processor'
  • default_outbound_cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' help='CNAB Structure to be used in a payment order when it is not defined in the payment mode.' string='CNAB Structure'
  • inbound_discount_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Discount Account for CNAB inbound payments.' string='Inbound Discount Account' tracking=True
  • inbound_interest_fee_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Interest and Fees Account for CNAB inbound payments.' string='Inbound Interest and Fees Account' tracking=True
  • inbound_rebate_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Rebate Account for CNAB inbound payments.' string='Inbound Rebate Account' tracking=True
  • outbound_discount_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Discount Account for CNAB outbound payments.' string='Outbound Discount Account' tracking=True
  • outbound_interest_fee_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Interest and Fees Account for CNAB outbound payments.' string='Outbound Interest and Fees Account' tracking=True
  • outbound_rebate_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Rebate Account for CNAB outbound payments.' string='Outbound Rebate Account' tracking=True
  • tariff_charge_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Default account for bank tariff.' string='Tariff Account' tracking=True
  • used_to_import_cnab Boolean
    string='Journal used for import CNAB'
Public methods (0)

No public methods.

New fields (6)
  • batch_template_id Many2one → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' compute='_compute_batch_template_id'
  • cnab_beneficiary_name Char
    compute='_compute_cnab_beneficiary_name' help='Name of the beneficiary (Nome do Favorecido) that will be informed in the CNAB.'
  • cnab_payment_way_id Many2one → cnab.payment.way
    comodel_name='cnab.payment.way' compute='_compute_cnab_payment_way_id'
  • cnab_pix_transfer_type_id Many2one → cnab.pix.transfer.type
    comodel_name='cnab.pix.transfer.type' compute='_compute_cnab_pix_transfer_type_id' store=False
  • cnab_pix_type_id Many2one → cnab.pix.key.type
    comodel_name='cnab.pix.key.type' compute='_compute_cnab_pix_type_id' store=False
  • service_type Selection
    compute='_compute_cnab_payment_way_id' selection=TIPO_SERVICO store=True
Public methods (0)

No public methods.

New fields (3)
  • cnab_payment_way_ids Many2many → cnab.payment.way
    comodel_name='cnab.payment.way' domain="[('cnab_structure_id', '=', cnab_structure_id)]" relation='payment_mode_cnab_payment_way_rel' string='CNAB Payment Ways'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    args: 'l10n_br_cnab.structure'
  • cnab_structure_ok Boolean
    default=False string='Allowed in CNAB (OCA Processor)'
Public methods (0)

No public methods.

New fields (2)
  • cnab_processor Selection
    compute='_compute_cnab_processor' selection='_selection_cnab_processor'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' compute='_compute_cnab_structure_id'
Public methods (2)
  • generate_payment_file(self)
    Returns (payment file as string, filename)
  • generated2uploaded(self)

New fields (13)
  • backup_file Binary
    attachment=True copy=False readonly=True
  • backup_filename Char
    copy=False
  • company_id Many2one → res.company
    default=<expr> required=True string='Company' args: 'res.company'
  • csv_file Binary
    attachment=True help='Upload the CSV file for restore operations.'
  • csv_filename Char
  • detected_model Many2one → ir.model
    comodel_name='ir.model' compute='_compute_detected_model' help='Model detected automatically from the uploaded CSV filename.' store=True
  • is_complete_backup Boolean
    default=True help='If checked, all CNAB models will be backed up.' string='Complete Backup'
  • is_locked Boolean
    compute='_compute_is_locked' help='Operation is locked when completed, in error, or manually locked.' store=True
  • name Char
    default=<expr> required=True string='Operation Name' tracking=True
  • operation_status Selection
    copy=False default='draft' required=True selection=OPERATION_STATUS string='Status' tracking=True
  • operation_type Selection
    default='backup' required=True selection=OPERATION_TYPE tracking=True
  • records_processed Integer
    copy=False default=0 readonly=True
  • target_model Selection
    default='complete' help="Select the model to backup or choose 'Complete Backup' for all." selection=TARGET_MODELS_SELECTION tracking=True
Public methods (5)
  • action_lock_operation(self)
    Manually lock the operation to prevent further changes.
  • action_process_operation(self)
    Execute the selected operation (backup, upgrade, restore).
  • action_reset_to_draft(self)
    Reset the operation to draft status (system administrators only).
  • unlink(self)
  • write(self, vals)

New fields (10)
  • bank_account_cnab_id Many2one → account.account
    comodel_name='account.account' related='journal_id.default_account_id'
  • bank_id Many2one → res.bank
    comodel_name='res.bank' related='journal_id.bank_id'
  • cnab_format Char
    related='cnab_structure_id.cnab_format'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' domain="[('bank_id', '=', bank_id),('payment_method_id', 'in', payment_method_ids),('state', '=', 'approved')]"
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> required=True string='Company'
  • filename Char
  • journal_id Many2one → account.journal
    comodel_name='account.journal' help='Only journals where the CNAB Import is allowed.' required=True
  • payment_method_ids Many2many → account.payment.method
    comodel_name='account.payment.method' compute='_compute_payment_method_ids'
  • return_file Binary
  • type Selection
    args: [('inbound', 'Inbound Payment'), ('outbound', 'Outbound Payment')]
Public methods (1)
  • import_cnab(self)

New fields (5)
  • cnab_line_id Many2one → l10n_br_cnab.line
    ondelete='cascade' required=True states={'draft': [('readonly', False)]} args: 'l10n_br_cnab.line'
  • condition_ids One2many → cnab.line.group.field.condition
    comodel_name='cnab.line.group.field.condition' inverse_name='cnab_group_id' readonly=True states={'draft': [('readonly', False)]}
  • field_ids One2many → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' domain="[('cnab_line_id', '=', cnab_line_id)]" inverse_name='cnab_group_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    states={'draft': [('readonly', False)]}
  • state Selection
    readonly=True related='cnab_line_id.state'
Public methods (1)
  • default_get(self, fields)
    @api.model

New fields (6)
  • cnab_group_id Many2one → cnab.line.field.group
    comodel_name='cnab.line.field.group' readonly=True states={'draft': [('readonly', False)]}
  • cnab_line_id Many2one → l10n_br_cnab.line
    comodel_name='l10n_br_cnab.line' related='cnab_group_id.cnab_line_id'
  • field_id Many2one → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' domain="[('cnab_line_id', '=', cnab_line_id)]" readonly=True states={'draft': [('readonly', False)]}
  • json_value Char
    readonly=True required=True states={'draft': [('readonly', False)]} string='Value (JSON format)'
  • operator Selection
    default='in' readonly=True required=True selection=[('in', 'in'), ('not in', 'not in')] states={'draft': [('readonly', False)]}
  • state Selection
    readonly=True related='cnab_group_id.state'
Public methods (1)
  • default_get(self, fields_list)
    @api.model
    Override default_get

New fields (5)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • gen_liquidation_move Boolean
    help='Mark this option if this occurrence corresponds to a liquidation move.' string='Generate Liquidation Move'
  • name Char
    compute='_compute_name'
Public methods (0)

No public methods.

New fields (6)
  • batch_id Many2one → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' string='Cnab Batch'
  • clearinghouse_code Char
    help='Centralizing Clearing House Code\n(Código da Câmara Centralizadora)'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • name Char
    compute='_compute_name'
Public methods (0)

No public methods.

New fields (5)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • key_type Selection
    required=True selection=PartnerPix.KEY_TYPES string='PIX Key Type'
  • name Char
    compute='_compute_name'
Public methods (0)

No public methods.

New fields (5)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • name Char
    compute='_compute_name'
  • type_domain Selection
    selection=AccountPaymentLine.PIX_TRANSFER_TYPES string='Transfer Type'
Public methods (0)

No public methods.

New fields (6)
  • cnab_file Binary
    string='CNAB File'
  • cnab_file_name Char
    compute='_compute_cnab_file_name'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure'
  • output Text
    string='CNAB Text Output'
  • output_yaml Text
    compute='_compute_cnab_txt' string='CNAB YAML Output'
  • payment_order_id Many2one → account.payment.order
    comodel_name='account.payment.order' string='Payment Order'
Public methods (1)
  • load_file(self)
    Action for download CNAB File

New fields (7)
  • cnab_field_id Many2one → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' string='CNAB Field'
  • current_view Char
  • model_id Many2one → ir.model
    string='Related Model' args: 'ir.model'
  • new_field_id Many2one → ir.model.fields
    comodel_name='ir.model.fields' domain="[('model_id', '=', parent_model_id)]"
  • notation_field Char
  • notation_field_view Char
    compute='_compute_notation_field_view'
  • parent_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_parent_model_id' string='Parent Model'
Public methods (3)
  • action_add_field(self)
    Action Add Field
  • action_confirm(self)
    Action Confirm
  • action_remove_last_field(self)
    Action Confirm

New fields (5)
  • cnab_payment_way_ids One2many → cnab.payment.way
    comodel_name='cnab.payment.way' domain="[('cnab_structure_id', '=', cnab_structure_id)]" help='Payments ways that use the structure of this batch.' inverse_name='batch_id' readonly=True states={'draft': [('readonly', False)]} string='Payments Ways'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' domain="[('cnab_format', '=', '240')]" help='Only structures with code equal to 240 is allowed.' readonly=True states={'draft': [('readonly', False)]}
  • line_ids One2many → l10n_br_cnab.line
    comodel_name='l10n_br_cnab.line' domain="[('cnab_format', '=', '240')]" help='Only structures with code equal to 240 is allowed.' inverse_name='batch_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    readonly=True states={'draft': [('readonly', False)]}
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
Public methods (6)
  • check_batch(self)
  • get_header(self)
    Returns the batch header record
  • get_segments(self)
    Returns the batch segments records
  • get_trailer(self)
    Returns the batch trailer record
  • output(self, bank_lines, seq_batch)
    Generates and returns a batch object with the cnab output data.
  • unlink(self)

New fields (18)
  • batch_id Many2one → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' ondelete='cascade' readonly=True states={'draft': [('readonly', False)]}
  • cnab_format Char
    related='cnab_structure_id.cnab_format' states={'draft': [('readonly', False)]}
  • cnab_payment_way_ids Many2many → cnab.payment.way
    comodel_name='cnab.payment.way' domain="[('cnab_structure_id', '=', cnab_structure_id)]" help='Payment Ways that must use this segment.' readonly=True states={'draft': [('readonly', False)]} string='Payments Ways'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' readonly=True required=True states={'draft': [('readonly', False)]}
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' readonly=True required=True states={'draft': [('readonly', False)]}
  • communication_flow Selection
    required=True states={'draft': [('readonly', False)]} args: [('sending', 'Sending'), ('return', 'Return'), ('both', 'Sending and Return')]
  • content_dest_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_dest_source_model_id' help='Related model that will provide the destination of the contents of return CNAB files.' states={'draft': [('readonly', False)]} string='Content Destination'
  • content_source_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_content_source_model_id' help='Related model that will provide the origin of the contents of CNABfiles.' states={'draft': [('readonly', False)]} string='Content Source'
  • current_view Selection
    default='general' required=True states={'draft': [('readonly', False)]} args: [('general', 'General'), ('sending', 'Sending'), ('return', 'Return')]
  • field_ids One2many → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' inverse_name='cnab_line_id' readonly=True states={'draft': [('readonly', False)]}
  • group_ids One2many → cnab.line.field.group
    comodel_name='cnab.line.field.group' inverse_name='cnab_line_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    compute='_compute_name' store=True
  • requerid Boolean
    states={'draft': [('readonly', False)]}
  • resource_ref Reference
    selection='_selection_target_model' states={'draft': [('readonly', False)]} string='Reference'
  • segment_code Char
    states={'draft': [('readonly', False)]}
  • sequence Integer
    readonly=True states={'draft': [('readonly', False)]}
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
  • type Selection
    readonly=True states={'draft': [('readonly', False)]} args: [('header', 'Header'), ('segment', 'Segment'), ('trailer', 'Trailer')]
Public methods (7)
  • action_general_view(self)
  • action_return_view(self)
  • action_sending_view(self)
  • check_line(self)
  • is_requerid(self, payment_way)
    checks if the segment is required based on the information provided.
  • output(self, resource_ref, record_type, **kwargs)
    Compute CNAB output with all fields for this Line
  • unlink(self)

New fields (23)
  • assumed_comma Integer
    help='indicates the position of the comma within a numeric field.' readonly=True states={'draft': [('readonly', False)]}
  • cnab_group_id Many2one → cnab.line.field.group
    readonly=True states={'draft': [('readonly', False)]} args: 'cnab.line.field.group'
  • cnab_line_id Many2one → l10n_br_cnab.line
    ondelete='cascade' readonly=True required=True states={'draft': [('readonly', False)]} args: 'l10n_br_cnab.line'
  • computed_name Char
    compute='_compute_name' string='Field'
  • content_dest_field Char
    help='Inform the field with the origin of the content, expressed with dot notation.' readonly=True states={'draft': [('readonly', False)]} string='Content Destination Field'
  • content_dest_model_id Many2one → ir.model
    comodel_name='ir.model' related='cnab_line_id.content_dest_model_id'
  • content_source_field Char
    help='Inform the field with the origin of the content, expressed with dot notation.' readonly=True states={'draft': [('readonly', False)]}
  • content_source_model_id Many2one → ir.model
    comodel_name='ir.model' related='cnab_line_id.content_source_model_id'
  • default_value Char
    readonly=True states={'draft': [('readonly', False)]}
  • end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='End Position'
  • meaning Char
    readonly=True states={'draft': [('readonly', False)]}
  • name Char
    readonly=True states={'draft': [('readonly', False)]}
  • notes Char
    readonly=True states={'draft': [('readonly', False)]}
  • preview_field Char
    compute='_compute_preview_field'
  • ref_name Char
    compute='_compute_ref_name' help="Unique reference name to identify the cnab field, can be used to search the field content in python expressions in 'Dynamic Content'. It is generated automatically by aggregating the field name, starting position and ending position. ex:. 'field_name_001-015'" string='Reference Name'
  • related_field_id Many2one → ir.model.fields
    readonly=True states={'draft': [('readonly', False)]} args: 'ir.model.fields'
  • resource_ref Reference
    related='cnab_line_id.resource_ref' string='Reference'
  • return_dynamic_content Char
    readonly=True states={'draft': [('readonly', False)]}
  • sending_dynamic_content Char
    help="Expression in Python to define the final value of the content,you can use the following predefined words:\n\n'content' returns the value of the mapped content source field.\n'time' class to handle date.\n'seq_batch' returns the batch sequence.\n'seq_record_detail' returns the sequence for detail record in the batch.\n'payment_way_code' return the batch payment way\n'payment_type_code' return the batch payment type\n'qty_batches' returns the number of batches\n'qty_records' returns the number of records\n'batch_detail_lines' returns a list of batch detail records.'segment_code' returns the code of the segment defined in the header of the line." readonly=True states={'draft': [('readonly', False)]}
  • size Integer
    compute='_compute_size'
  • start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Start Position'
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
  • type Selection
    readonly=True states={'draft': [('readonly', False)]} args: [('alpha', _('Alphanumeric')), ('num', _('Numeric'))]
Public methods (11)
  • action_approve(self)
  • action_change_field(self)
    Action for open select field wizard"
  • action_change_field_return(self)
    Action for open select field wizard for mapping return content
  • action_change_field_sending(self)
    Action for open select field wizard for mapping sending content
  • action_draft(self)
  • action_review(self)
  • check_field(self)
  • eval_compute_value(self, content, python_expression, **kwargs)
    Execute python code and return computed value
  • format(self, size, value_type, value)
    formats the value according to the specification
  • output(self, resource_ref, **kwargs)
    Compute output value for this field
  • unlink(self)

New fields (6)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True
  • match_bank_type Selection
    default='any' required=True args: [('same', 'Same Bank'), ('other', 'Other Bank'), ('any', 'Any')]
  • match_partner_type Selection
    default='any' required=True args: [('employee', 'Employee'), ('supplier', 'Supplier'), ('any', 'Any')]
  • payment_way_id Many2one → cnab.payment.way
    comodel_name='cnab.payment.way' domain="[('cnab_structure_id', '=', cnab_structure_id)]" required=True
  • sequence Integer
    default=10
  • service_type Selection
    required=True selection=TIPO_SERVICO
Public methods (0)

No public methods.

New fields (29)
  • additional_info Char
  • balance Float
    compute='_compute_balance' help='Balance = Payment Value + Discount Value + Rebate Value - Fees'
  • bank_code Char
  • batch_code Char
  • centralizing_chamber_code Char
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' related='cnab_return_log_id.cnab_structure_id'
  • doc_purpose Char
  • expected_payment_date Date
  • gen_liquidation_move Boolean
    help='If check, this CNAB Event will generate a liquidity move line.' string='Generate Liquidation Move'
  • generated_move_id Many2one → account.move
    comodel_name='account.move'
  • journal_id Many2one → account.journal
    comodel_name='account.journal' related='cnab_return_log_id.journal_id'
  • move_line_ids Many2many → account.move.line
    comodel_name='account.move.line' ondelete='restrict'
  • move_type_code Char
  • occurrence_code_1 Char
  • occurrence_code_2 Char
  • occurrence_code_3 Char
  • occurrence_code_4 Char
  • occurrence_code_5 Char
  • partner_bank_account Char
  • partner_bank_account_dac Char
  • partner_bank_branch Char
  • partner_bank_code Char
  • partner_document Char
    help="Partners's document number, it can be a CNPJ or CPF."
  • partner_name Char
  • partner_notification Char
  • record_type Char
  • seq_number Char
  • state Selection
    selection=[('error', 'Error'), ('ignored', 'Ignored'), ('ready', 'Ready to Genereta Move'), ('confirmed', 'Confirmed')]
  • ted_purpose Char
Public methods (11)
  • action_ignore_event(self)
  • check_gen_liquidation_move(self)
  • confirm_event(self)
  • create(self, vals)
    @api.model
    Override Create Method
  • create_liq_move(self)
  • create_tariff_move(self)
  • get_description_occurrence(self, event_code)
    Get occurrence description by occurrence code
  • load_bank_payment_line(self)
    When for cnab outbound payment processed by this module the bank_payment_line_id is filled based on your_number field
  • load_description_occurrences(self)
    Generate occurrence description for all occurrences
  • set_move_line_ids(self)
  • set_occurrence_date(self)

New fields (11)
  • bank_acc_number Char
    compute='_compute_bank_acc_number' inverse='_inverse_bank_acc_number'
  • bank_account_cnab_id Many2one → account.account
    comodel_name='account.account' readonly=True related='journal_id.default_account_id'
  • bank_id Many2one → res.bank
    comodel_name='res.bank' related='journal_id.bank_id'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure'
  • cnpj_cpf Char
  • company_id Many2one → res.company
    comodel_name='res.company' string='Company'
  • header_file Char
  • journal_id Many2one → account.journal
    comodel_name='account.journal'
  • return_file Binary
  • state Selection
    selection=[('draft', 'Draft'), ('confirmed', 'Confirmed')]
  • type Selection
    args: [('inbound', 'Inbound Payment'), ('outbound', 'Outbound Payment')]
Public methods (2)
  • action_confirm_return_log(self)
  • unlink(self)

New fields (1)
  • seq_number Char
Public methods (0)

No public methods.

New fields (32)
  • bank_id Many2one → res.bank
    comodel_name='res.bank' readonly=True states={'draft': [('readonly', False)]}
  • batch_ids One2many → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_format Char
    related='payment_method_id.code'
  • cnab_occurrence_ids One2many → cnab.occurrence
    comodel_name='cnab.occurrence' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_payment_rule_ids One2many → l10n_br_cnab.payment.rule
    comodel_name='l10n_br_cnab.payment.rule' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]} string='Payment Rules'
  • cnab_payment_way_ids One2many → cnab.payment.way
    comodel_name='cnab.payment.way' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_pix_key_type_ids One2many → cnab.pix.key.type
    comodel_name='cnab.pix.key.type' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_pix_transfer_type_ids One2many → cnab.pix.transfer.type
    comodel_name='cnab.pix.transfer.type' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • conf_bank_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Bank Last Position'
  • conf_bank_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Bank Start Position'
  • conf_batch_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Batch Last Position'
  • conf_batch_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Batch Start Position'
  • conf_detail_end_pos Integer
    help='Last position of sequencial identification of Detail Records. Only for detail records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_detail_start_pos Integer
    help='Position of sequencial identification of Detail Records. Only for detail records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_payment_way_end_pos Integer
    help='Payment Way last position in Header Batch Records. Only for Header Batch Records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_payment_way_start_pos Integer
    help='Payment Way start position in Header Batch Records. Only for Header Batch Records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_record_type_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Record Type Last Position'
  • conf_record_type_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Record Type Start Position'
  • conf_segment_end_pos Integer
    help='Last position of segment of an detail record. Only for detail records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_segment_start_pos Integer
    help='Start position of segment of an detail record. Only for detail records.' readonly=True states={'draft': [('readonly', False)]}
  • content_source_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_content_source_model_id' help='Related model that will provide the origin of the contents of CNAB files.' string='Content Source'
  • line_ids One2many → l10n_br_cnab.line
    comodel_name='l10n_br_cnab.line' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    readonly=True states={'draft': [('readonly', False)]}
  • payment_method_id Many2one → account.payment.method
    comodel_name='account.payment.method' domain=[('code', 'in', CNAB_CODES)] states={'draft': [('readonly', False)]}
  • payment_type Selection
    related='payment_method_id.payment_type'
  • record_type_batch_header_id Integer
    help='What`s the identification for header of batch type?' readonly=True states={'draft': [('readonly', False)]} string='Batch Header Type ID'
  • record_type_batch_trailer_id Integer
    help='What`s the identification for trailer of batch type?' readonly=True states={'draft': [('readonly', False)]} string='Batch Trailer Type ID'
  • record_type_detail_id Integer
    help='What`s the identification for detail type?' readonly=True states={'draft': [('readonly', False)]} string='Detail Type ID'
  • record_type_file_header_id Integer
    help='What`s the identification for header of file type?' readonly=True states={'draft': [('readonly', False)]} string='File Header Type ID'
  • record_type_file_trailer_id Integer
    help='What`s the identification for trailer of file type?' readonly=True states={'draft': [('readonly', False)]} string='File Trailer Type ID'
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
  • unique_seq_per_segment Boolean
    default=False help='Defines seq_record_detail behavior. If True, each physical segment gets a unique number (1,2,3...). If False, segments within the same bank line share the same number. Note: This differs from seq_batch (starts at 0001 per file).' readonly=True states={'draft': [('readonly', False)]} string='Unique Sequence per Segment'
Public methods (10)
  • action_approve(self)
  • action_draft(self)
  • action_review(self)
  • check_structure(self)
  • get_header(self)
    Returns the file header record
  • get_trailer(self)
    Returns the file trailer record
  • output(self, pay_order)
    Receives a Payment Order record and returns the data in the CNAB structure
  • output_dicts(self, pay_order)
    Receives a Payment Order record and returns a Cnab Data Object"
  • output_yaml(self, pay_order)
    Receives a Payment Order record and returns the data in the CNAB structure in YAML format.
  • unlink(self)
REPOSITORY
REPOSITORYOCA/l10n-brazil
GIT
GIThttps://github.com/OCA/l10n-brazil.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-brazil/tree/15.0/l10n_br_cnab_structure
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYUncategorized
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Escodoo, Engenere
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Escodoo, Engenere
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Antônio Neto
WEBSITE
WEBSITEhttps://github.com/OCA/l10n-brazil
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:46:31
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/account-payment:
    - account_due_list
    - account_due_list_payment_mode
OCA/bank-payment:
    - account_payment_order
    - account_payment_partner
    - account_payment_mode
OCA/l10n-brazil:
    - l10n_br_account_payment_order
    - l10n_br_base
    - l10n_br_account_due_list
    - l10n_br_coa_generic
    - l10n_br_coa
odoo/odoo:
    - base
    - base_setup
    - web
    - base_address_city
    - base_address_extended
    - account
    - product
    - mail
    - bus
    - web_tour
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - base_iban
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES pyyaml
unidecode
erpbrasil.base
email-validator
num2words
phonenumbers
lxml
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (21)
XML IDNameModelTypeStatus
cnab_batch_form_view l10n_br_cnab.batch form New
cnab_batch_tree_view l10n_br_cnab.batch tree New
cnab_import_wizard cnab.import.wizard.form cnab.import.wizard form New
cnab_line_field_form_view l10n_br_cnab.line.field form New
cnab_line_field_group_condition_form_view cnab.line.group.field.condition form New
cnab_line_field_group_form_view cnab.line.field.group form New
cnab_line_field_tree_view l10n_br_cnab.line.field tree New
cnab_line_fields_group_condition_tree_view cnab.line.group.field.condition tree New
cnab_line_fields_group_tree_view cnab.line.field.group tree New
cnab_line_form_view l10n_br_cnab.line form New
cnab_line_tree_view l10n_br_cnab.line tree New
cnab_preview_wizard_form cnab.preview.wizard.form cnab.preview.wizard form New
cnab_structure_form_view l10n_br_cnab.structure form New
cnab_structure_payment_mode_form cnab_structure_payment_mode_form account.payment.mode group Inherits l10n_br_account_payment_order.l10n_br_account_payment_mode_form
cnab_structure_payment_order_form cnab_structure_payment_order_form account.payment.order field Inherits account_payment_order.account_payment_order_form
cnab_structure_tree_view l10n_br_cnab.structure tree New
field_select_wizard_form field.select.wizard.form field.select.wizard form New
journal_cnab_import_view_form journal.cnab.import.view.form account.journal xpath Inherits account.view_account_journal_form
l10n_br_cnab_return_event_form_view_structure l10n_br_cnab.return.event.form.view.structure l10n_br_cnab.return.event form New
l10n_br_cnab_return_log_form_view_structure l10n_br_cnab.return.log.form.view.structure l10n_br_cnab.return.log form New
l10n_br_cnab_return_log_tree_view_structure l10n_br_cnab.return.log.tree l10n_br_cnab.return.log tree New
Models touched (20)

New fields (10)
  • default_outbound_cnab_processor Selection
    help='CNAB Processor to be used in a payment order when it is not defined in the payment mode' selection=[('oca_processor', 'OCA Processor')] string='CNAB Processor'
  • default_outbound_cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' help='CNAB Structure to be used in a payment order when it is not defined in the payment mode.' string='CNAB Structure'
  • inbound_discount_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Discount Account for CNAB inbound payments.' string='Inbound Discount Account' tracking=True
  • inbound_interest_fee_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Interest and Fees Account for CNAB inbound payments.' string='Inbound Interest and Fees Account' tracking=True
  • inbound_rebate_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Rebate Account for CNAB inbound payments.' string='Inbound Rebate Account' tracking=True
  • outbound_discount_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Discount Account for CNAB outbound payments.' string='Outbound Discount Account' tracking=True
  • outbound_interest_fee_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Interest and Fees Account for CNAB outbound payments.' string='Outbound Interest and Fees Account' tracking=True
  • outbound_rebate_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Rebate Account for CNAB outbound payments.' string='Outbound Rebate Account' tracking=True
  • tariff_charge_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Default account for bank tariff.' string='Tariff Account' tracking=True
  • used_to_import_cnab Boolean
    string='Journal used for import CNAB'
Public methods (0)

No public methods.

New fields (5)
  • batch_template_id Many2one → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' compute='_compute_batch_template_id'
  • cnab_beneficiary_name Char
    compute='_compute_cnab_beneficiary_name' help='Name of the beneficiary (Nome do Favorecido) that will be informed in the CNAB.'
  • cnab_payment_way_id Many2one → cnab.payment.way
    comodel_name='cnab.payment.way' compute='_compute_cnab_payment_way_id'
  • cnab_pix_transfer_type_id Many2one → cnab.pix.transfer.type
    comodel_name='cnab.pix.transfer.type' compute='_compute_cnab_pix_transfer_type_id' store=False
  • cnab_pix_type_id Many2one → cnab.pix.key.type
    comodel_name='cnab.pix.key.type' compute='_compute_cnab_pix_type_id' store=False
Public methods (0)

No public methods.

New fields (3)
  • cnab_payment_way_ids Many2many → cnab.payment.way
    comodel_name='cnab.payment.way' relation='payment_mode_cnab_payment_way_rel' string='CNAB Payment Ways'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    args: 'l10n_br_cnab.structure'
  • cnab_structure_ok Boolean
    default=False string='Allowed in CNAB (OCA Processor)'
Public methods (0)

No public methods.

New fields (2)
  • cnab_processor Selection
    compute='_compute_cnab_processor' selection='_selection_cnab_processor'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' compute='_compute_cnab_structure_id'
Public methods (2)
  • generate_payment_file(self)
    Returns (payment file as string, filename)
  • generated2uploaded(self)

New fields (10)
  • bank_account_cnab_id Many2one → account.account
    comodel_name='account.account' readonly=True related='journal_id.default_account_id'
  • bank_id Many2one → res.bank
    comodel_name='res.bank' related='journal_id.bank_id'
  • cnab_format Char
    related='cnab_structure_id.cnab_format'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' domain="[('bank_id', '=', bank_id),('payment_method_id', 'in', payment_method_ids),('state', '=', 'approved')]"
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> required=True string='Company'
  • filename Char
  • journal_id Many2one → account.journal
    comodel_name='account.journal' help='Only journals where the CNAB Import is allowed.' required=True
  • payment_method_ids Many2many → account.payment.method
    comodel_name='account.payment.method' compute='_compute_payment_method_ids'
  • return_file Binary
  • type Selection
    args: [('inbound', 'Inbound Payment'), ('outbound', 'Outbound Payment')]
Public methods (1)
  • import_cnab(self)

New fields (5)
  • cnab_line_id Many2one → l10n_br_cnab.line
    ondelete='cascade' required=True states={'draft': [('readonly', False)]} args: 'l10n_br_cnab.line'
  • condition_ids One2many → cnab.line.group.field.condition
    comodel_name='cnab.line.group.field.condition' inverse_name='cnab_group_id' readonly=True states={'draft': [('readonly', False)]}
  • field_ids One2many → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' domain="[('cnab_line_id', '=', cnab_line_id)]" inverse_name='cnab_group_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    states={'draft': [('readonly', False)]}
  • state Selection
    readonly=True related='cnab_line_id.state'
Public methods (1)
  • default_get(self, fields)
    @api.model

New fields (6)
  • cnab_group_id Many2one → cnab.line.field.group
    comodel_name='cnab.line.field.group' readonly=True states={'draft': [('readonly', False)]}
  • cnab_line_id Many2one → l10n_br_cnab.line
    comodel_name='l10n_br_cnab.line' related='cnab_group_id.cnab_line_id'
  • field_id Many2one → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' domain="[('cnab_line_id', '=', cnab_line_id)]" readonly=True states={'draft': [('readonly', False)]}
  • json_value Char
    readonly=True required=True states={'draft': [('readonly', False)]} string='Value (JSON format)'
  • operator Selection
    default='in' readonly=True required=True selection=[('in', 'in'), ('not in', 'not in')] states={'draft': [('readonly', False)]}
  • state Selection
    readonly=True related='cnab_group_id.state'
Public methods (1)
  • default_get(self, fields_list)
    @api.model
    Override default_get

New fields (5)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • gen_liquidation_move Boolean
    help='Mark this option if this occurrence corresponds to a liquidation move.' string='Generate Liquidation Move'
  • name Char
    compute='_compute_name'
Public methods (0)

No public methods.

New fields (6)
  • batch_id Many2one → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' string='Cnab Batch'
  • clearinghouse_code Char
    help='Centralizing Clearing House Code\n(Código da Câmara Centralizadora)'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • name Char
    compute='_compute_name'
Public methods (0)

No public methods.

New fields (5)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • key_type Selection
    required=True selection=PartnerPix.KEY_TYPES string='PIX Key Type'
  • name Char
    compute='_compute_name'
Public methods (0)

No public methods.

New fields (5)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • name Char
    compute='_compute_name'
  • type_domain Selection
    selection=AccountPaymentLine.PIX_TRANSFER_TYPES string='Transfer Type'
Public methods (0)

No public methods.

New fields (6)
  • cnab_file Binary
    string='CNAB File'
  • cnab_file_name Char
    compute='_compute_cnab_file_name'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure'
  • output Text
    string='CNAB Text Output'
  • output_yaml Text
    compute='_compute_cnab_txt' string='CNAB YAML Output'
  • payment_order_id Many2one → account.payment.order
    comodel_name='account.payment.order' string='Payment Order'
Public methods (1)
  • load_file(self)
    Action for download CNAB File

New fields (7)
  • cnab_field_id Many2one → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' string='CNAB Field'
  • current_view Char
  • model_id Many2one → ir.model
    string='Related Model' args: 'ir.model'
  • new_field_id Many2one → ir.model.fields
    comodel_name='ir.model.fields' domain="[('model_id', '=', parent_model_id)]"
  • notation_field Char
  • notation_field_view Char
    compute='_compute_notation_field_view'
  • parent_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_parent_model_id' string='Parent Model'
Public methods (3)
  • action_add_field(self)
    Action Add Field
  • action_confirm(self)
    Action Confirm
  • action_remove_last_field(self)
    Action Confirm

New fields (5)
  • cnab_payment_way_ids One2many → cnab.payment.way
    comodel_name='cnab.payment.way' domain="[('cnab_structure_id', '=', cnab_structure_id)]" help='Payments ways that use the structure of this batch.' inverse_name='batch_id' readonly=True states={'draft': [('readonly', False)]} string='Payments Ways'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' domain="[('cnab_format', '=', '240')]" help='Only structures with code equal to 240 is allowed.' readonly=True states={'draft': [('readonly', False)]}
  • line_ids One2many → l10n_br_cnab.line
    comodel_name='l10n_br_cnab.line' domain="[('cnab_format', '=', '240')]" help='Only structures with code equal to 240 is allowed.' inverse_name='batch_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    readonly=True states={'draft': [('readonly', False)]}
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
Public methods (6)
  • check_batch(self)
  • get_header(self)
    Returns the batch header record
  • get_segments(self)
    Returns the batch segments records
  • get_trailer(self)
    Returns the batch trailer record
  • output(self, bank_lines, seq_batch)
    Generates and returns a batch object with the cnab output data.
  • unlink(self)

New fields (18)
  • batch_id Many2one → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' ondelete='cascade' readonly=True states={'draft': [('readonly', False)]}
  • cnab_format Char
    related='cnab_structure_id.cnab_format' states={'draft': [('readonly', False)]}
  • cnab_payment_way_ids Many2many → cnab.payment.way
    comodel_name='cnab.payment.way' domain="[('cnab_structure_id', '=', cnab_structure_id)]" help='Payment Ways that must use this segment.' readonly=True states={'draft': [('readonly', False)]} string='Payments Ways'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' readonly=True required=True states={'draft': [('readonly', False)]}
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' readonly=True required=True states={'draft': [('readonly', False)]}
  • communication_flow Selection
    required=True states={'draft': [('readonly', False)]} args: [('sending', 'Sending'), ('return', 'Return'), ('both', 'Sending and Return')]
  • content_dest_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_dest_source_model_id' help='Related model that will provide the destination of the contents of return CNAB files.' states={'draft': [('readonly', False)]} string='Content Destination'
  • content_source_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_content_source_model_id' help='Related model that will provide the origin of the contents of CNAB files.' states={'draft': [('readonly', False)]} string='Content Source'
  • current_view Selection
    default='general' required=True states={'draft': [('readonly', False)]} args: [('general', 'General'), ('sending', 'Sending'), ('return', 'Return')]
  • field_ids One2many → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' inverse_name='cnab_line_id' readonly=True states={'draft': [('readonly', False)]}
  • group_ids One2many → cnab.line.field.group
    comodel_name='cnab.line.field.group' inverse_name='cnab_line_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    compute='_compute_name' store=True
  • requerid Boolean
    states={'draft': [('readonly', False)]}
  • resource_ref Reference
    selection='_selection_target_model' states={'draft': [('readonly', False)]} string='Reference'
  • segment_code Char
    states={'draft': [('readonly', False)]}
  • sequence Integer
    readonly=True states={'draft': [('readonly', False)]}
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
  • type Selection
    readonly=True states={'draft': [('readonly', False)]} args: [('header', 'Header'), ('segment', 'Segment'), ('trailer', 'Trailer')]
Public methods (7)
  • action_general_view(self)
  • action_return_view(self)
  • action_sending_view(self)
  • check_line(self)
  • is_requerid(self, payment_way)
    checks if the segment is required based on the information provided.
  • output(self, resource_ref, record_type, **kwargs)
    Compute CNAB output with all fields for this Line
  • unlink(self)

New fields (23)
  • assumed_comma Integer
    help='indicates the position of the comma within a numeric field.' readonly=True states={'draft': [('readonly', False)]}
  • cnab_group_id Many2one → cnab.line.field.group
    readonly=True states={'draft': [('readonly', False)]} args: 'cnab.line.field.group'
  • cnab_line_id Many2one → l10n_br_cnab.line
    ondelete='cascade' readonly=True required=True states={'draft': [('readonly', False)]} args: 'l10n_br_cnab.line'
  • computed_name Char
    compute='_compute_name' string='Field'
  • content_dest_field Char
    help='Inform the field with the origin of the content, expressed with dot notation.' readonly=True states={'draft': [('readonly', False)]} string='Content Destination Field'
  • content_dest_model_id Many2one → ir.model
    comodel_name='ir.model' related='cnab_line_id.content_dest_model_id'
  • content_source_field Char
    help='Inform the field with the origin of the content, expressed with dot notation.' readonly=True states={'draft': [('readonly', False)]}
  • content_source_model_id Many2one → ir.model
    comodel_name='ir.model' related='cnab_line_id.content_source_model_id'
  • default_value Char
    readonly=True states={'draft': [('readonly', False)]}
  • end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='End Position'
  • meaning Char
    readonly=True states={'draft': [('readonly', False)]}
  • name Char
    readonly=True states={'draft': [('readonly', False)]}
  • notes Char
    readonly=True states={'draft': [('readonly', False)]}
  • preview_field Char
    compute='_compute_preview_field'
  • ref_name Char
    compute='_compute_ref_name' help="Unique reference name to identify the cnab field, can be used to search the field content in python expressions in 'Dynamic Content'. It is generated automatically by aggregating the field name, starting position and ending position. ex:. 'field_name_001-015'" string='Reference Name'
  • related_field_id Many2one → ir.model.fields
    readonly=True states={'draft': [('readonly', False)]} args: 'ir.model.fields'
  • resource_ref Reference
    related='cnab_line_id.resource_ref' string='Reference'
  • return_dynamic_content Char
    readonly=True states={'draft': [('readonly', False)]}
  • sending_dynamic_content Char
    help="Expression in Python to define the final value of the content,you can use the following predefined words: \n\n'content' returns the value of the mapped content source field. \n'time' class to handle date. \n'seq_batch' returns the batch sequence. \n'seq_record_detail' returns the sequence for detail record in the batch. \n'payment_way_code' return the batch payment way \n'patment_type_code' return the batch payment type \n'qty_batches' returns the number of batches \n'qty_records' returns the number of records \n'batch_detail_lines' returns a list of batch detail records.'segment_code' returns the code of the segment defined in the header of the line." readonly=True states={'draft': [('readonly', False)]}
  • size Integer
    compute='_compute_size'
  • start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Start Position'
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
  • type Selection
    readonly=True states={'draft': [('readonly', False)]} args: [('alpha', _('Alphanumeric')), ('num', _('Numeric'))]
Public methods (11)
  • action_approve(self)
  • action_change_field(self)
    Action for open select field wizard"
  • action_change_field_return(self)
    Action for open select field wizard for mapping return content
  • action_change_field_sending(self)
    Action for open select field wizard for mapping sending content
  • action_draft(self)
  • action_review(self)
  • check_field(self)
  • eval_compute_value(self, content, python_expression, **kwargs)
    Execute python code and return computed value
  • format(self, size, value_type, value)
    formats the value according to the specification
  • output(self, resource_ref, **kwargs)
    Compute output value for this field
  • unlink(self)

New fields (29)
  • additional_info Char
  • balance Float
    compute='_compute_balance' help='Balance = Payment Value + Discount Value + Rebate Value - Fees'
  • bank_code Char
  • batch_code Char
  • centralizing_chamber_code Char
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' related='cnab_return_log_id.cnab_structure_id'
  • doc_purpose Char
  • expected_payment_date Date
  • gen_liquidation_move Boolean
    help='If check, this CNAB Event will generate a liquidity move line.' string='Generate Liquidation Move'
  • generated_move_id Many2one → account.move
    comodel_name='account.move'
  • journal_id Many2one → account.journal
    comodel_name='account.journal' related='cnab_return_log_id.journal_id'
  • move_line_ids Many2many → account.move.line
    comodel_name='account.move.line' ondelete='restrict'
  • move_type_code Char
  • occurrence_code_1 Char
  • occurrence_code_2 Char
  • occurrence_code_3 Char
  • occurrence_code_4 Char
  • occurrence_code_5 Char
  • partner_bank_account Char
  • partner_bank_account_dac Char
  • partner_bank_branch Char
  • partner_bank_code Char
  • partner_document Char
    help="Partners's document number, it can be a CNPJ or CPF."
  • partner_name Char
  • partner_notification Char
  • record_type Char
  • seq_number Char
  • state Selection
    selection=[('error', 'Error'), ('ignored', 'Ignored'), ('ready', 'Ready to Genereta Move'), ('confirmed', 'Confirmed')]
  • ted_purpose Char
Public methods (11)
  • action_ignore_event(self)
  • check_gen_liquidation_move(self)
  • confirm_event(self)
  • create(self, vals)
    @api.model
    Override Create Method
  • create_liq_move(self)
  • create_tariff_move(self)
  • get_description_occurrence(self, event_code)
    Get occurrence description by occurrence code
  • load_bank_payment_line(self)
    When for cnab outbound payment processed by this module the bank_payment_line_id is filled based on your_number field
  • load_description_occurrences(self)
    Generate occurrence description for all occurrences
  • set_move_line_ids(self)
  • set_occurrence_date(self)

New fields (11)
  • bank_acc_number Char
    compute='_compute_bank_acc_number' inverse='_inverse_bank_acc_number'
  • bank_account_cnab_id Many2one → account.account
    comodel_name='account.account' readonly=True related='journal_id.default_account_id'
  • bank_id Many2one → res.bank
    comodel_name='res.bank' related='journal_id.bank_id'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure'
  • cnpj_cpf Char
  • company_id Many2one → res.company
    comodel_name='res.company' string='Company'
  • header_file Char
  • journal_id Many2one → account.journal
    comodel_name='account.journal'
  • return_file Binary
  • state Selection
    selection=[('draft', 'Draft'), ('confirmed', 'Confirmed')]
  • type Selection
    args: [('inbound', 'Inbound Payment'), ('outbound', 'Outbound Payment')]
Public methods (2)
  • action_confirm_return_log(self)
  • unlink(self)

New fields (1)
  • seq_number Char
Public methods (0)

No public methods.

New fields (30)
  • bank_id Many2one → res.bank
    comodel_name='res.bank' readonly=True states={'draft': [('readonly', False)]}
  • batch_ids One2many → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_format Char
    related='payment_method_id.code'
  • cnab_occurrence_ids One2many → cnab.occurrence
    comodel_name='cnab.occurrence' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_payment_way_ids One2many → cnab.payment.way
    comodel_name='cnab.payment.way' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_pix_key_type_ids One2many → cnab.pix.key.type
    comodel_name='cnab.pix.key.type' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_pix_transfer_type_ids One2many → cnab.pix.transfer.type
    comodel_name='cnab.pix.transfer.type' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • conf_bank_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Bank Last Position'
  • conf_bank_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Bank Start Position'
  • conf_batch_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Batch Last Position'
  • conf_batch_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Batch Start Position'
  • conf_detail_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Last position of sequencial identification of Detail Records. Only for detail records.'
  • conf_detail_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Position of sequencial identification of Detail Records. Only for detail records.'
  • conf_payment_way_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Payment Way last position in Header Batch Records. Only for Header Batch Records.'
  • conf_payment_way_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Payment Way start position in Header Batch Records. Only for Header Batch Records.'
  • conf_record_type_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Record Type Last Position'
  • conf_record_type_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Record Type Start Position'
  • conf_segment_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Last position of segment of an detail record. Only for detail records.'
  • conf_segment_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Start position of segment of an detail record. Only for detail records.'
  • content_source_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_content_source_model_id' help='Related model that will provide the origin of the contents of CNAB files.' string='Content Source'
  • line_ids One2many → l10n_br_cnab.line
    comodel_name='l10n_br_cnab.line' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    readonly=True states={'draft': [('readonly', False)]}
  • payment_method_id Many2one → account.payment.method
    comodel_name='account.payment.method' domain=[('code', 'in', CNAB_CODES)] states={'draft': [('readonly', False)]}
  • payment_type Selection
    related='payment_method_id.payment_type'
  • record_type_batch_header_id Integer
    help='What`s the identification for header of batch type?' readonly=True states={'draft': [('readonly', False)]} string='Batch Header Type ID'
  • record_type_batch_trailer_id Integer
    help='What`s the identification for trailer of batch type?' readonly=True states={'draft': [('readonly', False)]} string='Batch Trailer Type ID'
  • record_type_detail_id Integer
    help='What`s the identification for detail type?' readonly=True states={'draft': [('readonly', False)]} string='Detail Type ID'
  • record_type_file_header_id Integer
    help='What`s the identification for header of file type?' readonly=True states={'draft': [('readonly', False)]} string='File Header Type ID'
  • record_type_file_trailer_id Integer
    help='What`s the identification for trailer of file type?' readonly=True states={'draft': [('readonly', False)]} string='File Trailer Type ID'
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
Public methods (10)
  • action_approve(self)
  • action_draft(self)
  • action_review(self)
  • check_structure(self)
  • get_header(self)
    Returns the file header record
  • get_trailer(self)
    Returns the file trailer record
  • output(self, pay_order)
    Receives a Payment Order record and returns the data in the CNAB structure
  • output_dicts(self, pay_order)
    Receives a Payment Order record and returns a Cnab Data Object"
  • output_yaml(self, pay_order)
    Receives a Payment Order record and returns the data in the CNAB structure in YAML format.
  • unlink(self)
REPOSITORY
REPOSITORYOCA/l10n-brazil
GIT
GIThttps://github.com/OCA/l10n-brazil.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-brazil/tree/14.0/l10n_br_cnab_structure
VERSION
VERSION 1.3.1
CATEGORY
CATEGORYUncategorized
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Escodoo, Engenere
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Escodoo, Engenere
COMMITTERS
COMMITTERSRaphaël Valyi, Weblate, OCA-git-bot, Magno Costa, oca-ci, Antônio Neto, Kaynnan Lemes, Felipe
WEBSITE
WEBSITEhttps://github.com/OCA/l10n-brazil
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:40:53
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/account-payment:
    - account_due_list
    - account_due_list_payment_mode
OCA/bank-payment:
    - account_payment_order
    - account_payment_partner
    - account_payment_mode
OCA/l10n-brazil:
    - l10n_br_account_payment_order
    - l10n_br_base
    - l10n_br_account_due_list
    - l10n_br_coa_generic
    - l10n_br_coa
odoo/odoo:
    - base
    - base_setup
    - web
    - base_address_city
    - base_address_extended
    - account
    - product
    - mail
    - bus
    - web_tour
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - base_iban
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES pyyaml
unidecode
erpbrasil.base
email-validator
num2words
phonenumbers
lxml
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (21)
XML IDNameModelTypeStatus
cnab_batch_form_view l10n_br_cnab.batch form New
cnab_batch_tree_view l10n_br_cnab.batch tree New
cnab_import_wizard cnab.import.wizard.form cnab.import.wizard form New
cnab_line_field_form_view l10n_br_cnab.line.field form New
cnab_line_field_group_condition_form_view cnab.line.group.field.condition form New
cnab_line_field_group_form_view cnab.line.field.group form New
cnab_line_field_tree_view l10n_br_cnab.line.field tree New
cnab_line_fields_group_condition_tree_view cnab.line.group.field.condition tree New
cnab_line_fields_group_tree_view cnab.line.field.group tree New
cnab_line_form_view l10n_br_cnab.line form New
cnab_line_tree_view l10n_br_cnab.line tree New
cnab_preview_wizard_form cnab.preview.wizard.form cnab.preview.wizard form New
cnab_structure_form_view l10n_br_cnab.structure form New
cnab_structure_payment_mode_form cnab_structure_payment_mode_form account.payment.mode group Inherits l10n_br_account_payment_order.l10n_br_account_payment_mode_form
cnab_structure_payment_order_form cnab_structure_payment_order_form account.payment.order field Inherits account_payment_order.account_payment_order_form
cnab_structure_tree_view l10n_br_cnab.structure tree New
field_select_wizard_form field.select.wizard.form field.select.wizard form New
journal_cnab_import_view_form journal.cnab.import.view.form account.journal xpath Inherits account.view_account_journal_form
l10n_br_cnab_return_event_form_view_structure l10n_br_cnab.return.event.form.view.structure l10n_br_cnab.return.event form New
l10n_br_cnab_return_log_form_view_structure l10n_br_cnab.return.log.form.view.structure l10n_br_cnab.return.log form New
l10n_br_cnab_return_log_tree_view_structure l10n_br_cnab.return.log.tree l10n_br_cnab.return.log tree New
Models touched (20)

New fields (10)
  • default_outbound_cnab_processor Selection
    help='CNAB Processor to be used in a payment order when it is not defined in the payment mode' selection=[('oca_processor', 'OCA Processor')] string='CNAB Processor'
  • default_outbound_cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' help='CNAB Structure to be used in a payment order when it is not defined in the payment mode.' string='CNAB Structure'
  • inbound_discount_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Discount Account for CNAB inbound payments.' string='Inbound Discount Account' tracking=True
  • inbound_interest_fee_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Interest and Fees Account for CNAB inbound payments.' string='Inbound Interest and Fees Account' tracking=True
  • inbound_rebate_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Rebate Account for CNAB inbound payments.' string='Inbound Rebate Account' tracking=True
  • outbound_discount_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Discount Account for CNAB outbound payments.' string='Outbound Discount Account' tracking=True
  • outbound_interest_fee_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Interest and Fees Account for CNAB outbound payments.' string='Outbound Interest and Fees Account' tracking=True
  • outbound_rebate_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Rebate Account for CNAB outbound payments.' string='Outbound Rebate Account' tracking=True
  • tariff_charge_account_id Many2one → account.account
    check_company=True comodel_name='account.account' help='Default account for bank tariff.' string='Tariff Account' tracking=True
  • used_to_import_cnab Boolean
    string='Journal used for import CNAB'
Public methods (0)

No public methods.

New fields (5)
  • batch_template_id Many2one → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' compute='_compute_batch_template_id'
  • cnab_beneficiary_name Char
    compute='_compute_cnab_beneficiary_name' help='Name of the beneficiary (Nome do Favorecido) that will be informed in the CNAB.'
  • cnab_payment_way_id Many2one → cnab.payment.way
    comodel_name='cnab.payment.way' compute='_compute_cnab_payment_way_id'
  • cnab_pix_transfer_type_id Many2one → cnab.pix.transfer.type
    comodel_name='cnab.pix.transfer.type' compute='_compute_cnab_pix_transfer_type_id' store=False
  • cnab_pix_type_id Many2one → cnab.pix.key.type
    comodel_name='cnab.pix.key.type' compute='_compute_cnab_pix_type_id' store=False
Public methods (0)

No public methods.

New fields (3)
  • cnab_payment_way_ids Many2many → cnab.payment.way
    comodel_name='cnab.payment.way' relation='payment_mode_cnab_payment_way_rel' string='CNAB Payment Ways'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    args: 'l10n_br_cnab.structure'
  • cnab_structure_ok Boolean
    default=False string='Allowed in CNAB (OCA Processor)'
Public methods (0)

No public methods.

New fields (2)
  • cnab_processor Selection
    compute='_compute_cnab_processor' selection='_selection_cnab_processor'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' compute='_compute_cnab_structure_id'
Public methods (2)
  • generate_payment_file(self)
    Returns (payment file as string, filename)
  • generated2uploaded(self)

New fields (10)
  • bank_account_cnab_id Many2one → account.account
    comodel_name='account.account' readonly=True related='journal_id.default_account_id'
  • bank_id Many2one → res.bank
    comodel_name='res.bank' related='journal_id.bank_id'
  • cnab_format Char
    related='cnab_structure_id.cnab_format'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' domain="[('bank_id', '=', bank_id),('payment_method_id', 'in', payment_method_ids),('state', '=', 'approved')]"
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> required=True string='Company'
  • filename Char
  • journal_id Many2one → account.journal
    comodel_name='account.journal' help='Only journals where the CNAB Import is allowed.' required=True
  • payment_method_ids Many2many → account.payment.method
    comodel_name='account.payment.method' compute='_compute_payment_method_ids'
  • return_file Binary
  • type Selection
    args: [('inbound', 'Inbound Payment'), ('outbound', 'Outbound Payment')]
Public methods (1)
  • import_cnab(self)

New fields (5)
  • cnab_line_id Many2one → l10n_br_cnab.line
    ondelete='cascade' required=True states={'draft': [('readonly', False)]} args: 'l10n_br_cnab.line'
  • condition_ids One2many → cnab.line.group.field.condition
    comodel_name='cnab.line.group.field.condition' inverse_name='cnab_group_id' readonly=True states={'draft': [('readonly', False)]}
  • field_ids One2many → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' domain="[('cnab_line_id', '=', cnab_line_id)]" inverse_name='cnab_group_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    states={'draft': [('readonly', False)]}
  • state Selection
    readonly=True related='cnab_line_id.state'
Public methods (1)
  • default_get(self, fields)
    @api.model

New fields (6)
  • cnab_group_id Many2one → cnab.line.field.group
    comodel_name='cnab.line.field.group' readonly=True states={'draft': [('readonly', False)]}
  • cnab_line_id Many2one → l10n_br_cnab.line
    comodel_name='l10n_br_cnab.line' related='cnab_group_id.cnab_line_id'
  • field_id Many2one → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' domain="[('cnab_line_id', '=', cnab_line_id)]" readonly=True states={'draft': [('readonly', False)]}
  • json_value Char
    readonly=True required=True states={'draft': [('readonly', False)]} string='Value (JSON format)'
  • operator Selection
    default='in' readonly=True required=True selection=[('in', 'in'), ('not in', 'not in')] states={'draft': [('readonly', False)]}
  • state Selection
    readonly=True related='cnab_group_id.state'
Public methods (1)
  • default_get(self, fields_list)
    @api.model
    Override default_get

New fields (5)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • gen_liquidation_move Boolean
    help='Mark this option if this occurrence corresponds to a liquidation move.' string='Generate Liquidation Move'
  • name Char
    compute='_compute_name'
Public methods (0)

No public methods.

New fields (6)
  • batch_id Many2one → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' string='Cnab Batch'
  • clearinghouse_code Char
    help='Centralizing Clearing House Code\n(Código da Câmara Centralizadora)'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • name Char
    compute='_compute_name'
Public methods (0)

No public methods.

New fields (5)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • key_type Selection
    required=True selection=PartnerPix.KEY_TYPES string='PIX Key Type'
  • name Char
    compute='_compute_name'
Public methods (0)

No public methods.

New fields (5)
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' required=True string='Cnab Structure'
  • code Char
    required=True
  • description Char
  • name Char
    compute='_compute_name'
  • type_domain Selection
    selection=AccountPaymentLine.PIX_TRANSFER_TYPES string='Transfer Type'
Public methods (0)

No public methods.

New fields (6)
  • cnab_file Binary
    string='CNAB File'
  • cnab_file_name Char
    compute='_compute_cnab_file_name'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure'
  • output Text
    string='CNAB Text Output'
  • output_yaml Text
    compute='_compute_cnab_txt' string='CNAB YAML Output'
  • payment_order_id Many2one → account.payment.order
    comodel_name='account.payment.order' string='Payment Order'
Public methods (1)
  • load_file(self)
    Action for download CNAB File

New fields (7)
  • cnab_field_id Many2one → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' string='CNAB Field'
  • current_view Char
  • model_id Many2one → ir.model
    string='Related Model' args: 'ir.model'
  • new_field_id Many2one → ir.model.fields
    comodel_name='ir.model.fields' domain="[('model_id', '=', parent_model_id)]"
  • notation_field Char
  • notation_field_view Char
    compute='_compute_notation_field_view'
  • parent_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_parent_model_id' string='Parent Model'
Public methods (3)
  • action_add_field(self)
    Action Add Field
  • action_confirm(self)
    Action Confirm
  • action_remove_last_field(self)
    Action Confirm

New fields (5)
  • cnab_payment_way_ids One2many → cnab.payment.way
    comodel_name='cnab.payment.way' domain="[('cnab_structure_id', '=', cnab_structure_id)]" help='Payments ways that use the structure of this batch.' inverse_name='batch_id' readonly=True states={'draft': [('readonly', False)]} string='Payments Ways'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' domain="[('cnab_format', '=', '240')]" help='Only structures with code equal to 240 is allowed.' readonly=True states={'draft': [('readonly', False)]}
  • line_ids One2many → l10n_br_cnab.line
    comodel_name='l10n_br_cnab.line' domain="[('cnab_format', '=', '240')]" help='Only structures with code equal to 240 is allowed.' inverse_name='batch_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    readonly=True states={'draft': [('readonly', False)]}
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
Public methods (6)
  • check_batch(self)
  • get_header(self)
    Returns the batch header record
  • get_segments(self)
    Returns the batch segments records
  • get_trailer(self)
    Returns the batch trailer record
  • output(self, bank_lines, seq_batch)
    Generates and returns a batch object with the cnab output data.
  • unlink(self)

New fields (18)
  • batch_id Many2one → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' ondelete='cascade' readonly=True states={'draft': [('readonly', False)]}
  • cnab_format Char
    related='cnab_structure_id.cnab_format' states={'draft': [('readonly', False)]}
  • cnab_payment_way_ids Many2many → cnab.payment.way
    comodel_name='cnab.payment.way' domain="[('cnab_structure_id', '=', cnab_structure_id)]" help='Payment Ways that must use this segment.' readonly=True states={'draft': [('readonly', False)]} string='Payments Ways'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' readonly=True required=True states={'draft': [('readonly', False)]}
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' ondelete='cascade' readonly=True required=True states={'draft': [('readonly', False)]}
  • communication_flow Selection
    required=True states={'draft': [('readonly', False)]} args: [('sending', 'Sending'), ('return', 'Return'), ('both', 'Sending and Return')]
  • content_dest_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_dest_source_model_id' help='Related model that will provide the destination of the contents of return CNAB files.' states={'draft': [('readonly', False)]} string='Content Destination'
  • content_source_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_content_source_model_id' help='Related model that will provide the origin of the contents of CNABfiles.' states={'draft': [('readonly', False)]} string='Content Source'
  • current_view Selection
    default='general' required=True states={'draft': [('readonly', False)]} args: [('general', 'General'), ('sending', 'Sending'), ('return', 'Return')]
  • field_ids One2many → l10n_br_cnab.line.field
    comodel_name='l10n_br_cnab.line.field' inverse_name='cnab_line_id' readonly=True states={'draft': [('readonly', False)]}
  • group_ids One2many → cnab.line.field.group
    comodel_name='cnab.line.field.group' inverse_name='cnab_line_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    compute='_compute_name' store=True
  • requerid Boolean
    states={'draft': [('readonly', False)]}
  • resource_ref Reference
    selection='_selection_target_model' states={'draft': [('readonly', False)]} string='Reference'
  • segment_code Char
    states={'draft': [('readonly', False)]}
  • sequence Integer
    readonly=True states={'draft': [('readonly', False)]}
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
  • type Selection
    readonly=True states={'draft': [('readonly', False)]} args: [('header', 'Header'), ('segment', 'Segment'), ('trailer', 'Trailer')]
Public methods (7)
  • action_general_view(self)
  • action_return_view(self)
  • action_sending_view(self)
  • check_line(self)
  • is_requerid(self, payment_way)
    checks if the segment is required based on the information provided.
  • output(self, resource_ref, record_type, **kwargs)
    Compute CNAB output with all fields for this Line
  • unlink(self)

New fields (23)
  • assumed_comma Integer
    help='indicates the position of the comma within a numeric field.' readonly=True states={'draft': [('readonly', False)]}
  • cnab_group_id Many2one → cnab.line.field.group
    readonly=True states={'draft': [('readonly', False)]} args: 'cnab.line.field.group'
  • cnab_line_id Many2one → l10n_br_cnab.line
    ondelete='cascade' readonly=True required=True states={'draft': [('readonly', False)]} args: 'l10n_br_cnab.line'
  • computed_name Char
    compute='_compute_name' string='Field'
  • content_dest_field Char
    help='Inform the field with the origin of the content, expressed with dot notation.' readonly=True states={'draft': [('readonly', False)]} string='Content Destination Field'
  • content_dest_model_id Many2one → ir.model
    comodel_name='ir.model' related='cnab_line_id.content_dest_model_id'
  • content_source_field Char
    help='Inform the field with the origin of the content, expressed with dot notation.' readonly=True states={'draft': [('readonly', False)]}
  • content_source_model_id Many2one → ir.model
    comodel_name='ir.model' related='cnab_line_id.content_source_model_id'
  • default_value Char
    readonly=True states={'draft': [('readonly', False)]}
  • end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='End Position'
  • meaning Char
    readonly=True states={'draft': [('readonly', False)]}
  • name Char
    readonly=True states={'draft': [('readonly', False)]}
  • notes Char
    readonly=True states={'draft': [('readonly', False)]}
  • preview_field Char
    compute='_compute_preview_field'
  • ref_name Char
    compute='_compute_ref_name' help="Unique reference name to identify the cnab field, can be used to search the field content in python expressions in 'Dynamic Content'. It is generated automatically by aggregating the field name, starting position and ending position. ex:. 'field_name_001-015'" string='Reference Name'
  • related_field_id Many2one → ir.model.fields
    readonly=True states={'draft': [('readonly', False)]} args: 'ir.model.fields'
  • resource_ref Reference
    related='cnab_line_id.resource_ref' string='Reference'
  • return_dynamic_content Char
    readonly=True states={'draft': [('readonly', False)]}
  • sending_dynamic_content Char
    help="Expression in Python to define the final value of the content,you can use the following predefined words:\n\n'content' returns the value of the mapped content source field.\n'time' class to handle date.\n'seq_batch' returns the batch sequence.\n'seq_record_detail' returns the sequence for detail record in the batch.\n'payment_way_code' return the batch payment way\n'patment_type_code' return the batch payment type\n'qty_batches' returns the number of batches\n'qty_records' returns the number of records\n'batch_detail_lines' returns a list of batch detail records.'segment_code' returns the code of the segment defined in the header of the line." readonly=True states={'draft': [('readonly', False)]}
  • size Integer
    compute='_compute_size'
  • start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Start Position'
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
  • type Selection
    readonly=True states={'draft': [('readonly', False)]} args: [('alpha', _('Alphanumeric')), ('num', _('Numeric'))]
Public methods (11)
  • action_approve(self)
  • action_change_field(self)
    Action for open select field wizard"
  • action_change_field_return(self)
    Action for open select field wizard for mapping return content
  • action_change_field_sending(self)
    Action for open select field wizard for mapping sending content
  • action_draft(self)
  • action_review(self)
  • check_field(self)
  • eval_compute_value(self, content, python_expression, **kwargs)
    Execute python code and return computed value
  • format(self, size, value_type, value)
    formats the value according to the specification
  • output(self, resource_ref, **kwargs)
    Compute output value for this field
  • unlink(self)

New fields (29)
  • additional_info Char
  • balance Float
    compute='_compute_balance' help='Balance = Payment Value + Discount Value + Rebate Value - Fees'
  • bank_code Char
  • batch_code Char
  • centralizing_chamber_code Char
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure' related='cnab_return_log_id.cnab_structure_id'
  • doc_purpose Char
  • expected_payment_date Date
  • gen_liquidation_move Boolean
    help='If check, this CNAB Event will generate a liquidity move line.' string='Generate Liquidation Move'
  • generated_move_id Many2one → account.move
    comodel_name='account.move'
  • journal_id Many2one → account.journal
    comodel_name='account.journal' related='cnab_return_log_id.journal_id'
  • move_line_ids Many2many → account.move.line
    comodel_name='account.move.line' ondelete='restrict'
  • move_type_code Char
  • occurrence_code_1 Char
  • occurrence_code_2 Char
  • occurrence_code_3 Char
  • occurrence_code_4 Char
  • occurrence_code_5 Char
  • partner_bank_account Char
  • partner_bank_account_dac Char
  • partner_bank_branch Char
  • partner_bank_code Char
  • partner_document Char
    help="Partners's document number, it can be a CNPJ or CPF."
  • partner_name Char
  • partner_notification Char
  • record_type Char
  • seq_number Char
  • state Selection
    selection=[('error', 'Error'), ('ignored', 'Ignored'), ('ready', 'Ready to Genereta Move'), ('confirmed', 'Confirmed')]
  • ted_purpose Char
Public methods (11)
  • action_ignore_event(self)
  • check_gen_liquidation_move(self)
  • confirm_event(self)
  • create(self, vals)
    @api.model
    Override Create Method
  • create_liq_move(self)
  • create_tariff_move(self)
  • get_description_occurrence(self, event_code)
    Get occurrence description by occurrence code
  • load_bank_payment_line(self)
    When for cnab outbound payment processed by this module the bank_payment_line_id is filled based on your_number field
  • load_description_occurrences(self)
    Generate occurrence description for all occurrences
  • set_move_line_ids(self)
  • set_occurrence_date(self)

New fields (11)
  • bank_acc_number Char
    compute='_compute_bank_acc_number' inverse='_inverse_bank_acc_number'
  • bank_account_cnab_id Many2one → account.account
    comodel_name='account.account' readonly=True related='journal_id.default_account_id'
  • bank_id Many2one → res.bank
    comodel_name='res.bank' related='journal_id.bank_id'
  • cnab_structure_id Many2one → l10n_br_cnab.structure
    comodel_name='l10n_br_cnab.structure'
  • cnpj_cpf Char
  • company_id Many2one → res.company
    comodel_name='res.company' string='Company'
  • header_file Char
  • journal_id Many2one → account.journal
    comodel_name='account.journal'
  • return_file Binary
  • state Selection
    selection=[('draft', 'Draft'), ('confirmed', 'Confirmed')]
  • type Selection
    args: [('inbound', 'Inbound Payment'), ('outbound', 'Outbound Payment')]
Public methods (2)
  • action_confirm_return_log(self)
  • unlink(self)

New fields (1)
  • seq_number Char
Public methods (0)

No public methods.

New fields (30)
  • bank_id Many2one → res.bank
    comodel_name='res.bank' readonly=True states={'draft': [('readonly', False)]}
  • batch_ids One2many → l10n_br_cnab.batch
    comodel_name='l10n_br_cnab.batch' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_format Char
    related='payment_method_id.code'
  • cnab_occurrence_ids One2many → cnab.occurrence
    comodel_name='cnab.occurrence' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_payment_way_ids One2many → cnab.payment.way
    comodel_name='cnab.payment.way' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_pix_key_type_ids One2many → cnab.pix.key.type
    comodel_name='cnab.pix.key.type' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • cnab_pix_transfer_type_ids One2many → cnab.pix.transfer.type
    comodel_name='cnab.pix.transfer.type' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • conf_bank_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Bank Last Position'
  • conf_bank_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Bank Start Position'
  • conf_batch_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Batch Last Position'
  • conf_batch_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Batch Start Position'
  • conf_detail_end_pos Integer
    help='Last position of sequencial identification of Detail Records. Only for detail records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_detail_start_pos Integer
    help='Position of sequencial identification of Detail Records. Only for detail records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_payment_way_end_pos Integer
    help='Payment Way last position in Header Batch Records. Only for Header Batch Records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_payment_way_start_pos Integer
    help='Payment Way start position in Header Batch Records. Only for Header Batch Records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_record_type_end_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Record Type Last Position'
  • conf_record_type_start_pos Integer
    readonly=True states={'draft': [('readonly', False)]} string='Record Type Start Position'
  • conf_segment_end_pos Integer
    help='Last position of segment of an detail record. Only for detail records.' readonly=True states={'draft': [('readonly', False)]}
  • conf_segment_start_pos Integer
    help='Start position of segment of an detail record. Only for detail records.' readonly=True states={'draft': [('readonly', False)]}
  • content_source_model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_content_source_model_id' help='Related model that will provide the origin of the contents of CNAB files.' string='Content Source'
  • line_ids One2many → l10n_br_cnab.line
    comodel_name='l10n_br_cnab.line' inverse_name='cnab_structure_id' readonly=True states={'draft': [('readonly', False)]}
  • name Char
    readonly=True states={'draft': [('readonly', False)]}
  • payment_method_id Many2one → account.payment.method
    comodel_name='account.payment.method' domain=[('code', 'in', CNAB_CODES)] states={'draft': [('readonly', False)]}
  • payment_type Selection
    related='payment_method_id.payment_type'
  • record_type_batch_header_id Integer
    help='What`s the identification for header of batch type?' readonly=True states={'draft': [('readonly', False)]} string='Batch Header Type ID'
  • record_type_batch_trailer_id Integer
    help='What`s the identification for trailer of batch type?' readonly=True states={'draft': [('readonly', False)]} string='Batch Trailer Type ID'
  • record_type_detail_id Integer
    help='What`s the identification for detail type?' readonly=True states={'draft': [('readonly', False)]} string='Detail Type ID'
  • record_type_file_header_id Integer
    help='What`s the identification for header of file type?' readonly=True states={'draft': [('readonly', False)]} string='File Header Type ID'
  • record_type_file_trailer_id Integer
    help='What`s the identification for trailer of file type?' readonly=True states={'draft': [('readonly', False)]} string='File Trailer Type ID'
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('review', 'Review'), ('approved', 'Approved')]
Public methods (10)
  • action_approve(self)
  • action_draft(self)
  • action_review(self)
  • check_structure(self)
  • get_header(self)
    Returns the file header record
  • get_trailer(self)
    Returns the file trailer record
  • output(self, pay_order)
    Receives a Payment Order record and returns the data in the CNAB structure
  • output_dicts(self, pay_order)
    Receives a Payment Order record and returns a Cnab Data Object"
  • output_yaml(self, pay_order)
    Receives a Payment Order record and returns the data in the CNAB structure in YAML format.
  • unlink(self)