summaryrefslogtreecommitdiff
path: root/addons/purchase_stock/views
diff options
context:
space:
mode:
authorTWA <twa@odoo.com>2018-08-14 13:46:00 +0200
committerPierre Masereel <pim@odoo.com>2018-08-21 22:25:26 +0200
commit326e48a112f86c16e14be816ce7165a27a23709d (patch)
treebdd2d08e5ee06151bc3a4e423748db74603e0794 /addons/purchase_stock/views
parentc9f899b99a633b38614f7689e56d56f5342ba590 (diff)
[IMP] purchase_stock, sale_stock : Show stat button instead of m2m widget
On stock production lot, we show stat buttons redirecting to purchase orders and sale orders where the lot has been used instead of showing Many2many in the form view. TASK-ID: 1873101
Diffstat (limited to 'addons/purchase_stock/views')
-rw-r--r--addons/purchase_stock/views/stock_production_lot_views.xml21
1 files changed, 10 insertions, 11 deletions
diff --git a/addons/purchase_stock/views/stock_production_lot_views.xml b/addons/purchase_stock/views/stock_production_lot_views.xml
index 9371b84ce28..23ae5678bd3 100644
--- a/addons/purchase_stock/views/stock_production_lot_views.xml
+++ b/addons/purchase_stock/views/stock_production_lot_views.xml
@@ -5,17 +5,16 @@
<field name="model">stock.production.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_form"/>
<field name="arch" type="xml">
- <xpath expr="//group[@name='main_group']" position="after">
- <group>
- <field name="purchase_order_ids" widget="many2many" readonly="True">
- <tree>
- <field name="name"/>
- <field name="partner_id"/>
- <field name="date_order"/>
- <field name="state" invisible="1"/>
- </tree>
- </field>
- </group>
+ <xpath expr="//div[hasclass('oe_button_box')]/button" position="before">
+ <button class="oe_stat_button" name="action_view_po"
+ type="object" icon="fa-shopping-cart" attrs="{'invisible': [('purchase_order_count', '=', 0)]}" help="Purchase Orders">
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_value">
+ <field name="purchase_order_count" widget="statinfo" nolabel="1" class="mr4"/>
+ </span>
+ <span class="o_stat_text">Purchase Orders</span>
+ </div>
+ </button>
</xpath>
</field>
</record>