[FIX] stock: backport of rev 0a6d63b
This commit is contained in:
parent
b4ef87f1ec
commit
eda2f064cf
|
@ -422,7 +422,8 @@
|
|||
<search string="Search Bill Of Material">
|
||||
<field name="name" string="Bill Of Material" filter_domain="['|',('name','ilike',self),('code','ilike',self)]"/>
|
||||
<field name="bom_line_ids" string="Components"/>
|
||||
<field name="product_tmpl_id"/>
|
||||
<field name="product_tmpl_id" string="Product"/>
|
||||
<field name="product_id" string="Variant"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_tmpl_id'}"/>
|
||||
|
@ -1033,12 +1034,19 @@
|
|||
id="menu_mrp_production_order_action" name="Order Planning"
|
||||
parent="menu_mrp_planning" sequence="1"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="product_open_bom">
|
||||
<record model="ir.actions.act_window" id="template_open_bom">
|
||||
<field name="context">{'default_product_tmpl_id': active_id, 'search_default_product_tmpl_id': active_id}</field>
|
||||
<field name="name">Bill of Materials</field>
|
||||
<field name="res_model">mrp.bom</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="product_open_bom">
|
||||
<field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>
|
||||
<field name="name">Bill of Materials</field>
|
||||
<field name="res_model">mrp.bom</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
<record id="act_product_mrp_production" model="ir.actions.act_window">
|
||||
<field name="context">{'search_default_product_id': [active_id]}</field>
|
||||
<field name="name">Manufacturing Orders</field>
|
||||
|
@ -1048,10 +1056,23 @@
|
|||
<record model="ir.ui.view" id="product_template_form_view_bom_button">
|
||||
<field name="name">product.template.procurement</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="buttons" position="inside">
|
||||
<button class="oe_inline oe_stat_button" name="%(product_open_bom)d" type="action"
|
||||
<button class="oe_inline oe_stat_button" name="%(template_open_bom)d" type="action"
|
||||
groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
|
||||
<field string="Bill of Materials" name="bom_count" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="product_product_form_view_bom_button">
|
||||
<field name="name">product.product.procurement</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="buttons" position="inside">
|
||||
<button class="oe_inline oe_stat_button" name="%(product_open_bom)d" type="action"
|
||||
groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
|
||||
<field string="Bill of Materials" name="bom_count" widget="statinfo" />
|
||||
</button>
|
||||
|
|
|
@ -40,8 +40,9 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- base structure of product.template, common with product.product -->
|
||||
<record id="product_template_form_view" model="ir.ui.view">
|
||||
<field name="name">product.template.product.form</field>
|
||||
<field name="name">product.template.common.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Product" version="7.0">
|
||||
|
@ -128,14 +129,6 @@
|
|||
<separator string="Description for Quotations"/>
|
||||
<field name="description_sale" placeholder="note to be displayed on quotations..."/>
|
||||
</page>
|
||||
<page name="variants" string="Variants">
|
||||
<field name="attribute_line_ids" widget="one2many_list">
|
||||
<tree string="Variants" editable="bottom">
|
||||
<field name="attribute_id"/>
|
||||
<field name="value_ids" widget="many2many_tags" domain="[('attribute_id', '=', attribute_id)]" context="{'default_attribute_id': attribute_id}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
|
@ -146,48 +139,27 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_kanban_view" model="ir.ui.view">
|
||||
<field name="name">Product.template.product.kanban</field>
|
||||
<field name="model">product.template</field>
|
||||
<record id="product_search_form_view" model="ir.ui.view">
|
||||
<field name="name">product.product.search</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="inherit_id" ref="product.product_template_search_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<field name="image_small"/>
|
||||
<field name="lst_price"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_vignette oe_semantic_html_override">
|
||||
<a type="open"><img t-att-src="kanban_image('product.template', 'image_small', record.id.value)" class="oe_kanban_image"/></a>
|
||||
<div class="oe_kanban_details">
|
||||
<h4>
|
||||
<a type="open">
|
||||
<field name="name"/>
|
||||
</a>
|
||||
</h4>
|
||||
<div name="tags"/>
|
||||
<ul>
|
||||
<li>Price: <field name="lst_price"></field></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
<field name="name" position="replace">
|
||||
<field name="name" string="Product" filter_domain="['|',('default_code','ilike',self),('name','ilike',self)]"/>
|
||||
</field>
|
||||
<field name="product_variant_ids" position="replace">
|
||||
<field name="attribute_value_ids"/>
|
||||
</field>
|
||||
<field name="name" position="after">
|
||||
<field name="product_tmpl_id" string="Product Template"/>
|
||||
</field>
|
||||
<xpath expr="//group[@string='Group by...']" position="inside">
|
||||
<filter string='Product Template' name="template_id" domain="[]" context="{'group_by' : 'product_tmpl_id'}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_action" model="ir.actions.act_window">
|
||||
<field name="name">Products</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.template</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="product_template_kanban_view"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="product_template_action"
|
||||
id="menu_product_template_action"
|
||||
parent="base.menu_product" sequence="1" />
|
||||
|
||||
<!-- variants -->
|
||||
|
||||
<record id="variants_template_tree_view" model="ir.ui.view">
|
||||
|
@ -212,31 +184,123 @@
|
|||
<field name="context">{'default_product_tmpl_id': active_id}</field>
|
||||
</record>
|
||||
|
||||
<!-- product product -->
|
||||
<record id="product_normal_action" model="ir.actions.act_window">
|
||||
<field name="name">Product Variants</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.product</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="search_view_id" ref="product_search_form_view"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to define a new product.
|
||||
</p><p>
|
||||
You must define a product for everything you buy or sell,
|
||||
whether it's a physical product, a consumable or service.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record id="product_variant_action" model="ir.actions.act_window">
|
||||
<field name="name">Product Variants</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.product</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="context">{'search_default_product_tmpl_id': [active_id], 'default_product_tmpl_id': active_id}</field>
|
||||
<field name="search_view_id" ref="product_search_form_view"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to define a new product.
|
||||
</p><p>
|
||||
You must define a product for everything you buy or sell,
|
||||
whether it's a physical product, a consumable or service.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="prod_config_main" name="Product Variants" parent="base.menu_base_config" sequence="70" groups="base.group_no_one"/>
|
||||
|
||||
<record id="product_search_form_view" model="ir.ui.view">
|
||||
<field name="name">product.product.search</field>
|
||||
<field name="model">product.product</field>
|
||||
<!-- view specific to product.template -->
|
||||
<record id="product_template_only_form_view" model="ir.ui.view">
|
||||
<field name="name">product.template.product.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="inherit_id" ref="product.product_template_search_view"/>
|
||||
<field name="priority" eval="8" />
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="replace">
|
||||
<field name="name" string="Product" filter_domain="['|',('default_code','ilike',self),('name','ilike',self)]"/>
|
||||
</field>
|
||||
<field name="product_variant_ids" position="replace">
|
||||
<field name="attribute_value_ids"/>
|
||||
</field>
|
||||
<field name="name" position="after">
|
||||
<field name="product_tmpl_id" string="Product Template"/>
|
||||
</field>
|
||||
<xpath expr="//group[@string='Group by...']" position="inside">
|
||||
<filter string='Product Template' name="template_id" domain="[]" context="{'group_by' : 'product_tmpl_id'}"/>
|
||||
<xpath expr="//form" position="attributes">
|
||||
<attribute name="name">Product Template</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//page[@string='Sales']" position="after">
|
||||
<page name="variants" string="Variants">
|
||||
<div class="oe_right">
|
||||
<button class="oe_inline oe_stat_button" string="Variant Prices" name="%(variants_template_action)d" type="action" icon="fa-strikethrough"/>
|
||||
<button class="oe_inline oe_stat_button" name="%(product.product_variant_action)d" type="action" icon="fa-sitemap">
|
||||
<field string="List of Variants" name="product_variant_count" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
<field name="attribute_line_ids" widget="one2many_list">
|
||||
<tree string="Variants" editable="bottom">
|
||||
<field name="attribute_id"/>
|
||||
<field name="value_ids" widget="many2many_tags" domain="[('attribute_id', '=', attribute_id)]" context="{'default_attribute_id': attribute_id}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_kanban_view" model="ir.ui.view">
|
||||
<field name="name">Product.template.product.kanban</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<field name="image_small"/>
|
||||
<field name="lst_price"/>
|
||||
<field name="is_product_variant"/>
|
||||
<field name="product_variant_count"/>
|
||||
<field name="product_variant_ids"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_vignette oe_semantic_html_override">
|
||||
<a type="open"><img t-att-src="kanban_image('product.template', 'image_small', record.id.value)" class="oe_kanban_image"/></a>
|
||||
<div class="oe_kanban_details">
|
||||
<h4>
|
||||
<a type="open">
|
||||
<field name="name"/>
|
||||
</a>
|
||||
</h4>
|
||||
<a name="%(product.product_variant_action)d" type="action">
|
||||
<t t-esc="record.product_variant_count.value"/> Variants
|
||||
</a>
|
||||
<div name="tags"/>
|
||||
<ul>
|
||||
<li>Price: <field name="lst_price"></field></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_action" model="ir.actions.act_window">
|
||||
<field name="name">Products</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.template</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="product_template_kanban_view"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="product_template_action"
|
||||
id="menu_product_template_action"
|
||||
parent="base.menu_product" sequence="1" />
|
||||
|
||||
<!-- product product -->
|
||||
|
||||
<menuitem id="prod_config_main" name="Product Variants" parent="base.menu_base_config" sequence="70" groups="base.group_no_one"/>
|
||||
|
||||
<record id="product_product_tree_view" model="ir.ui.view">
|
||||
<field name="name">product.product.tree</field>
|
||||
<field name="model">product.product</field>
|
||||
|
@ -278,8 +342,6 @@
|
|||
<xpath expr="//div[@class='oe_title']" position="inside">
|
||||
<field name="attribute_value_ids" widget="many2many_tags"/>
|
||||
</xpath>
|
||||
<page name="variants" position="replace">
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -300,79 +362,6 @@
|
|||
|
||||
<!-- -->
|
||||
|
||||
<record id="product_normal_action" model="ir.actions.act_window">
|
||||
<field name="name">Product Variants</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.product</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="search_view_id" ref="product_search_form_view"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to define a new product.
|
||||
</p><p>
|
||||
You must define a product for everything you buy or sell,
|
||||
whether it's a physical product, a consumable or service.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- -->
|
||||
|
||||
<record id="product_variant_action" model="ir.actions.act_window">
|
||||
<field name="name">Product Variants</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.product</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="context">{'search_default_product_tmpl_id': [active_id], 'default_product_tmpl_id': active_id}</field>
|
||||
<field name="search_view_id" ref="product_search_form_view"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to define a new product.
|
||||
</p><p>
|
||||
You must define a product for everything you buy or sell,
|
||||
whether it's a physical product, a consumable or service.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_form_view_variant_button" model="ir.ui.view">
|
||||
<field name="name">product.template.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="attribute_line_ids" position="before">
|
||||
<div class="oe_right">
|
||||
<button class="oe_inline oe_stat_button" string="Variant Prices" name="%(product.variants_template_action)d" type="action" icon="fa-strikethrough"/>
|
||||
<button class="oe_inline oe_stat_button" name="%(product.product_variant_action)d" type="action" icon="fa-sitemap">
|
||||
<field string="List of Variants" name="product_variant_count" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_kanban_view_variant_button" model="ir.ui.view">
|
||||
<field name="name">product.template.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_kanban_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="lst_price" position="after">
|
||||
<field name="is_product_variant"/>
|
||||
<field name="product_variant_count"/>
|
||||
<field name="product_variant_ids"/>
|
||||
</field>
|
||||
<h4 position="after">
|
||||
<a name="%(product.product_variant_action)d" type="action" t-if="!record.is_product_variant.raw_value & record.product_variant_count.raw_value>1">
|
||||
<t t-esc="record.product_variant_count.value"/> Variants
|
||||
</a>
|
||||
</h4>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- -->
|
||||
|
||||
<record id="product_normal_action_sell" model="ir.actions.act_window">
|
||||
<field name="name">Product Variants</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
|
Loading…
Reference in New Issue