NF-e
l10n_br_nfe · OCA/l10n-brazil
-
Security25/25No findings
-
Activity25/25Last human commit 1 month ago
-
Required by20/254 modules depend on it
-
Maturity25/25In 6 Odoo series since 12.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
NFeAutXML— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
Este módulo permite a emissão de NF-e.
Mais especificamente ele:
- mapea os campos de NF-e do módulo
l10n_br_nfe_speccom os campos Odoo em especial os campos dos módulosl10n_br_baseel10n_br_fiscal - usa a logica do módulo
spec_driven_modelpara realizar esse mapeamento de forma dinâmica, em especial ele usa o sistema de modelos com várias camadas, ouStackedModel, com os modelosl10n_br_fiscal.document,l10n_br_fiscal.document.lineel10n_br_fiscal.document.relatedque tem varios niveis hierarquicos de elementos XML que estão sendo denormalizados dentro desses modelos Odoo - permite a exportação e importação de XML de NF-e
- tem wizards para implementar a comunicação SOAP de NF-e com a SEFAZ (Autorização, Cancelamento, Inutilização...)
- implementa a autorização, inutilização e contingência de documentos NFC-e
Módulos relacionados:
- este módulo não depende do módulo
accountdo Odoo. A integração com o financeiro do móduloaccounté realizada no módulol10n_br_account_nfe(tags dup e pag em especial) - existe também o módulo
l10n_br_delivery_nfeque faz a integração do módulol10n_br_nfecom o módulodeliverydo Odoo (tags de transportadora e de frete em especial)
Dependencies
- Odoo dependencies
- Python dependencies
- brazil_fiscal_client, brazilfiscalreport>=1.3.0, erpbrasil-base>=2.4.2, erpbrasil.assinatura, erpbrasil.edoc, erpbrasil.transmissao, nfelib[soap]>=3.2.0, transitions, erpbrasil-base>=2.5.0, email-validator, num2words, phonenumbers
- System dependencies
- None
- Required by
- l10n_br_account_nfe, l10n_br_delivery_nfe, l10n_br_ie_search, l10n_br_nfe_dfe
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 22
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
danfe_profile_form |
l10n_br_nfe.danfe.profile.form | l10n_br_nfe.danfe.profile | form | New |
danfe_profile_search |
l10n_br_nfe.danfe.profile.search | l10n_br_nfe.danfe.profile | search | New |
danfe_profile_tree |
l10n_br_nfe.danfe.profile.tree | l10n_br_nfe.danfe.profile | list | New |
document_import_wizard_form |
document_import_wizard.form | l10n_br_fiscal.document.import.wizard | form | Inherits l10n_br_fiscal.document_import_wizard_form |
l10n_br_nfe_import_xml_products_tree |
l10n_br_nfe.import_xml.products.tree | l10n_br_nfe.import_xml.products | list | New |
l10n_br_nfe_product_supplierinfo_form_view |
l10n_br_nfe.product.supplierinfo.form.view | product.supplierinfo | form | Inherits product.product_supplierinfo_form_view |
l10n_br_nfe_product_supplierinfo_tree_view |
l10n_br_nfe.product.supplierinfo.tree.view | product.supplierinfo | tree | Inherits product.product_supplierinfo_tree_view |
l10n_br_nfe_recipient_manifestation_event_form |
l10n_br_nfe_recipient_manifestation_event_form | l10n_br_nfe.md_event | form | New |
l10n_br_nfe_recipient_manifestation_event_tree |
l10n_br_nfe_recipient_manifestation_event_tree | l10n_br_nfe.md_event | list | New |
nfe_40_infadic_form |
nfe.40.infadic.form | nfe.40.infadic | form | New |
nfe_40_vol_form |
nfe.40.vol.form | nfe.40.vol | form | New |
nfe_di_form |
nfe.40.di.form | nfe.40.di | form | New |
nfe_di_tree |
nfe.40.di.tree | nfe.40.di | list | New |
nfe_document_edi_form_inherit |
l10n_br_nfe_edi.document.form.inherit | l10n_br_fiscal.document | form | Inherits l10n_br_fiscal_edi.document_form |
nfe_document_form_inherit |
l10n_br_nfe.document.form.inherit | l10n_br_fiscal.document | form | Inherits l10n_br_fiscal_edi.document_form |
nfe_document_line_form |
l10n_br_nfe.document.line.form | l10n_br_fiscal.document.line | form | Inherits l10n_br_fiscal.document_line_form |
nfe_res_company_form |
nfe.res.company.form | res.company | form | Inherits l10n_br_fiscal.fiscal_res_company_form |
nfe_res_config_settings_form |
nfe.res.config.settings.view.form | res.config.settings | form | Inherits l10n_br_fiscal.l10n_br_fiscal_res_config_settings_form |
partner_form |
l10n_br_nfe.partner.form | res.partner | form | Inherits l10n_br_fiscal.partner_form |
report_danfe_nfce |
report_danfe_nfce | ir.ui.view | qweb | New |
view_l10n_br_nfe_recipient_manifestation_event_filter |
l10n_br_nfe_recipient_manifestation_event_select | l10n_br_nfe.md_event | search | New |
view_nfe_recipient_manifestation_event_wizard_form |
nfe_recipient_manifestation_event.wizard.form | nfe_recipient_manifestation_event.wizard | form | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 15
No new fields.
Public methods (1)-
render_danfe_brazilfiscalreport(self, nfe, nfe_xml)
No new fields.
Public methods (0)No public methods.
-
imported_products_idsOne2many → l10n_br_nfe.import_xml.productscomodel_name='l10n_br_nfe.import_xml.products'inverse_name='import_xml_id'string='Imported Products' -
nat_opCharstring='Natureza da Operação'
No public methods.
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (0)No public methods.
-
activeBooleandefault=True -
carrier_receiptBooleanhelp='Print an extra receipt for the carrier to sign when collecting the goods, besides the delivery receipt. It is only printed when the NF-e has a carrier.' -
company_idsMany2many → res.companycomodel_name='res.company'compute='_compute_company_ids'help='Companies printing their DANFEs with this profile. Adding a company here replaces its current profile.'inverse='_inverse_company_ids'string='Companies' -
display_anpBooleanhelp='Print the ANP fuel data (product code, description and state of consumption) in the product description.'string='Display ANP Data' -
display_anvisaBooleanhelp='Print the ANVISA medicine data (product code and maximum consumer price) in the product description.'string='Display ANVISA Data' -
display_lotBooleanhelp='Print the traceability data (lot number, quantity, manufacturing and expiration dates) in the product description.'string='Display Lot Data' -
display_partner_orderBooleanhelp="Print the partner's order number and item (xPed and nItemPed) in the product description."string='Display Partner Order Data' -
display_pis_cofinsBooleanhelp='Select whether PIS and COFINS should be displayed in DANFE.'string='Display PIS/COFINS' -
display_product_additional_infoBooleandefault=Truehelp='Print the product additional information (infAdProd) in the product description.' -
font_sizeSelectiondefault=DANFE_FONT_SIZE_DEFAULTrequired=Trueselection=DANFE_FONT_SIZES -
font_typeSelectiondefault=DANFE_FONT_TYPE_DEFAULTrequired=Trueselection=DANFE_FONT_TYPES -
footer_stamp_logoBinaryhelp='Logo printed at the bottom right corner of each DANFE page.' -
footer_stamp_textCharhelp='Text printed at the bottom of each DANFE page, to the left of the footer stamp logo.' -
infcpl_semicolon_newlineBooleanhelp='Start a new line at each semicolon (;) of the additional information (infCpl).'string='Break Additional Info on Semicolons' -
invoice_displaySelectiondefault=DANFE_INVOICE_DISPLAY_DEFAULThelp='Choose to generate a full or incomplete invoice frame in the DANFE.'required=Trueselection=DANFE_INVOICE_DISPLAY -
lot_prefixCharhelp='Text printed before the lot data of each product.'string='Lot Data Prefix' -
margin_bottomIntegerdefault=5help='Bottom margin in mm.' -
margin_leftIntegerdefault=5help='Left margin in mm.' -
margin_rightIntegerdefault=5help='Right margin in mm.' -
margin_topIntegerdefault=5help='Top margin in mm.' -
nameCharrequired=Truetranslate=True -
price_precisionIntegerdefault=4help='Number of decimal places used to print the unit prices.'string='Unit Price Precision' -
quantity_precisionIntegerdefault=4help='Number of decimal places used to print the quantities.' -
receipt_positionSelectiondefault=DANFE_RECEIPT_POSITION_DEFAULThelp='Position of the receipt (canhoto) in portrait DANFEs. Landscape DANFEs always print it on the left side.'required=Trueselection=DANFE_RECEIPT_POSITIONS
No public methods.
-
cfop_xmlCharstring='XML CFOP' -
icms_percentCharstring='Alíquota ICMS' -
icms_valueCharstring='ICMS Value' -
import_xml_idMany2one → l10n_br_fiscal.document.import.wizardcomodel_name='l10n_br_fiscal.document.import.wizard' -
imported_partner_idMany2onerelated='import_xml_id.partner_id' -
ipi_percentCharstring='Alíquota IPI' -
ipi_valueCharstring='IPI Value' -
ncm_internalCharrelated='product_id.ncm_id.code'string='Internal NCM Code' -
ncm_xmlCharstring='XML NCM Code' -
new_cfop_idMany2one → l10n_br_fiscal.cfopcomodel_name='l10n_br_fiscal.cfop'string='Change CFOP' -
price_unit_comFloatstring='Comercial Price Unit' -
price_unit_tribFloatstring='Fiscal Price Unit' -
product_codeCharstring='XML Product Code' -
product_idMany2one → product.productcomodel_name='product.product'string='Product Internal Reference' -
product_nameChar -
product_supplier_idMany2one → product.supplierinfocomodel_name='product.supplierinfo'string='Product Supplier' -
quantity_comFloatstring='Comercial Quantity' -
quantity_tribFloat -
totalFloat -
uom_comCharstring='UOM Comercial' -
uom_conversion_factorFloatdefault=1string='UOM Conversion Factor' -
uom_internalMany2one → uom.uomcomodel_name='uom.uom'help='Internal UoM, equivalent to the comercial one in the document' -
uom_tribCharstring='UOM Fiscal'
No public methods.
-
access_keyCharrequired=True -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>index=Truerequired=Truestring='Company' -
document_numberChar -
document_typeSelectiondefault=MD.NFErequired=Trueselection=MD.DOC_TYPE -
environmentSelectionrelated='company_id.nfe_environment' -
event_typeSelectiondefault=MD.MANIF_CIENTEindex=Truerequired=Trueselection=MD.MANIFEST_TYPEstring='Manifestation Type' -
protocolChar -
protocol_dateDatetimestring='Registration Date' -
response_xmlTextstring='Response XML' -
serieChar -
stateSelectiondefault='draft'selection=[('draft', 'Draft'), ('done', 'Done')]
-
action_confirm(self) -
action_send_event(self, operation, valid_codes, new_state) -
validate_event_response(self, result, valid_codes)@api.model
-
nfe40_CNPJCharrelated='partner_acquirer_id.nfe40_CNPJ' -
nfe40_UFDesembCharrelated='state_clearance_id.code'string='Customs Clearance Code' -
nfe40_UFTerceiroCharrelated='partner_acquirer_id.state_id.code' -
nfe40_tpIntermedioSelectionselection=TPINTERMEDIO_DI -
nfe40_tpViaTranspSelectionselection=TPVIATRANSP_DI -
partner_acquirer_idMany2one → res.partnercomodel_name='res.partner'string='Partner Acquirer' -
state_clearance_idMany2one → res.country.statecomodel_name='res.country.state'domain=[('country_id.code', '=', 'BR')]string='State Customs Clearance'
No public methods.
-
access_keyCharrequired=Truesize=44 -
event_typeSelectiondefault='ciente'required=Trueselection=[('ciente', 'Ciente da Operação'), ('confirmado', 'Confirmada operação'), ('desconhecido', 'Desconhecimento'), ('nao_realizado', 'Não realizado')]
-
action_create_nfe_md_event(self) -
default_get(self, fields_list)
No new fields.
Public methods (2)-
default_get(self, default_fields)@api.modelThe nfe.40.prod mixin (prod XML tag) cannot be injected in the product.product object because the tag includes attributes from the Odoo fiscal document line and because we may have an Nfe with lines decsriptions instead of full blown products. So a part of the mapping is done in the fiscal document line: from Odoo -> XML by using related fields/_compute from XML -> Odoo by overriding the product default_get method -
match_or_create_m2o(self, rec_dict, parent_dict, model=None)
-
partner_uom_factorFloatdefault=1string='Partner UOM Factor' -
partner_uom_idMany2one → uom.uomcomodel_name='uom.uom'string='Partner Unit of Measure'
No public methods.
-
nfce_danfe_layoutSelectionreadonly=Falserelated='company_id.nfce_danfe_layout'string='NFCe Layout' -
nfe_authorize_accountant_download_xmlBooleanreadonly=Falserelated='company_id.nfe_authorize_accountant_download_xml'string='Include Accountant Partner data in persons authorized to download NFe XML' -
nfe_authorize_technical_download_xmlBooleanreadonly=Falserelated='company_id.nfe_authorize_technical_download_xml'string='Include Technical Support Partner data in persons authorized to download NFe XML' -
nfe_danfe_layoutSelectionreadonly=Falserelated='company_id.nfe_danfe_layout'string='NFe Layout' -
nfe_enable_sync_transmissionBooleanreadonly=Falserelated='company_id.nfe_enable_sync_transmission' -
nfe_environmentSelectionreadonly=Falserelated='company_id.nfe_environment'string='NFe Environment' -
nfe_transmissionSelectionreadonly=Falserelated='company_id.nfe_transmission'string='NFe Transmission' -
nfe_versionSelectionreadonly=Falserelated='company_id.nfe_version'string='NF-e Version' -
nfe_version_nameCharconfig_parameter='l10n_br_nfe.version.name'string='NFe Proc Version'
No public methods.
No new fields.
Public methods (1)-
match_or_create_m2o(self, rec_dict, parent_dict, model=None)@api.modelMatch a UoM by code, then by fuzzy name, never create. Some XMLs use a supplier abbreviation (e.g. ``uCom='MIL'``) that only matches the company UoM by name (``MILHEI``), hence the name_search fallback kept for backward compatibility. Creation is prevented by the ``spec_create_forbidden_models`` context key set by the import caller, so falling through to super() leaves the UoM unset instead of creating a partial record.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…