Trust-Code/odoo-brasil

View on GitHub
br_account/views/account_fiscal_position_view.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="br_account_tax_rule_form" model="ir.ui.view">
        <field name="name">br_account.tax.rule.form</field>
        <field name="model">account.fiscal.position.tax.rule</field>
        <field name="arch" type="xml">
            <form>
                <group>
                    <field name="name" />
                    <field name="fiscal_position_id" invisible="1" />
                    <field name="domain" invisible="1" />
                </group>
                <group string="Usar a seguinte tributação">
                    <group>
                        <field name="tax_id" domain="[('domain', '=', domain)]" />
                    </group>
                    <group>
                        <field name="cst_icms" attrs="{'invisible': [('domain', '!=', 'icms')]}" />
                        <field name="csosn_icms" attrs="{'invisible': [('domain', '!=', 'simples')]}" />
                        <field name="cst_ipi" attrs="{'invisible': [('domain', '!=', 'ipi')]}" />
                        <field name="cst_pis" attrs="{'invisible': [('domain', '!=', 'pis')]}" />
                        <field name="cst_cofins" attrs="{'invisible': [('domain', '!=', 'cofins')]}" />
                    </group>
                </group>
                <group name="icms" attrs="{'invisible': [('domain', 'not in', ('icms', 'simples'))]}">
                    <group>
                        <field name="cfop_id" />
                        <field name="tax_icms_st_id" attrs="{'invisible': [('cst_icms', 'not in', ('10', '30', '70', '90')), ('csosn_icms', 'not in', ('201', '202', '203', '900'))]}" />
                        <field name="reducao_icms_st" attrs="{'invisible': [('cst_icms', 'not in', ('10', '30', '70', '90')), ('csosn_icms', 'not in', ('201', '202', '203', '900'))]}" />
                        <field name="tem_difal" />
                        <field name="tax_icms_intra_id" attrs="{'invisible': ['|', ('tem_difal', '=', False), ('domain', '=', 'simples')]}" />
                    </group>
                    <group>
                        <field name="incluir_ipi_base" attrs="{'invisible': [('domain', '=', 'simples')]}" />
                        <field name="icms_aliquota_credito" attrs="{'invisible': [('domain', '!=', 'simples')]}" />
                        <field name="reducao_icms" attrs="{'invisible': [('cst_icms', 'not in', ('20', '70', '90'))]}" />
                        <field name="aliquota_mva" attrs="{'invisible': [('cst_icms', 'not in', ('10', '30', '70', '90')), ('csosn_icms', 'not in', ('201', '202', '203', '900'))]}" />
                        <field name="icms_st_aliquota_deducao" attrs="{'invisible': [('cst_icms', 'not in', ('10', '30', '70', '90')), ('csosn_icms', 'not in', ('201', '202', '203', '900'))]}" />
                        <field name="tax_icms_inter_id" attrs="{'invisible': [('tem_difal', '=', False)]}" />
                        <field name="tax_icms_fcp_id" attrs="{'invisible': ['|', ('tem_difal', '=', False), ('domain', '=', 'simples')]}" />
                    </group>
                </group>
                <group name="ipi" attrs="{'invisible': [('domain', '!=', 'ipi')]}">
                    <group>
                        <field name="reducao_ipi" />
                    </group>
                    <group></group>
                </group>
                <group string="Aplicar esta regra quando:">
                    <field name="tipo_produto" />
                </group>
                <group string="Estados">
                    <field name="state_ids" widget="many2many_tags" nolabel="1"/>
                </group>
                <group string="Categorias Fiscais">
                    <field name="fiscal_category_ids" widget="many2many_tags" nolabel="1"/>
                </group>
                <group string="Classificação Fiscal">
                    <field name="product_fiscal_classification_ids" widget="many2many_tags" nolabel="1"/>
                </group>
                <group string="Categorias de Produto">
                    <field name="product_category_ids" widget="many2many_tags" nolabel="1"/>
                </group>
                <group string="Produtos">
                    <field name="product_ids" widget="many2many_tags" nolabel="1"/>
                </group>
                <group string="Parceiros">
                    <field name="partner_ids" widget="many2many_tags" nolabel="1"/>
                </group>
            </form>
        </field>
    </record>
    <record id="view_br_account_tax_rule_formtree" model="ir.ui.view">
        <field name="name">view.br_account.tax.rule.tree</field>
        <field name="model">account.fiscal.position.tax.rule</field>
        <field name="arch" type="xml">
            <tree>
                <field name="sequence" widget="handle"/>
                <field name="name" />
                <field name="tax_id" />
            </tree>
        </field>
    </record>
    <record id="br_account_position_form" model="ir.ui.view">
        <field name="name">br_account.fiscal.position.form</field>
        <field name="model">account.fiscal.position</field>
        <field name="inherit_id" ref="account.view_account_position_form"/>
        <field name="arch" type="xml">
            <field name="auto_apply" position="after">
                <field name="fiscal_type"></field>
            </field>
            <xpath expr="//page[@name='account_mapping']/group" position="before">
                <group>
                    <field name="journal_id" placeholder="Este diário vai ser usado no faturamento" />
                    <field name="account_id" placeholder="Esta conta vai ser usada para faturamento" />
                </group>
            </xpath>
            <xpath expr="//page[@name='account_mapping']" position="after">
                <page name="notes" string="Observações Fiscais">
                    <group string="Observações">
                        <field name="fiscal_observation_ids" nolabel="1" />
                    </group>
                </page>
                <page name="other_information" string="Outras Informações"></page>
            </xpath>
            <field name="vat_required" position="attributes">
                <attribute name="invisible">1</attribute>
            </field>
            <field name="zip_from" position="attributes">
                <attribute name="invisible">1</attribute>
            </field>
            <field name="zip_to" position="attributes">
                <attribute name="invisible">1</attribute>
            </field>
            <xpath expr="//group/group/div" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>
            <xpath expr="//group/group/label" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>
            <page name="tax_mapping" position="attributes">
                <attribute name="invisible">1</attribute>
            </page>
            <page name="tax_mapping" position="before">
                <page string="Regras de Impostos">
                    <group name="icms_rules" string="Regras de ICMS">
                        <field nolabel="1" name="icms_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'icms'}">
                            <tree>
                                <field name="sequence" widget="handle"/>
                                <field name="name" />
                                <field name="tax_id" />
                                <field name="cfop_id" />
                                <field name="cst_icms" />
                                <field name="reducao_icms" />
                                <field name="tax_icms_st_id" />
                                <field name="reducao_icms_st" />
                                <field name="aliquota_mva" />
                            </tree>
                        </field>
                    </group>
                    <group name="simples_rules" string="Regras Simples Nacional">
                        <field nolabel="1" name="simples_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'simples'}">
                            <tree>
                                <field name="sequence" widget="handle"/>
                                <field name="name" />
                                <field name="tax_id" />
                                <field name="cfop_id" />
                                <field name="csosn_icms" />
                                <field name="icms_aliquota_credito" />
                                <field name="tem_difal" />
                                <field name="tax_icms_inter_id" />
                            </tree>
                        </field>
                    </group>
                    <group name="ipi_rules" string="Regras de IPI">
                        <field nolabel="1" name="ipi_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'ipi'}">
                            <tree>
                                <field name="sequence" widget="handle"/>
                                <field name="name" />
                                <field name="tax_id" />
                                <field name="cst_ipi" />
                                <field name="reducao_ipi" />
                            </tree>
                        </field>
                    </group>
                    <group name="pis_rules" string="Regras de PIS">
                        <field nolabel="1" name="pis_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'pis'}">
                            <tree>
                                <field name="sequence" widget="handle"/>
                                <field name="name" />
                                <field name="tax_id" />
                                <field name="cst_pis" />
                            </tree>
                        </field>
                    </group>
                    <group name="cofins_rules" string="Regras de COFINS">
                        <field nolabel="1" name="cofins_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'cofins'}">
                            <tree>
                                <field name="sequence" widget="handle"/>
                                <field name="name" />
                                <field name="tax_id" />
                                <field name="cst_cofins" />
                            </tree>
                        </field>
                    </group>
                    <group name="issqn_rules" string="Regras ISSQN">
                        <field nolabel="1" name="issqn_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'issqn'}"/>
                    </group>
                    <group name="irrf_rules" string="Regras de IRRF">
                        <field nolabel="1" name="irrf_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'irrf'}" />
                    </group>
                    <group name="inss_rules" string="Regras de INSS">
                        <field nolabel="1" name="inss_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'inss'}" />
                    </group>
                    <group name="csll_rules" string="Regras de CSLL">
                        <field nolabel="1" name="csll_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'csll'}" />
                    </group>
                    <group name="ii_rules" string="Regras de II">
                        <field nolabel="1" name="ii_tax_rule_ids" context="{'default_fiscal_position_id': id, 'default_domain': 'ii'}" />
                    </group>
                </page>
            </page>
        </field>
    </record>
</odoo>