forked from OCA/product-variant
/
purchase_order_view.xml
41 lines (39 loc) · 2.1 KB
/
purchase_order_view.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="purchase_order_form" model="ir.ui.view">
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']" position="before">
<div class="oe_button_box" name="button_box">
<button name="%(action_purchase_manage_variant)d"
type="action"
string="Add or Modify Variants"
class="oe_edit_only"
states="draft,sent"
/>
</div>
</xpath>
<xpath expr="//field[@name='order_line']//tree" position="inside">
<field name="product_tmpl_id_purchase_order_variant_mgmt" invisible="1"/>
<field name="state_purchase_order_variant_mgmt" invisible="1"/>
<field name="product_attribute_value_ids" invisible="1"/>
<!-- Not working until https://github.com/odoo/odoo/pull/13558 -->
<!-- Also https://github.com/odoo/odoo/pull/13635 is needed for correct template selection -->
<button name="%(action_purchase_manage_variant)d"
type="action"
string="Modify Variants"
icon="fa-th"
class="oe_edit_only"
context="{'default_product_tmpl_id': product_tmpl_id_purchase_order_variant_mgmt}"
attrs="{'invisible': ['|', ('state_purchase_order_variant_mgmt', 'not in', ('draft', 'sent')), ('product_attribute_value_ids', '=', [])]}"
/>
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="options">{'reload_on_button': true}</attribute>
</xpath>
</field>
</record>
</odoo>