OdooWiki OCA HUB

CNAB Structure

l10n_br_cnab_structure folder_open OCA/l10n-brazil open_in_new
Uncategorised License: AGPL-3

This module adds functionality for implementing brazilian banking automation by CNAB file exchange.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Lets Brazilian companies define, in Odoo, the layout of CNAB bank exchange files (headers, batches, segments, trailers and fields) and use those definitions to generate payment files and read bank return files.

This module adds a configuration area where the layout of Brazilian bank CNAB files is described once and reused. A CNAB structure is linked to a bank and a payment method, and is made of batches; each batch contains lines (header, segments, trailer) and each line contains fields with start and end positions, type, default value or a mapped source field.

  • Payment modes can be linked to a CNAB structure and to specific payment ways; a flag marks them as handled by the OCA processor.
  • Payment orders automatically pick the structure and processor from the payment mode, or from defaults set on the bank journal for outbound payments.
  • When a payment order is generated, the module builds the CNAB file from the structure instead of the standard file, and marks the related journal items as exported.
  • Payment lines automatically get the payment way, service type, beneficiary name and PIX key/transfer types, using matching rules based on whether the bank is the same and whether the partner is an employee or a supplier.
  • Journals get extra accounts for tariffs, interest and fees, discounts and rebates, both for inbound and outbound payments.
  • Validation buttons check that lines and batches are complete and correctly ordered before approval; approved records cannot be deleted.
  • A data management screen allows backup, restore and upgrade of the CNAB configuration through CSV/ZIP files, with locking and status tracking.
  • Return events gain extra codes and can create counterpart, fee, discount, rebate and tariff accounting entries.

Menus it adds

CNAB StructureCNAB StructuresCNAB BatchesCNAB LinesCNAB FieldsCNAB Fields GroupCNAB Fields Group ConditionCNAB Data ManagementCNABCNAB ReturnsImport CNAB Returns
Models and fields (22)
  • account.journal · extends an existing modelused_to_import_cnab (Journal used for import CNAB), tariff_charge_account_id (Tariff Account), inbound_rebate_account_id (Inbound Rebate Account), outbound_rebate_account_id (Outbound Rebate Account), inbound_discount_account_id (Inbound Discount Account), outbound_discount_account_id (Outbound Discount Account), default_outbound_cnab_processor (CNAB Processor), inbound_interest_fee_account_id (Inbound Interest and Fees Account), outbound_interest_fee_account_id (Outbound Interest and Fees Account), default_outbound_cnab_structure_id (CNAB Structure)
  • cnab.occurrence · new modelcode, name, description, cnab_structure_id (Cnab Structure), gen_liquidation_move (Generate Liquidation Move)
  • cnab.payment.way · new modelcode, name, batch_id (Cnab Batch), description, cnab_structure_id (Cnab Structure), clearinghouse_code
  • cnab.pix.key.type · new modelcode, name, key_type (PIX Key Type), description, cnab_structure_id (Cnab Structure)
  • l10n_br_cnab.line · new modelname, type, state, batch_id, requerid, sequence, field_ids, group_ids, cnab_format, current_view, resource_ref (Reference), segment_code, cnab_structure_id, communication_flow, cnab_payment_way_ids (Payments Ways), content_dest_model_id (Content Destination), content_source_model_id (Content Source)
  • cnab.import.wizard · new modeltype, bank_id, filename, company_id (Company), journal_id, cnab_format, return_file, cnab_structure_id, payment_method_ids, bank_account_cnab_id
  • l10n_br_cnab.batch · new modelname, state, line_ids, cnab_structure_id, cnab_payment_way_ids (Payments Ways)
  • cnab.preview.wizard · new modeloutput (CNAB Text Output), cnab_file (CNAB File), output_yaml (CNAB YAML Output), cnab_file_name, payment_order_id (Payment Order), cnab_structure_id
  • field.select.wizard · new modelmodel_id (Related Model), current_view, new_field_id, cnab_field_id (CNAB Field), notation_field, parent_model_id (Parent Model), notation_field_view
  • account.payment.line · extends an existing modelservice_type, cnab_pix_type_id, batch_template_id, cnab_payment_way_id, cnab_beneficiary_name, cnab_pix_transfer_type_id
  • account.payment.mode · extends an existing modelcnab_structure_id, cnab_structure_ok (Allowed in CNAB (OCA Processor)), cnab_payment_way_ids (CNAB Payment Ways)
  • cnab.data.management · new modelname (Operation Name), csv_file, is_locked, company_id (Company), backup_file, csv_filename, target_model, detected_model, operation_type, backup_filename, operation_status (Status), records_processed, is_complete_backup (Complete Backup)
  • account.payment.order · extends an existing modelcnab_processor, cnab_structure_id
  • cnab.line.field.group · new modelname, state, field_ids, cnab_line_id, condition_ids
  • cnab.pix.transfer.type · new modelcode, name, description, type_domain (Transfer Type), cnab_structure_id (Cnab Structure)
  • l10n_br_cnab.structure · new modelname, state, bank_id, line_ids, batch_ids, cnab_format, payment_type, conf_bank_end_pos (Bank Last Position), payment_method_id, conf_batch_end_pos (Batch Last Position), cnab_occurrence_ids, conf_bank_start_pos (Bank Start Position), conf_detail_end_pos, cnab_payment_way_ids, conf_batch_start_pos (Batch Start Position), conf_segment_end_pos, cnab_payment_rule_ids (Payment Rules), cnab_pix_key_type_ids, conf_detail_start_pos, record_type_detail_id (Detail Type ID), conf_segment_start_pos, unique_seq_per_segment (Unique Sequence per Segment), content_source_model_id (Content Source), conf_payment_way_end_pos, conf_record_type_end_pos (Record Type Last Position), cnab_pix_transfer_type_ids, conf_payment_way_start_pos, conf_record_type_start_pos (Record Type Start Position), record_type_file_header_id (File Header Type ID), record_type_batch_header_id (Batch Header Type ID)
  • l10n_br_cnab.line.field · new modelname, size, type, notes, state, end_pos (End Position), meaning, ref_name (Reference Name), start_pos (Start Position), cnab_line_id, resource_ref (Reference), assumed_comma, cnab_group_id, computed_name (Field), default_value, preview_field, related_field_id, content_dest_field (Content Destination Field), content_source_field, content_dest_model_id, return_dynamic_content, content_source_model_id, sending_dynamic_content
  • l10n_br_cnab.return.log · extends an existing modeltype, state, bank_id, cnpj_cpf, company_id (Company), journal_id, header_file, return_file, bank_acc_number, cnab_structure_id, bank_account_cnab_id
  • l10n_br_cnab.return.lot · extends an existing modelseq_number
  • l10n_br_cnab.payment.rule · new modelsequence, service_type, payment_way_id, match_bank_type, cnab_structure_id, match_partner_type
  • l10n_br_cnab.return.event · extends an existing modelstate, balance, bank_code, batch_code, journal_id, seq_number, doc_purpose, record_type, ted_purpose, partner_name, move_line_ids, move_type_code, additional_info, partner_document, cnab_structure_id, generated_move_id, occurrence_code_1, occurrence_code_2, occurrence_code_3, occurrence_code_4, occurrence_code_5, partner_bank_code, partner_bank_branch, gen_liquidation_move (Generate Liquidation Move), partner_bank_account, partner_notification, expected_payment_date, partner_bank_account_dac, centralizing_chamber_code
  • cnab.line.group.field.condition · new modelstate, field_id, operator, json_value (Value (JSON format)), cnab_line_id, cnab_group_id

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. The module is very large and only part of the code was read. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 4 confirmed, 5 with no information of 9 versions.

Sources · Odoo 16.0

Confirmed on 2026-11-03 in branch 16.0 of OCA/l10n-brazil.

terminal Installation and usage

OCA documentation · Odoo 18.0

Configuration and usability:

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.