You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
2.9 KiB
62 lines
2.9 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<odoo>
|
|
<record id="view_product_template_approval_form" model="ir.ui.view">
|
|
<field name="name">approval</field>
|
|
<field name="model">product.template</field>
|
|
<field name="inherit_id" ref="product.product_template_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<header>
|
|
<button name="confirm_product_approval" type="object"
|
|
attrs="{'invisible': [('approve_state','!=','draft')]}"
|
|
string="Confirm"
|
|
groups="product_approval_management.product_manager"/>
|
|
<button name="reset_product_approval" type="object"
|
|
attrs="{'invisible': [('approve_state','!=','confirmed')]}"
|
|
string="Reset To Draft"
|
|
groups="product_approval_management.product_manager"/>
|
|
<field name="approve_state" widget="statusbar"
|
|
statusbar_visible="draft,confirmed"/>
|
|
</header>
|
|
|
|
</field>
|
|
</record>
|
|
<record id="product_template_search_approval_view" model="ir.ui.view">
|
|
<field name="name">mrp.product.template.approval_state.search</field>
|
|
<field name="model">product.template</field>
|
|
<field name="inherit_id" ref="product.product_template_search_view"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//search/group/filter[@name='type']" position="after">
|
|
<filter string="Status" name="approve_state" context="{'group_by':'approve_state'}"/>
|
|
</xpath>
|
|
<xpath expr="//search/filter[@name='consumable']" position="after">
|
|
<filter string="Status" name="approve_state" domain="[('approve_state', 'in', ['draft', 'confirmed'])]"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
<record id="inherited_sale_order_line_view" model="ir.ui.view">
|
|
<field name="name">approval</field>
|
|
<field name="model">sale.order</field>
|
|
<field name="inherit_id" ref="sale.view_order_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//tree/field[@name='product_id']" position="attributes">
|
|
<attribute name="domain">[('approve_state', '=', 'confirmed'), ('sale_ok', '=', True), '|',
|
|
('company_id', '=', False), ('company_id', '=', company_id)]
|
|
</attribute>
|
|
</xpath>
|
|
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_confirm_products" model="ir.actions.server">
|
|
<field name="name">Confirm</field>
|
|
<field name="model_id" ref="product.model_product_template"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model.confirm_products()</field>
|
|
<field name="binding_model_id" ref="product.model_product_template"/>
|
|
<field name="groups_id" eval="[(4, ref('product_approval_management.product_manager'))]"/>
|
|
</record>
|
|
|
|
</odoo>
|
|
|
|
|