changeset a1dffeba1a03 in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset;node=a1dffeba1a03
description:
Add form view to Locations Tree Quantity
sao prevents to open tree with more children than its limit and it
switches to
the form view. So to allow the user to see the data, we must add a form
view.
issue8844
review274341002
diffstat:
product.xml | 15 ++++++++++++++-
view/location_quantity_form.xml | 14 ++++++++++++++
view/location_quantity_tree.xml | 2 --
3 files changed, 28 insertions(+), 3 deletions(-)
diffs (64 lines):
diff -r 2a4d9423a385 -r a1dffeba1a03 product.xml
--- a/product.xml Fri Dec 06 17:33:47 2019 +0100
+++ b/product.xml Sat Dec 07 16:08:54 2019 +0100
@@ -40,6 +40,13 @@
<field name="name">location_quantity_tree</field>
</record>
+ <record model="ir.ui.view" id="location_quantity_view_form">
+ <field name="model">stock.location</field>
+ <field name="type">form</field>
+ <field name="priority" eval="20"/>
+ <field name="name">location_quantity_form</field>
+ </record>
+
<record model="ir.ui.view" id="location_quantity_view_list">
<field name="model">stock.location</field>
<field name="type">tree</field>
@@ -55,11 +62,17 @@
eval="If(Eval('active_model') == 'product.template',
{'product_template': Eval('active_id')}, {'product': Eval('active_id')})"/>
<field name="context_model">product.by_location.context</field>
</record>
- <record model="ir.action.act_window.view"
id="act_location_quantity_tree_view">
+ <record model="ir.action.act_window.view"
id="act_location_quantity_tree_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="location_quantity_view_tree"/>
<field name="act_window" ref="act_location_quantity_tree"/>
</record>
+ <record model="ir.action.act_window.view"
id="act_location_quantity_tree_view2">
+ <field name="sequence" eval="20"/>
+ <field name="view" ref="location_quantity_view_form"/>
+ <field name="act_window" ref="act_location_quantity_tree"/>
+ </record>
+
<record model="ir.action.keyword"
id="act_location_quantity_tree_keyword1">
<field name="keyword">form_relate</field>
diff -r 2a4d9423a385 -r a1dffeba1a03 view/location_quantity_form.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/location_quantity_form.xml Sat Dec 07 16:08:54 2019 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<form col="6">
+ <label name="name"/>
+ <field name="name" colspan="5"/>
+ <label name="quantity"/>
+ <field name="quantity"/>
+ <label name="forecast_quantity"/>
+ <field name="forecast_quantity"/>
+ <label name="cost_value"/>
+ <field name="cost_value"/>
+ <field name="childs" colspan="6"
view_ids="stock.location_quantity_view_list,stock.location_quantity_view_form"/>
+</form>
diff -r 2a4d9423a385 -r a1dffeba1a03 view/location_quantity_tree.xml
--- a/view/location_quantity_tree.xml Fri Dec 06 17:33:47 2019 +0100
+++ b/view/location_quantity_tree.xml Sat Dec 07 16:08:54 2019 +0100
@@ -6,6 +6,4 @@
<field name="quantity"/>
<field name="forecast_quantity"/>
<field name="cost_value"/>
- <field name="parent" tree_invisible="1"/>
- <field name="childs" tree_invisible="1"/>
</tree>