Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][IMP] l10n_br_fiscal: add operation line/product tags match #3418

Open
wants to merge 5 commits into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions l10n_br_fiscal/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"views/ncm_view.xml",
"views/nbm_view.xml",
"views/nbs_view.xml",
"views/product_tag_view.xml",
"views/service_type_view.xml",
"views/cest_view.xml",
"views/product_genre_view.xml",
Expand Down
103 changes: 103 additions & 0 deletions l10n_br_fiscal/data/operation_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,109 @@
<field name="product_type">00</field>
</record>

<record id="product_tag_st_6404" model="l10n_br_fiscal.product.tag">
<field name="name">ST CFOP 6404</field>
</record>
<record id="product_tag_st_6401" model="l10n_br_fiscal.product.tag">
<field name="name">ST CFOP 6401</field>
</record>

<record
id="tax_icms_regulation_other_state_st_1"
model="l10n_br_fiscal.tax.definition"
>
<field name="tax_group_id" ref="l10n_br_fiscal.tax_group_icms" />
<field name="is_taxed" eval="True" />
<field name="is_debit_credit" eval="True" />
<field name="custom_tax" eval="True" />
<field name="tax_id" ref="l10n_br_fiscal.tax_icms_12_st" />
<field name="state">approved</field>
</record>
<record
id="tax_icms_regulation_other_state_st_2"
model="l10n_br_fiscal.tax.definition"
>
<field name="tax_group_id" ref="l10n_br_fiscal.tax_group_icmsst" />
<field name="is_taxed" eval="True" />
<field name="is_debit_credit" eval="True" />
<field name="custom_tax" eval="True" />
<field name="tax_id" ref="l10n_br_fiscal.tax_icmsst_p30_50" />
<field name="state">approved</field>
</record>

<record id="fo_venda_venda_st_substituto" model="l10n_br_fiscal.operation.line">
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="name">Venda ST contribuinte substituto</field>
<field name="ind_ie_dest">1</field>
<field name="cfop_internal_id" ref="l10n_br_fiscal.cfop_5401" />
<field name="cfop_external_id" ref="l10n_br_fiscal.cfop_6401" />
<field name="state">approved</field>
<field name="product_type">04</field>
<field
name="product_fiscal_tag_ids"
eval="[(6,0,[ref('l10n_br_fiscal.product_tag_st_6401')])]"
/>
<field name="tax_icms_or_issqn">icms</field>
<field
name="tax_definition_ids"
eval="[(6, 0, [ref('l10n_br_fiscal.tax_icms_regulation_other_state_st_1'),ref('l10n_br_fiscal.tax_icms_regulation_other_state_st_2')])]"
/>
</record>

<record id="fo_venda_revenda_st_substituto" model="l10n_br_fiscal.operation.line">
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="name">Revenda ST contribuinte substituto</field>
<field name="ind_ie_dest">1</field>
<field name="cfop_internal_id" ref="l10n_br_fiscal.cfop_5403" />
<field name="cfop_external_id" ref="l10n_br_fiscal.cfop_6403" />
<field name="state">approved</field>
<field name="product_type">00</field>
</record>

<record
id="tax_icms_regulation_other_state_st"
model="l10n_br_fiscal.tax.definition"
>
<field name="tax_group_id" ref="l10n_br_fiscal.tax_group_icms" />
<field name="is_taxed" eval="True" />
<field name="is_debit_credit" eval="True" />
<field name="custom_tax" eval="True" />
<field name="tax_id" ref="l10n_br_fiscal.tax_icms_antst" />
<field name="state">approved</field>
</record>

<record id="fo_venda_revenda_st_substituido" model="l10n_br_fiscal.operation.line">
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="name">Revenda ST contribuinte substituído</field>
<field name="ind_ie_dest">1</field>
<field name="cfop_internal_id" ref="l10n_br_fiscal.cfop_5405" />
<field name="cfop_external_id" ref="l10n_br_fiscal.cfop_6404" />
<field name="state">approved</field>
<field name="product_type">00</field>
<field
name="product_fiscal_tag_ids"
eval="[(6,0,[ref('l10n_br_fiscal.product_tag_st_6404')])]"
/>
<field name="tax_icms_or_issqn">icms</field>
<field
name="tax_definition_ids"
eval="[(6, 0, [ref('l10n_br_fiscal.tax_icms_regulation_other_state_st')])]"
/>
</record>

<record
id="fo_venda_revenda_st_substituido_sn"
model="l10n_br_fiscal.operation.line"
>
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="name">Revenda ST contribuinte substituído SN</field>
<field name="ind_ie_dest">1</field>
<field name="cfop_internal_id" ref="l10n_br_fiscal.cfop_5405" />
<field name="cfop_external_id" ref="l10n_br_fiscal.cfop_6404" />
<field name="state">approved</field>
<field name="product_type">00</field>
</record>

<record id="fo_venda_venda_nao_contribuinte" model="l10n_br_fiscal.operation.line">
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="name">Venda não Contribuinte</field>
Expand Down
117 changes: 114 additions & 3 deletions l10n_br_fiscal/demo/fiscal_document_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<field name="partner_id" ref="l10n_br_base.res_partner_cliente1_sp" />
<field name="user_id" ref="base.user_demo" />
<field name="fiscal_operation_type">out</field>
<!-- <field name="file_xml_autorizacao_id" ref="dummy_file_1"/> FIXME: Este é um campo related!!!!-->
<!-- <field name="file_xml_autorizacao_id" ref="dummy_file_1"/> FIXME: Este é um campo related!!!!-->
</record>

<record id="demo_nfe_line_same_state_1-1" model="l10n_br_fiscal.document.line">
Expand Down Expand Up @@ -285,7 +285,7 @@
/>
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
<field name="document_serie">1</field>
<field name="partner_id" ref="l10n_br_base.res_partner_cliente9_mg" />
<field name="partner_id" ref="l10n_br_base.res_partner_cliente9_mg" />
<field name="user_id" ref="base.user_demo" />
<field name="fiscal_operation_type">out</field>
</record>
Expand Down Expand Up @@ -385,7 +385,7 @@
/>
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
<field name="document_serie">1</field>
<field name="partner_id" ref="l10n_br_base.res_partner_cliente9_mg" />
<field name="partner_id" ref="l10n_br_base.res_partner_cliente9_mg" />
<field name="user_id" ref="base.user_demo" />
<field name="fiscal_operation_type">out</field>
</record>
Expand Down Expand Up @@ -946,5 +946,116 @@
<value eval="[ref('demo_nfe_purchase_line_same_state_1-1')]" />
</function>

<!-- NFe Test - Empresa Contribuinte - Outro Estado ST - CFOP 6404 . -->
<record id="demo_nfe_other_state_st_6404" model="l10n_br_fiscal.document">
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="document_type_id" ref="l10n_br_fiscal.document_55" />
<field
name="document_serie_id"
ref="l10n_br_fiscal.empresa_lc_document_55_serie_1"
/>
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
<field name="document_serie">1</field>
<field name="partner_id" ref="l10n_br_base.res_partner_cliente5_pe" />
<field name="user_id" ref="base.user_demo" />
<field name="fiscal_operation_type">out</field>
</record>

<record
id="demo_nfe_line_other_state_st_6404_1-1"
model="l10n_br_fiscal.document.line"
>
<field name="document_id" ref="demo_nfe_other_state_st_6404" />
<field name="name">Teste ST</field>
<field name="product_id" ref="l10n_br_fiscal.product_delivery_02_st_6404" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="price_unit">100</field>
<field name="quantity">1</field>
<field name="fiscal_operation_type">out</field>
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="icms_tax_id" ref="l10n_br_fiscal.tax_icms_antst" />
<field
name="fiscal_operation_line_id"
ref="l10n_br_fiscal.fo_venda_revenda_st_substituido"
/>
</record>

<function model="l10n_br_fiscal.document.line" name="_onchange_product_id_fiscal">
<value eval="[ref('demo_nfe_line_other_state_st_6404_1-1')]" />
</function>

<record
id="demo_nfe_line_other_state_st_6404_1-1"
model="l10n_br_fiscal.document.line"
>
<field name="price_unit">100</field>
</record>

<function model="l10n_br_fiscal.document.line" name="_onchange_fiscal_operation_id">
<value eval="[ref('demo_nfe_line_other_state_st_6404_1-1')]" />
</function>

<function
model="l10n_br_fiscal.document.line"
name="_onchange_fiscal_operation_line_id"
>
<value eval="[ref('demo_nfe_line_other_state_st_6404_1-1')]" />
</function>

<!-- NFe Test - Empresa Contribuinte - Outro Estado ST - CFOP 6401 -->
<record id="demo_nfe_other_state_st_6401" model="l10n_br_fiscal.document">
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="document_type_id" ref="l10n_br_fiscal.document_55" />
<field
name="document_serie_id"
ref="l10n_br_fiscal.empresa_lc_document_55_serie_1"
/>
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
<field name="document_serie">1</field>
<field name="partner_id" ref="l10n_br_base.res_partner_cliente5_pe" />
<field name="user_id" ref="base.user_demo" />
<field name="fiscal_operation_type">out</field>
</record>

<record
id="demo_nfe_line_other_state_st_6401_1-1"
model="l10n_br_fiscal.document.line"
>
<field name="document_id" ref="demo_nfe_other_state_st_6401" />
<field name="name">Teste ST</field>
<field name="product_id" ref="l10n_br_fiscal.product_delivery_02_st_6401" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="price_unit">100</field>
<field name="quantity">1</field>
<field name="fiscal_operation_type">out</field>
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="icms_tax_id" ref="l10n_br_fiscal.tax_icms_antst" />
<field
name="fiscal_operation_line_id"
ref="l10n_br_fiscal.fo_venda_revenda_st_substituido"
/>
</record>

<function model="l10n_br_fiscal.document.line" name="_onchange_product_id_fiscal">
<value eval="[ref('demo_nfe_line_other_state_st_6401_1-1')]" />
</function>

<record
id="demo_nfe_line_other_state_st_6401_1-1"
model="l10n_br_fiscal.document.line"
>
<field name="price_unit">100</field>
</record>

<function model="l10n_br_fiscal.document.line" name="_onchange_fiscal_operation_id">
<value eval="[ref('demo_nfe_line_other_state_st_6401_1-1')]" />
</function>

<function
model="l10n_br_fiscal.document.line"
name="_onchange_fiscal_operation_line_id"
>
<value eval="[ref('demo_nfe_line_other_state_st_6401_1-1')]" />
</function>

</odoo>
122 changes: 122 additions & 0 deletions l10n_br_fiscal/demo/product_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1978,4 +1978,126 @@
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
</record>

<!-- Product ST CFOP 6404 -->
<record id="product_delivery_02_st_6404" model="product.product">
<field name="name">Office Lamp ST 6404</field>
<field name="tax_icms_or_issqn">icms</field>
<field name="categ_id" ref="product.product_category_5" />
<field name="standard_price">35.0</field>
<field name="list_price">40.0</field>
<field name="type">consu</field>
<field name="weight">0.01</field>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field name="default_code">FURN_8889</field>
<field
name="operation_line_tag_ids"
eval="[(6,0,[ref('l10n_br_fiscal.product_tag_st_6404')])]"
/>
<field
name="image_1920"
type="base64"
file="product/static/img/product_lamp.png"
/>
<field name="ncm_id" ref="l10n_br_fiscal.ncm_94052000" />
<field name="cest_id" ref="l10n_br_fiscal.cest_2112400" />
<field name="fiscal_genre_id" ref="l10n_br_fiscal.product_genre_94" />
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
</record>
<!-- fiscal_type property for product_delivery_02_st_6404 for lucro presumido company -->
<record
forcecreate="True"
id="fiscal_type_product_delivery_02_st_6404"
model="ir.property"
>
<field name="name">fiscal_type</field>
<field name="fields_id" ref="field_product_template__fiscal_type" />
<field name="value">00</field>
<field name="type">selection</field>
<field
eval="'product.template,'+str(obj().env.ref('l10n_br_fiscal.product_delivery_02_st_6404').product_tmpl_id.id)"
model="product.template"
name="res_id"
/>
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
</record>
<!-- icms_origin property for product_delivery_02_st_6404 for simples nacional company -->
<record
forcecreate="True"
id="icms_origin_product_delivery_02_st_6404"
model="ir.property"
>
<field name="name">icms_origin</field>
<field name="fields_id" ref="field_product_template__icms_origin" />
<field name="value">5</field>
<field name="type">selection</field>
<field
eval="'product.template,'+str(obj().env.ref('l10n_br_fiscal.product_delivery_02_st_6404').product_tmpl_id.id)"
model="product.template"
name="res_id"
/>
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
</record>


<!-- Product ST CFOP 6401 -->
<record id="product_delivery_02_st_6401" model="product.product">
<field name="name">Office Lamp ST 6401</field>
<field name="tax_icms_or_issqn">icms</field>
<field name="categ_id" ref="product.product_category_5" />
<field name="standard_price">35.0</field>
<field name="list_price">40.0</field>
<field name="type">consu</field>
<field name="weight">0.01</field>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field name="default_code">FURN_8880</field>
<field
name="operation_line_tag_ids"
eval="[(6,0,[ref('l10n_br_fiscal.product_tag_st_6401')])]"
/>
<field
name="image_1920"
type="base64"
file="product/static/img/product_lamp.png"
/>
<field name="ncm_id" ref="l10n_br_fiscal.ncm_94052000" />
<field name="cest_id" ref="l10n_br_fiscal.cest_2112400" />
<field name="fiscal_genre_id" ref="l10n_br_fiscal.product_genre_94" />
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
</record>
<!-- fiscal_type property for product_delivery_02_st_6401 for lucro presumido company -->
<record
forcecreate="True"
id="fiscal_type_product_delivery_02_st_6401"
model="ir.property"
>
<field name="name">fiscal_type</field>
<field name="fields_id" ref="field_product_template__fiscal_type" />
<field name="value">04</field>
<field name="type">selection</field>
<field
eval="'product.template,'+str(obj().env.ref('l10n_br_fiscal.product_delivery_02_st_6401').product_tmpl_id.id)"
model="product.template"
name="res_id"
/>
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
</record>
<!-- icms_origin property for product_delivery_02_st_6401 for simples nacional company -->
<record
forcecreate="True"
id="icms_origin_product_delivery_02_st_6401"
model="ir.property"
>
<field name="name">icms_origin</field>
<field name="fields_id" ref="field_product_template__icms_origin" />
<field name="value">5</field>
<field name="type">selection</field>
<field
eval="'product.template,'+str(obj().env.ref('l10n_br_fiscal.product_delivery_02_st_6401').product_tmpl_id.id)"
model="product.template"
name="res_id"
/>
<field name="company_id" ref="l10n_br_base.empresa_lucro_presumido" />
</record>
</odoo>
1 change: 1 addition & 0 deletions l10n_br_fiscal/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from . import ncm
from . import nbm
from . import cest
from . import product_tag
from . import tax_group
from . import tax
from . import tax_pis_cofins
Expand Down
Loading
Loading