<commit_before><?xml version="1.0" encoding="utf-8"?>
<odoo>
      <!--busca por cnpj_cpf e razao social nos pedidos de compra -->
      <record id="l10n_br_purchase_order_filter" model="ir.ui.view">
          <field name="name">l10n_br_purchase.partner.filter</field>
          <field name="model">purchase.order</field>
          <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
          <field name="arch" type="xml">
              <field name="name" position="after">
                  <field name="legal_name" string="Razão Social"/>
                  <field name="cnpj_cpf" string="CNPJ/CPF"/>
                  <field name="ie" string="Inscr. Estadual"/>
              </field>
          </field>
      </record>

      <record id="l10n_br_purchase_order_form1" model="ir.ui.view">
          <field name="name">l10n_br_purchase.order.form1</field>
          <field name="model">purchase.order</field>
          <field name="inherit_id" ref="purchase.purchase_order_form"/>
          <field name="priority">36</field>
          <field name="arch" type="xml">
              <xpath expr="//form/sheet/group" position="after">
                  <group id="l10n_br_fiscal">
                  </group>
              </xpath>
              <xpath expr="//field[@name='order_line']/tree" position="attributes">
                  <attribute name="editable"></attribute>
              </xpath>
              <xpath expr="//field[@name='order_line']/tree/field[@name='taxes_id']" position="replace">
              </xpath>
              <xpath expr="//field[@name='order_line']/tree/field[@name='company_id']" position="replace">
              </xpath>
              <xpath expr="//field[@name='order_line']/form/sheet/group/group/field[@name='taxes_id']" position="before">
                  <field name="operation_id" required="1"/>
                  <field name="operation_line_id" required="1"/>
              </xpath>
          </field>
      </record>

      <record id="l10n_br_purchase_order_line_form" model="ir.ui.view">
          <field name="name">l10n_br_purchase.order.line.form</field>
          <field name="model">purchase.order.line</field>
          <field name="inherit_id" ref="purchase.purchase_order_line_form2"/>
          <field name="arch" type="xml">
            <xpath expr="//form/sheet/group" position="after">
                <group id="l10n_br_fiscal">
                </group><commit_msg>[12.0][MIG][REF] View.<commit_after><?xml version="1.0" encoding="utf-8"?>
<odoo>
      <!--busca por cnpj_cpf e razao social nos pedidos de compra -->
      <record id="l10n_br_purchase_order_filter" model="ir.ui.view">
          <field name="name">l10n_br_purchase.partner.filter</field>
          <field name="model">purchase.order</field>
          <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
          <field name="arch" type="xml">
              <field name="name" position="after">
                  <field name="legal_name" string="Razão Social"/>
                  <field name="cnpj_cpf" string="CNPJ/CPF"/>
                  <field name="ie" string="Inscr. Estadual"/>
              </field>
          </field>
      </record>

      <record id="l10n_br_purchase_order_form1" model="ir.ui.view">
          <field name="name">l10n_br_purchase.order.form1</field>
          <field name="model">purchase.order</field>
          <field name="inherit_id" ref="purchase.purchase_order_form"/>
          <field name="priority">36</field>
          <field name="arch" type="xml">
              <xpath expr="//form/sheet/group" position="after">
                  <group id="l10n_br_fiscal">
                  </group>
              </xpath>
              <xpath expr="//field[@name='invoice_status']" position="after">
                  <field name="operation_id"/>
              </xpath>
              <xpath expr="//field[@name='order_line']/tree" position="attributes">
                  <attribute name="editable"></attribute>
              </xpath>
              <xpath expr="//field[@name='order_line']/tree/field[@name='taxes_id']" position="replace">
              </xpath>
              <xpath expr="//field[@name='order_line']/tree/field[@name='company_id']" position="replace">
              </xpath>
              <xpath expr="//field[@name='order_line']/form/sheet/group/group/field[@name='taxes_id']" position="before">
                  <field name="operation_id" required="1"/>
                  <field name="operation_line_id" required="1"/>
              </xpath>

            <!-- TODO - Make better xpath to don't need redo all tree and form view, if it's possible -->
            <xpath expr="//field[@name='order_line']" position="replace">
                <field name="order_line" attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}">
                    <!-- In brazilian localization we need to always show form view because the user can see and
                     even change taxes fields it's the reason to remove editable="bottom" -->
                     <!-- <tree string="Purchase Order Lines" editable="bottom"> -->
                    <tree string="Purchase Order Lines">
                        <field name="currency_id" invisible="1"/>
                        <field name="state" invisible="1"/>
                        <field name="product_type" invisible="1"/>
                        <field name="invoice_lines" invisible="1"/>
                        <field name="sequence" widget="handle"/>
                        <field name="product_id" attrs="{'readonly': [('state', 'in', ('purchase', 'to approve','done', 'cancel'))]}" context="{'partner_id':parent.partner_id, 'quantity':product_qty,'uom':product_uom, 'company_id': parent.company_id}" force_save="1"/>
                        <field name="name"/>
                        <field name="date_planned"/>
                        <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
                        <field name="account_analytic_id" context="{'default_partner_id':parent.partner_id}" groups="analytic.group_analytic_accounting"/>
                        <field name="analytic_tag_ids" groups="analytic.group_analytic_tags" widget="many2many_tags" options="{'color_field': 'color'}"/>
                        <field name="product_qty"/>
                        <field name="qty_received" attrs="{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))]}"/>
                        <field name="qty_invoiced" attrs="{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))]}"/>
                        <field name="product_uom" groups="uom.group_uom" attrs="{'readonly': [('state', 'in', ('purchase', 'done', 'cancel'))]}" force_save="1"/>
                        <field name="price_unit" attrs="{'readonly': [('invoice_lines', '!=', [])]}"/>
                        <field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use','=','purchase')]" context="{'default_type_tax_use': 'purchase', 'search_view_ref': 'account.account_tax_view_search'}" options="{'no_create': True}"/>
                        <field name="price_subtotal" widget="monetary"/>
                    </tree>

                    <form string="Purchase Order Line">
                        <sheet>
                            <field name="state" invisible="1"/>
                            <group>
                                <group>
                                    <field name="product_id"
                                           context="{'partner_id': parent.partner_id}"/>
                                    <label for="product_qty"/>
                                    <div>
                                        <field name="product_qty" class="oe_inline"/>
                                        <span class="oe_inline">&#160;</span>
                                        <field name="product_uom" groups="uom.group_uom" class="oe_inline"/>
                                    </div>
                                    <field name="price_unit"/>
                                </group>
                                <group>
                                    <field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use', '=', 'purchase')]" options="{'no_create': True}"/>
                                    <field name="date_planned" widget="date"/>
                                    <field name="account_analytic_id" colspan="2" groups="analytic.group_analytic_accounting"/>
                                    <field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags" options="{'color_field': 'color'}"/>
                                    <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
                                </group>
                            </group>


                            <group name="l10n_br_fiscal" string="Operation">
                                <field name="fiscal_tax_ids" force_save="1" invisible="1" readonly="1"/>
                                <field name="operation_type" invisible="1" readonly="1"/>
                                <field name="operation_id" required="1"/>
                                <field name="operation_line_id" required="1"/>
                                <field name="cfop_id"/>
                                <field name="cfop_destination" invisible="1"/>
                                <field name="fiscal_genre_code" invisible="1"/>
                                <field name="tax_framework" invisible="1"/>
                                <field name="partner_company_type" invisible="1"/>
                            </group>
                            <notebook>
                                <page name="taxes" string="Taxes">
                                    <notebook>
                                      <page name="issqn" string="ISSQN" attrs="{'invisible': [('fiscal_genre_code', '!=', '00')]}">
                                        <group>
                                          <field name="issqn_tax_id"/>
                                        </group>
                                        <group>
                                            <group>
                                              <field name="issqn_base" force_save="1" attrs="{'readonly': [('issqn_tax_id', '!=', False)]}"/>
                                              <field name="issqn_percent" force_save="1" attrs="{'readonly': [('issqn_tax_id', '!=', False)]}"/>
                                            </group>
                                            <group>
                                              <field name="issqn_reduction" force_save="1" attrs="{'readonly': [('issqn_tax_id', '!=', False)]}"/>
                                              <field name="issqn_value" force_save="1" attrs="{'readonly': [('issqn_tax_id', '!=', False)]}"/>
                                            </group>
                                        </group>
                                      </page>
                                      <page name="icms" string="ICMS" attrs="{'invisible': [('fiscal_genre_code', '=', '00')]}">
                                          <group name="icms" string="ICMS">
                                              <field name="icms_tax_id" attrs="{'invisible': [('tax_framework', 'in', ('1', '2'))]}"/>
                                              <field name="icmssn_tax_id" attrs="{'invisible': [('tax_framework', '=', '3')]}"/>
                                              <field name="icms_cst_id" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)]}"/>
                                              <field name="icms_cst_code" readonly="1" invisible="1"/>
                                              <field name="icms_origin" force_save="1" attrs="{'readonly': ['|', ('icmssn_tax_id', '!=', False), ('icmssn_tax_id', '!=', False)]}"/>
                                          </group>
                                          <group>
                                              <group>
                                                <field name="icmssn_range_id" force_save="1" readonly="1" attrs="{'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icms_base_type" force_save="1" attrs="{'readonly': ['|', ('icms_tax_id', '=', False), ('icmssn_tax_id', '=', False)]}"/>
                                                <field name="icmssn_base" force_save="1" attrs="{'readonly': [('icmssn_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icmssn_reduction" force_save="1" attrs="{'readonly': [('icmssn_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icms_base" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', 'in', ('1', '2'))]}"/>
                                                <field name="icms_percent" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', 'in', ('1', '2'))]}"/>
                                              </group>
                                              <group>
                                                <field name="icmssn_percent" force_save="1" attrs="{'readonly': [('icmssn_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icmssn_credit_value" force_save="1" attrs="{'readonly': [('icmssn_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icms_reduction" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', 'in', ('1', '2'))]}"/>
                                                <field name="icms_value" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', 'in', ('1', '2'))]}"/>
                                                <field name="icms_relief_id" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', 'in', ('1', '2')), ('icms_cst_code', 'not in', ('20', '30', '40', '41', '50', '70', '90'))]}"/>
                                                <field name="icms_relief_value" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', 'in', ('1', '2')), ('icms_cst_code', 'not in', ('20', '30', '70', '90'))]}"/>
                                              </group>
                                          </group>
                                          <group>
                                              <group name="icmsst" string="ICMS ST" attrs="{'invisible': [('icms_cst_code', 'not in', ('10', '30', '70', '90', '201', '202', '203', '500'))]}">
                                                <field name="icmsst_tax_id"/>
                                                <field name="icmsst_base_type" force_save="1" attrs="{'readonly': [('icmssn_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icmsst_mva_percent" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)]}"/>
                                                <field name="icmsst_percent" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)]}"/>
                                                <field name="icmsst_reduction" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)]}"/>
                                                <field name="icmsst_base" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)]}"/>
                                                <field name="icmsst_value" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)]}"/>
                                                <field name="icmsst_wh_base" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('icms_cst_code', 'not in', ('60', '500'))]}"/>
                                                <field name="icmsst_wh_value" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('icms_cst_code', 'not in', ('60', '500'))]}"/>
                                              </group>
                                              <group name="icms_difal" string="ICMS DIFAL" attrs="{'invisible': [('partner_company_type', 'in', ('company', False)), ('cfop_destination', 'in', ('1', '3', False))]}">
                                                <field name="icms_destination_base" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icms_origin_percent" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icms_destination_percent" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icms_sharing_percent" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icms_origin_value" force_save="1" attrs="{'readonly': [('icms_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icmsfcp_tax_id"/>
                                                <field name="icmsfcp_percent" force_save="1" attrs="{'readonly': [('icmsfcp_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                                <field name="icmsfcp_value" force_save="1" attrs="{'readonly': [('icmsfcp_tax_id', '!=', False)], 'invisible': [('tax_framework', '=', '3')]}"/>
                                              </group>
                                          </group>
                                      </page>
                                      <page name="ipi" string="IPI">
                                          <group string="IPI">
                                              <field name="ipi_tax_id"/>
                                              <field name="ipi_cst_id" force_save="1" attrs="{'readonly': [('ipi_tax_id', '!=', False)]}"/>
                                              <field name="ipi_cst_code" readonly="1" invisible="1"/>
                                              <field name="ipi_guideline_id" force_save="1" attrs="{'readonly': [('ipi_tax_id', '!=', False)]}"/>
                                          </group>
                                          <group>
                                              <group>
                                                <field name="ipi_base_type" force_save="1" attrs="{'readonly': [('ipi_tax_id', '!=', False)]}"/>
                                                <field name="ipi_percent" force_save="1" attrs="{'readonly': [('ipi_tax_id', '!=', False)]}"/>
                                                <field name="ipi_reduction" force_save="1" attrs="{'readonly': [('ipi_tax_id', '!=', False)]}"/>
                                              </group>
                                              <group>
                                                <field name="ipi_base" force_save="1" attrs="{'readonly': [('ipi_tax_id', '!=', False)]}"/>
                                                <field name="ipi_value" force_save="1" attrs="{'readonly': [('ipi_tax_id', '!=', False)]}"/>
                                              </group>
                                          </group>
                                      </page>
                                      <page name="ii" string="II" attrs="{'invisible': [('cfop_destination', '!=', '3')]}">
                                        <group string="II">
                                            <field name="ii_tax_id"/>
                                        </group>
                                        <group>
                                          <group>
                                            <field name="ii_base"/>
                                            <field name="ii_value"/>
                                          </group>
                                          <group>
                                            <field name="ii_iof_value"/>
                                            <field name="ii_customhouse_charges"/>
                                          </group>
                                        </group>
                                      </page>
                                      <page name="pis" string="PIS">
                                          <group name="pis" string="PIS">
                                            <field name="pis_tax_id"/>
                                            <field name="pis_cst_id" force_save="1" attrs="{'readonly': [('pis_tax_id', '!=', False)]}"/>
                                            <field name="pis_cst_code" readonly="1" invisible="1"/>
                                            <field name="pis_credit_id" force_save="1" attrs="{'readonly': [('pis_tax_id', '!=', False)], 'invisible': [('operation_type', '=', 'out')]}"/>
                                          </group>
                                          <group>
                                            <group>
                                              <field name="pis_base_id" force_save="1" attrs="{'readonly': [('pis_tax_id', '!=', False)], 'invisible': [('operation_type', '=', 'out')]}"/>
                                              <field name="pis_base_type" force_save="1" attrs="{'readonly': [('pis_tax_id', '!=', False)]}"/>
                                              <field name="pis_percent" force_save="1" attrs="{'readonly': [('pis_tax_id', '!=', False)]}"/>
                                              <field name="pis_reduction" force_save="1" attrs="{'readonly': [('pis_tax_id', '!=', False)]}"/>
                                            </group>
                                            <group>
                                              <field name="pis_base" force_save="1" attrs="{'readonly': [('pis_tax_id', '!=', False)]}"/>
                                              <field name="pis_value" force_save="1" attrs="{'readonly': [('pis_tax_id', '!=', False)]}"/>
                                            </group>
                                          </group>
                                          <group name="pis_st" string="PIS ST">
                                            <field name="pisst_tax_id"/>
                                            <field name="pisst_cst_id" force_save="1" attrs="{'readonly': [('pisst_tax_id', '!=', False)]}"/>
                                            <field name="pisst_cst_code" readonly="1" invisible="1"/>
                                          </group>
                                          <group>
                                            <group>
                                              <field name="pisst_base_type" force_save="1" attrs="{'readonly': [('pisst_tax_id', '!=', False)]}"/>
                                              <field name="pisst_percent" force_save="1" attrs="{'readonly': [('pisst_tax_id', '!=', False)]}"/>
                                              <field name="pisst_reduction" force_save="1" attrs="{'readonly': [('pisst_tax_id', '!=', False)]}"/>
                                            </group>
                                            <group>
                                              <field name="pisst_base" force_save="1" attrs="{'readonly': [('pisst_tax_id', '!=', False)]}"/>
                                              <field name="pisst_value" force_save="1" attrs="{'readonly': [('pisst_tax_id', '!=', False)]}"/>
                                            </group>
                                          </group>
                                      </page>
                                      <page name="cofins" string="COFINS">
                                        <group name="cofins" string="COFINS">
                                          <field name="cofins_tax_id"/>
                                          <field name="cofins_cst_id" force_save="1" attrs="{'readonly': [('cofins_tax_id', '!=', False)]}"/>
                                          <field name="cofins_cst_code" readonly="1" invisible="1"/>
                                          <field name="cofins_credit_id" force_save="1" attrs="{'readonly': [('cofins_tax_id', '!=', False)], 'invisible': [('operation_type', '=', 'out')]}"/>
                                        </group>
                                        <group>
                                          <group>
                                            <field name="cofins_base_id" force_save="1" attrs="{'readonly': [('cofins_tax_id', '!=', False)], 'invisible': [('operation_type', '=', 'out')]}"/>
                                            <field name="cofins_base_type" force_save="1" attrs="{'readonly': [('cofins_tax_id', '!=', False)]}"/>
                                            <field name="cofins_percent" force_save="1" attrs="{'readonly': [('cofins_tax_id', '!=', False)]}"/>
                                            <field name="cofins_reduction" force_save="1" attrs="{'readonly': [('cofins_tax_id', '!=', False)]}"/>
                                          </group>
                                          <group>
                                            <field name="cofins_base" force_save="1" attrs="{'readonly': [('cofins_tax_id', '!=', False)]}"/>
                                            <field name="cofins_value" force_save="1" attrs="{'readonly': [('cofins_tax_id', '!=', False)]}"/>
                                          </group>
                                        </group>
                                        <group name="cofins_st" string="COFINS ST">
                                          <field name="cofinsst_tax_id"/>
                                          <field name="cofinsst_cst_id" force_save="1" attrs="{'readonly': [('cofinsst_tax_id', '!=', False)]}"/>
                                          <field name="cofinsst_cst_code" readonly="1" invisible="1"/>
                                        </group>
                                        <group>
                                          <group>
                                            <field name="cofinsst_base_type" force_save="1" attrs="{'readonly': [('cofinsst_tax_id', '!=', False)]}"/>
                                            <field name="cofinsst_percent" force_save="1" attrs="{'readonly': [('cofinsst_tax_id', '!=', False)]}"/>
                                            <field name="cofinsst_reduction" force_save="1" attrs="{'readonly': [('cofinsst_tax_id', '!=', False)]}"/>
                                          </group>
                                          <group>
                                            <field name="cofinsst_base" force_save="1" attrs="{'readonly': [('cofinsst_tax_id', '!=', False)]}"/>
                                            <field name="cofinsst_value" force_save="1" attrs="{'readonly': [('cofinsst_tax_id', '!=', False)]}"/>
                                          </group>
                                        </group>
                                      </page>
                                    </notebook>
                                    <notebook>
                                        <page string="Notes">
                                            <field name="name"/>
                                        </page>
                                        <page string="Invoices and Incoming Shipments">
                                            <field name="invoice_lines"/>
                                        </page>
                                        <page name="outros" string="Outros Custos">
                                            <group>
                                                <field name="insurance_value"/>
                                                <field name="other_costs_value"/>
                                                <field name="freight_value"/>
                                            </group>
                                        </page>
                                    </notebook>
                                  </page>
                            </notebook>
                        </sheet>
                    </form>
                </field>
            </xpath>

          </field>
      </record>

      <record id="l10n_br_purchase_order_line_form" model="ir.ui.view">
          <field name="name">l10n_br_purchase.order.line.form</field>
          <field name="model">purchase.order.line</field>
          <field name="inherit_id" ref="purchase.purchase_order_line_form2"/>
          <field name="arch" type="xml">
            <xpath expr="//form/sheet/group" position="after">
                <group id="l10n_br_fiscal">
                </group>
{'fraction_non_alphanumeric': 0.1632108604619749, 'fraction_numerical': 0.008476293394569769, 'mean_word_length': 1.279501193133708, 'pattern_counts': {'":': 0, '<': 370, '<?xml version=': 2, '>': 370, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 354, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5437518', 'n_tokens_mistral': 7434, 'n_tokens_neox': 7238, 'n_words': 1241}