[MIG] product_quick_bom: Migration to 12.0

This commit is contained in:
Kevin Khao
2020-01-07 15:36:05 +01:00
committed by ps-tubtim
parent c46da3555a
commit b4878fdd00
12 changed files with 579 additions and 184 deletions

View File

@@ -1,20 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="product_template_form_view" model="ir.ui.view">
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="priority" eval="200"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='sales']" position="after">
<page name="bom_line" string="Bom line">
<field name="bom_line_ids">
<tree editable="bottom">
<field name="product_id"/>
<field name="product_qty"/>
</tree>
</field>
</page>
</xpath>
</field>
</record>
<record id="product_template_only_form_view_bomlines" model="ir.ui.view">
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='sales']" position="after">
<page name="bom_line" string="Bill of Materials">
<div attrs="{'invisible': [('bom_count', '&lt;', 2)]}"
class="alert alert-danger text-center"
role="alert">
<p>The product is linked to several BoMs, modifications must be done BoM-side.</p>
</div>
<div attrs="{'invisible': [('bom_count', '!=', 0)]}"
class="alert alert-danger text-center"
role="alert">
<p>The product doesn't have a BoM yet, you must create one before updating its components.</p>
<button name="button_create_bom" type="object" string="Create BoM"/>
</div>
<field name="specific_bom_line_ids" attrs="{'invisible': [('bom_count', '!=', 1)]}">
<tree editable="bottom">
<field name="product_id"/>
<field name="product_qty"/>
<field name="attribute_value_ids" widget="many2many_tags"/>
</tree>
</field>
</page>
</xpath>
</field>
</record>
</odoo>