<commit_before><?xml version="1.0" encoding="utf-8"?>
<!-- © 2016 Comunitea
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>
    <record id="view_stock_graph" model="ir.ui.view">
        <field name="name">stock.inventory.graph</field>
        <field name="model">stock.inventory.line</field>
        <field name="arch" type="xml">
            <graph string="Stock Analysis" type="bar" interval="day">
                <field name="product_id" type="row"/>
                <field name="product_qty" type="measure"/>
            </graph>
        </field>
    </record>
    <record id="stock_inventory_line_search" model="ir.ui.view">
        <field name="name">stock.inventory.line.search</field>
        <field name="model">stock.inventory.line</field>
        <field name="inherit_id" ref="stock.stock_inventory_line_search"/>
        <field name="arch" type="xml">
            <field name="partner_id" position="after">
                <filter string="Day" domain="[]" context="{'group_by': 'create_date:day'}" />
                <filter string="Month" domain="[]" context="{'group_by': 'create_date:month'}" />
                <filter string="Year" domain="[]" context="{'group_by': 'create_date:year'}" />
                <filter name="last_60_days" string="Last 60 days" domain="[('create_date', '&gt;=', ((context_today()-datetime.timedelta(days=60)).strftime('%Y-%m-%d')))]"/>
            </field>
        </field>
    </record>

    <record id="product_graphic_stock_grouped" model="ir.actions.act_window">
        <field name="name">Stock Graphic</field>
        <field name="res_model">stock.inventory.line</field>
        <field name="view_mode">graph</field>
        <field name="view_id" ref="view_stock_graph"/>
        <field name="search_view" ref="stock_inventory_line_search"/>
        <field name="context">{'search_default_last_60_days': 1}</field>
    </record>

    <record id="product_form_view_move_button" model="ir.ui.view">
        <field name="name">product.product.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_normal_form_view"/>
        <field name="arch" type="xml">
            <xpath expr="//div[@name='button_box']" position="inside">
                <button class="oe_inline oe_stat_button" name="action_view_moves"
                    string="Stock moves" type="object" icon="fa-cubes" attrs="{'invisible':[('type', '=', 'service')]}"/>
                <button class="oe_inline oe_stat_button" name="action_view_moves_dates"
                    string="Stock moves dates" type="object" icon="fa-calendar" attrs="{'invisible':[('type', '=', 'service')]}" />
                <button class="oe_inline oe_stat_button" type="action" name="%(product_graphic_stock_grouped)d"
                    string="Stock Graphic"
                    icon="fa-bar-chart"
                    context="{'search_default_product_id': active_id, 'group_by':'create_date:day'}"
                    attrs="{'invisible': [('type', '=', 'service')]}"/>
                <button string="Product Moves"
                            type="object"
                            name= "action_view_stock_move_lines"
                            attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
                            class="oe_stat_button" icon="fa-arrows-v"
                            groups="stock_custom.group_comercial_ext"/>
            </xpath>
        </field>
    </record>

    <record id="view_template_property_form_add_new_tracking" model="ir.ui.view">
        <field name="name">product.template.stock.property.form.add_new_tracking</field>
        <field name="model">product.template</field>
        <field name="inherit_id" ref="stock.view_template_property_form"/>
        <field name="arch" type="xml">
            <field name="tracking" position="before">
                <field name="track_serial" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}"/>
            </field>
        </field>
    </record>

    <record id="view_stock_product_tree" model="ir.ui.view">
        <field name="name">product.stock.tree.inherit</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_product_tree_view"/>
        <field name="arch" type="xml">
            <field name="price" position="after">
                <field name="virtual_stock_conservative"/>
                <field name="incoming_qty"/>
                <field name="qty_in_production"/>
                <field name="joking_index"/>
            </field>
            <field name="barcode" position="after">
                <field name="categ_id"/>
            </field>
        </field>
    </record>

    <record id="product_add_visiotech_reference" model="ir.ui.view">
        <field name="name">product.product.form.add_visiotech_reference</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product_stock_unsafety.product_add_joking_index"/>
        <field name="arch" type="xml">
            <field name="joking_index" position="before">
                <field name="ref_visiotech"/>
            </field>
        </field>
    </record>

    <record id="product_add_tags_search" model="ir.ui.view">
        <field name="name">product.add.tags.search</field>
        <field name="model">product.product</field>
        <field name="priority">16</field>
        <field name="inherit_id" ref="product.product_search_form_view"/>
        <field name="arch" type="xml">
            <field name="name" position="attributes">
                <attribute name="filter_domain">['|', '|', '|', ('default_code', 'ilike', self), ('name','ilike',self),
                                                                ('ref_manufacturer','ilike',self), ('ref_visiotech','ilike',self)]</attribute>
            </field>
            <field name="name" position="after">
                <field name="tag_ids" string="Tag"/>
                <field name="seller_id" string="Main Supplier"/>
            </field>
            <field name="categ_id" position="attributes">
                <attribute name="filter_domain"></attribute>
            </field>
            <filter name="services" position="after">
                <filter string="Main supplier not contains outlet" name="main_supplier_outlet" domain="[('seller_id.name','not ilike','outlet')]"/>
                <filter string="New Category" name="categ_new" domain="[('categ_id.name','like','NUEVOS')]"/>
                <filter string="One month ago" name="one_month_ago" domain="[('date_first_incoming','>=',(datetime.datetime.now() - datetime.timedelta(days=31)).strftime('%Y-%m-%d'))]"/>
            </filter>
        </field>
    </record>

    <record id="action_product_stock_new" model="ir.actions.server">
        <field name="name">Stock New</field>
        <field name="type">ir.actions.server</field>
        <field name="model_id" ref="product.model_product_product"/>
        <field name="binding_model_id" ref="product.model_product_product"/>
        <field name="state">code</field>
        <field name="code">
            action = env["product.product"].get_stock_new()
        </field>
    </record>

    <menuitem id="menu_products_stock_new" action="action_product_stock_new"
        parent="sale.product_menu_catalog" groups="base.group_no_one" sequence="2"/>

    <record id="product_product_date_first_incoming_form_iew" model="ir.ui.view">
        <field name="name">product.product.date.first.incoming.purchase.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_normal_form_view"/>
        <field name="arch" type="xml">
            <field name="last_purchase_date" position="after">
                <field name="date_first_incoming"/>
            </field>
        </field>
    </record>

    <record id="product_product_last_purchase_info_form_view" model="ir.ui.view">
        <field name="name">product.product.last.purchase.info.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="purchase_last_price_info.product_product_last_purchase_info_form_view" />
        <field name="arch" type="xml">
            <field name="last_supplier_id" position="after">
                <field name="currency_purchase_id" invisible="1"/>
            </field>
        </field>
    </record>

    <record id="product_date_first_incoming_tree" model="ir.ui.view">
        <field name="name">product.date.first.incoming</field>
        <field name="model">product.product</field>
        <field name="arch" type="xml">
            <tree string="First incoming date" default_order='date_first_incoming asc' decoration-bf="date_first_incoming_reliability =='1.received'">
                <field name="default_code"/>
                <field name="date_first_incoming"/>
                <field name="date_first_incoming_reliability"/>
            </tree>
        </field>
    </record>

    <record id="product_date_first_incoming_action" model="ir.actions.act_window">
        <field name="name">First incoming date</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.product</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="product.product_search_form_view"/>
        <field name="view_id" ref="product_date_first_incoming_tree"/>
        <field name="domain">[('date_first_incoming','!=',False),('discontinued','=',False)]</field>
        <field name="context">{'search_default_one_month_ago':1}</field>
    </record>

    <menuitem id="first_incoming_date_menu" name="First incoming date" string="First incoming date"
              action="product_date_first_incoming_action"
              parent="purchase.menu_purchase_control" sequence="7"/>

    <record id="product_stock_catalog_update" model="ir.ui.view">
        <field name="name">product.stock.catalog.update</field>
        <field name="model">product.product</field>
        <field name="arch" type="xml">
            <tree>
                <field name="id"/>
                <field name="seller_id"/>
                <field name="code"/>
                <field name="qty_in_production"/>
                <field name="incoming_qty"/>
                <field name="qty_available_wo_wh"/>
                <field name="qty_available"/>
                <field name="virtual_stock_conservative"/>
                <field name="last_sixty_days_sales"/>
                <field name="biggest_sale_qty"/>
                <field name="remaining_days_sale"/>
                <field name="qty_available_input_loc"/>
                <field name="average_margin"/>
                <field name="standard_price"/>
                <field name="last_purchase_price"/>
                <field name="last_purchase_date"/>
                <field name="replacement_id"/>
                <field name="state"/>
            </tree>
        </field>
    </record>
    <record id="product_stock_catalog_update_action" model="ir.actions.act_window">
        <field name="name">Stock catalog Update</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.product</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="product_add_tags_search"/>
        <field name="view_id" ref="product_stock_catalog_update"/>
        <field name="domain">[('custom', '=', False),('type', '!=', 'service')]</field>
        <field name="context">{'search_default_main_supplier_outlet':1}</field>
    </record>

    <menuitem id="product_stock_catalog_update_menu" name="product_stock_catalog_update_menu" string="Stock catalog Update"
              action="product_stock_catalog_update_action"
              parent="purchase.menu_procurement_management" sequence="100"/>


    <record id="action_product_toxic_stock" model="ir.actions.act_window">
        <field name="name">Toxic Stock</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.product</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="product.product_search_form_view"/>
        <field name="view_id" ref="product.product_product_tree_view"/>
        <field name="domain">[('sale_ok', '=', True),('tag_ids', 'ilike', 'Toxic'),('qty_available', '>', 0)]</field>
    </record>

     <menuitem id="menu_products_toxic_stock" action="action_product_toxic_stock"
        parent="sale.product_menu_catalog"  sequence="2"/>

    <record id="product_product_last_purchase_info_form_view" model="ir.ui.view">
        <field name="name">product.product.last.purchase.info.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="purchase_last_price_info.product_product_last_purchase_info_form_view" />
        <field name="groups_id" eval="[(6, 0, [ref('commercial_group') ])]"/>
        <field name="arch" type="xml">
            <xpath expr="//button[@name='%(stock.action_view_change_product_quantity)d']" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>
        </field>
    </record>

    <record id="product_template_observations_note" model="ir.ui.view">
        <field name="name">product.template.common.observations.form</field>
        <field name="model">product.template</field>
        <field name="inherit_id" ref="product.product_template_form_view" />
        <field name="arch" type="xml">
            <xpath expr="//group[@name='description_internal']" position="after">
                <group name="observations_notes">
                    <group string="Observations">
                        <field name="observations" nolabel="1" placeholder="This note is for product observations."/>
                    </group>
                </group>
            </xpath>
        </field>
    </record>
</odoo>
<commit_msg>[IMP]stock_custom: reorganizacion de botones de productos<commit_after><?xml version="1.0" encoding="utf-8"?>
<!-- © 2016 Comunitea
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>
    <record id="view_stock_graph" model="ir.ui.view">
        <field name="name">stock.inventory.graph</field>
        <field name="model">stock.inventory.line</field>
        <field name="arch" type="xml">
            <graph string="Stock Analysis" type="bar" interval="day">
                <field name="product_id" type="row"/>
                <field name="product_qty" type="measure"/>
            </graph>
        </field>
    </record>
    <record id="stock_inventory_line_search" model="ir.ui.view">
        <field name="name">stock.inventory.line.search</field>
        <field name="model">stock.inventory.line</field>
        <field name="inherit_id" ref="stock.stock_inventory_line_search"/>
        <field name="arch" type="xml">
            <field name="partner_id" position="after">
                <filter string="Day" domain="[]" context="{'group_by': 'create_date:day'}" />
                <filter string="Month" domain="[]" context="{'group_by': 'create_date:month'}" />
                <filter string="Year" domain="[]" context="{'group_by': 'create_date:year'}" />
                <filter name="last_60_days" string="Last 60 days" domain="[('create_date', '&gt;=', ((context_today()-datetime.timedelta(days=60)).strftime('%Y-%m-%d')))]"/>
            </field>
        </field>
    </record>

    <record id="product_graphic_stock_grouped" model="ir.actions.act_window">
        <field name="name">Stock Graphic</field>
        <field name="res_model">stock.inventory.line</field>
        <field name="view_mode">graph</field>
        <field name="view_id" ref="view_stock_graph"/>
        <field name="search_view" ref="stock_inventory_line_search"/>
        <field name="context">{'search_default_last_60_days': 1}</field>
    </record>

    <record id="product_form_view_move_button" model="ir.ui.view">
        <field name="name">product.product.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="stock.product_form_view_procurement_button"/>
        <field name="arch" type="xml">
            <xpath expr="//button[@name='%(stock.action_stock_level_forecast_report_product)d']" position="before">
                <button class="oe_inline oe_stat_button" name="action_view_moves"
                    string="Stock moves" type="object" icon="fa-cubes" attrs="{'invisible':[('type', '=', 'service')]}"/>
                <button class="oe_inline oe_stat_button" name="action_view_moves_dates"
                    string="Stock moves dates" type="object" icon="fa-calendar" attrs="{'invisible':[('type', '=', 'service')]}" />
                <button class="oe_inline oe_stat_button" type="action" name="%(product_graphic_stock_grouped)d"
                    string="Stock Graphic"
                    icon="fa-bar-chart"
                    context="{'search_default_product_id': active_id, 'group_by':'create_date:day'}"
                    attrs="{'invisible': [('type', '=', 'service')]}"/>
                <button string="Product Moves"
                            type="object"
                            name= "action_view_stock_move_lines"
                            attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
                            class="oe_stat_button" icon="fa-arrows-v"
                            groups="stock_custom.group_comercial_ext"/>
            </xpath>
            <xpath expr="//button[@name='%(stock.action_stock_level_forecast_report_product)d']" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>
            <xpath expr="//button[@name='action_view_routes']" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>
        </field>
    </record>

    <record id="view_template_property_form_add_new_tracking" model="ir.ui.view">
        <field name="name">product.template.stock.property.form.add_new_tracking</field>
        <field name="model">product.template</field>
        <field name="inherit_id" ref="stock.view_template_property_form"/>
        <field name="arch" type="xml">
            <field name="tracking" position="before">
                <field name="track_serial" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}"/>
            </field>
        </field>
    </record>

    <record id="view_stock_product_tree" model="ir.ui.view">
        <field name="name">product.stock.tree.inherit</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_product_tree_view"/>
        <field name="arch" type="xml">
            <field name="price" position="after">
                <field name="virtual_stock_conservative"/>
                <field name="incoming_qty"/>
                <field name="qty_in_production"/>
                <field name="joking_index"/>
            </field>
            <field name="barcode" position="after">
                <field name="categ_id"/>
            </field>
        </field>
    </record>

    <record id="product_add_visiotech_reference" model="ir.ui.view">
        <field name="name">product.product.form.add_visiotech_reference</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product_stock_unsafety.product_add_joking_index"/>
        <field name="arch" type="xml">
            <field name="joking_index" position="before">
                <field name="ref_visiotech"/>
            </field>
        </field>
    </record>

    <record id="product_add_tags_search" model="ir.ui.view">
        <field name="name">product.add.tags.search</field>
        <field name="model">product.product</field>
        <field name="priority">16</field>
        <field name="inherit_id" ref="product.product_search_form_view"/>
        <field name="arch" type="xml">
            <field name="name" position="attributes">
                <attribute name="filter_domain">['|', '|', '|', ('default_code', 'ilike', self), ('name','ilike',self),
                                                                ('ref_manufacturer','ilike',self), ('ref_visiotech','ilike',self)]</attribute>
            </field>
            <field name="name" position="after">
                <field name="tag_ids" string="Tag"/>
                <field name="seller_id" string="Main Supplier"/>
            </field>
            <field name="categ_id" position="attributes">
                <attribute name="filter_domain"></attribute>
            </field>
            <filter name="services" position="after">
                <filter string="Main supplier not contains outlet" name="main_supplier_outlet" domain="[('seller_id.name','not ilike','outlet')]"/>
                <filter string="New Category" name="categ_new" domain="[('categ_id.name','like','NUEVOS')]"/>
                <filter string="One month ago" name="one_month_ago" domain="[('date_first_incoming','>=',(datetime.datetime.now() - datetime.timedelta(days=31)).strftime('%Y-%m-%d'))]"/>
            </filter>
        </field>
    </record>

    <record id="action_product_stock_new" model="ir.actions.server">
        <field name="name">Stock New</field>
        <field name="type">ir.actions.server</field>
        <field name="model_id" ref="product.model_product_product"/>
        <field name="binding_model_id" ref="product.model_product_product"/>
        <field name="state">code</field>
        <field name="code">
            action = env["product.product"].get_stock_new()
        </field>
    </record>

    <menuitem id="menu_products_stock_new" action="action_product_stock_new"
        parent="sale.product_menu_catalog" groups="base.group_no_one" sequence="2"/>

    <record id="product_product_date_first_incoming_form_iew" model="ir.ui.view">
        <field name="name">product.product.date.first.incoming.purchase.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_normal_form_view"/>
        <field name="arch" type="xml">
            <field name="last_purchase_date" position="after">
                <field name="date_first_incoming"/>
            </field>
        </field>
    </record>

    <record id="product_product_last_purchase_info_form_view" model="ir.ui.view">
        <field name="name">product.product.last.purchase.info.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="purchase_last_price_info.product_product_last_purchase_info_form_view" />
        <field name="arch" type="xml">
            <field name="last_supplier_id" position="after">
                <field name="currency_purchase_id" invisible="1"/>
            </field>
        </field>
    </record>

    <record id="product_date_first_incoming_tree" model="ir.ui.view">
        <field name="name">product.date.first.incoming</field>
        <field name="model">product.product</field>
        <field name="arch" type="xml">
            <tree string="First incoming date" default_order='date_first_incoming asc' decoration-bf="date_first_incoming_reliability =='1.received'">
                <field name="default_code"/>
                <field name="date_first_incoming"/>
                <field name="date_first_incoming_reliability"/>
            </tree>
        </field>
    </record>

    <record id="product_date_first_incoming_action" model="ir.actions.act_window">
        <field name="name">First incoming date</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.product</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="product.product_search_form_view"/>
        <field name="view_id" ref="product_date_first_incoming_tree"/>
        <field name="domain">[('date_first_incoming','!=',False),('discontinued','=',False)]</field>
        <field name="context">{'search_default_one_month_ago':1}</field>
    </record>

    <menuitem id="first_incoming_date_menu" name="First incoming date" string="First incoming date"
              action="product_date_first_incoming_action"
              parent="purchase.menu_purchase_control" sequence="7"/>

    <record id="product_stock_catalog_update" model="ir.ui.view">
        <field name="name">product.stock.catalog.update</field>
        <field name="model">product.product</field>
        <field name="arch" type="xml">
            <tree>
                <field name="id"/>
                <field name="seller_id"/>
                <field name="code"/>
                <field name="qty_in_production"/>
                <field name="incoming_qty"/>
                <field name="qty_available_wo_wh"/>
                <field name="qty_available"/>
                <field name="virtual_stock_conservative"/>
                <field name="last_sixty_days_sales"/>
                <field name="biggest_sale_qty"/>
                <field name="remaining_days_sale"/>
                <field name="qty_available_input_loc"/>
                <field name="average_margin"/>
                <field name="standard_price"/>
                <field name="last_purchase_price"/>
                <field name="last_purchase_date"/>
                <field name="replacement_id"/>
                <field name="state"/>
            </tree>
        </field>
    </record>
    <record id="product_stock_catalog_update_action" model="ir.actions.act_window">
        <field name="name">Stock catalog Update</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.product</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="product_add_tags_search"/>
        <field name="view_id" ref="product_stock_catalog_update"/>
        <field name="domain">[('custom', '=', False),('type', '!=', 'service')]</field>
        <field name="context">{'search_default_main_supplier_outlet':1}</field>
    </record>

    <menuitem id="product_stock_catalog_update_menu" name="product_stock_catalog_update_menu" string="Stock catalog Update"
              action="product_stock_catalog_update_action"
              parent="purchase.menu_procurement_management" sequence="100"/>


    <record id="action_product_toxic_stock" model="ir.actions.act_window">
        <field name="name">Toxic Stock</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.product</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="product.product_search_form_view"/>
        <field name="view_id" ref="product.product_product_tree_view"/>
        <field name="domain">[('sale_ok', '=', True),('tag_ids', 'ilike', 'Toxic'),('qty_available', '>', 0)]</field>
    </record>

     <menuitem id="menu_products_toxic_stock" action="action_product_toxic_stock"
        parent="sale.product_menu_catalog"  sequence="2"/>

    <record id="product_product_last_purchase_info_form_view" model="ir.ui.view">
        <field name="name">product.product.last.purchase.info.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="purchase_last_price_info.product_product_last_purchase_info_form_view" />
        <field name="groups_id" eval="[(6, 0, [ref('commercial_group') ])]"/>
        <field name="arch" type="xml">
            <xpath expr="//button[@name='%(stock.action_view_change_product_quantity)d']" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>
        </field>
    </record>

    <record id="product_template_observations_note" model="ir.ui.view">
        <field name="name">product.template.common.observations.form</field>
        <field name="model">product.template</field>
        <field name="inherit_id" ref="product.product_template_form_view" />
        <field name="arch" type="xml">
            <xpath expr="//group[@name='description_internal']" position="after">
                <group name="observations_notes">
                    <group string="Observations">
                        <field name="observations" nolabel="1" placeholder="This note is for product observations."/>
                    </group>
                </group>
            </xpath>
        </field>
    </record>
</odoo>

{'fraction_non_alphanumeric': 0.16096572446804794, 'fraction_numerical': 0.002655392893330072, 'mean_word_length': 2.842910848549946, 'pattern_counts': {'":': 0, '<': 581, '<?xml version=': 2, '>': 585, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 28}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '820363', 'n_tokens_mistral': 8578, 'n_tokens_neox': 8296, 'n_words': 1267}