bala4901
(Markus Bala)
December 20, 2019, 7:51am
1
http://docs.tryton.org/projects/server/en/latest/topics/views/#tree
How to use visual in xml?
I had tried to use visual as the code below for field to_pallet or to_cartons, still do not see the effect
Below is my sample code:
<tree editable="bottom">
<field name="stock" readonly="1"/>
<field name="bin_loc" string="Current Bin"/>
<field name="quantity" />
<field name="cartons" />
<field name="to_location"/>
<field name="to_bin_loc"/>
<field name="to_quantity" string="Transfer Qty" visual="warning"/>
<field name="to_cartons" string="Transfer Carton"/>
<field name="to_pallet" visual="If(Eval('draft'), 'warning', '') pyson='1'/>
<field name="to_stock" readonly="1" string="To Stock"/>
<field name="state"/>
</tree>
pokoli
(Sergi Almacellas Abellana)
December 20, 2019, 8:06am
2
As visual is pyson attribute it should be encodded using the view_attributes function .
There is an example on the account_invoice module
bala4901
(Markus Bala)
December 20, 2019, 8:47am
4
Hi Pokoli, thank you for your fast response.
If let say, my tree is from parent.
If I want to select “child_field2”, how to xpath?
I had tried this but it not work
/form/field[@name="lines"]/tree/field[@name='child_field2']
Below is pseudo code:
child_id: child_tree
<tree>
<field name="child_field1"/>
<field name="child_field2"/>
</tree>
parent_form:
<form>
<field name="parent1"/>
<field name="parent2"/>
<field name="lines" view_ids="child_tree"/>
</form>
ced
(Cédric Krier)
December 20, 2019, 8:58am
5
If you want to modify the view of lines, you must add your view_attributes
on the Model of the lines and use a xpath expression for the child_tree
view.
system
(system)
Closed
January 19, 2020, 8:58am
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.