what are sequences ?

32 views
Skip to first unread message

Cato Nano

unread,
Jan 10, 2018, 4:15:41 AM1/10/18
to tryton
Hello

I' d like to have a setup with a relation in my project

Similar to Sale and Sale Lines

I made the models, they compile and run.
Now I only neeed a basic form with a list of lines within it

But I' m a bit confused

In sale.xml I see these 2 records:

<record model="ir.ui.view" id="sale_line_view_tree">
<field name="model">sale.line</field>
<field name="type">tree</field>
<field name="priority" eval="10"/>
<field name="name">sale_line_tree</field>
</record>

<record model="ir.ui.view" id="sale_line_view_tree_sequence">
<field name="model">sale.line</field>
<field name="type">tree</field>
<field name="priority" eval="20"/>
<field name="name">sale_line_tree_sequence</field>
</record>


What's the difference between a sequence and a plain tree view ?

What's a sequence anyway ?

the view/sales_form.xml file conatins this line

<field name="lines" colspan="4"
view_ids="sale.sale_line_view_tree_sequence"/>


Why does it point to the sequence rather than to the plain view ?
Do I need to do the same ?


Thanks

Sergi Almacellas Abellana

unread,
Jan 10, 2018, 5:01:04 AM1/10/18
to try...@googlegroups.com
El 10/01/18 a les 10:15, Cato Nano ha escrit:
> Hello
>
> I' d like to have a setup with a relation in my project
>
> Similar to Sale and Sale Lines
>
> I made the models, they compile and run.
> Now I only neeed a basic form with a list of lines within it
>
> But I' m a bit confused
>
> In sale.xml I see these 2 records:
>
> <record model="ir.ui.view" id="sale_line_view_tree">
> <field name="model">sale.line</field>
> <field name="type">tree</field>
> <field name="priority" eval="10"/>
> <field name="name">sale_line_tree</field>
> </record>
>
> <record model="ir.ui.view" id="sale_line_view_tree_sequence">
> <field name="model">sale.line</field>
> <field name="type">tree</field>
> <field name="priority" eval="20"/>
> <field name="name">sale_line_tree_sequence</field>
> </record>
>
>
> What's the difference between a sequence and a plain tree view ?

This view has a special definition taht uses the sequence field to order
the record in the list. On the gtk client you can drag and drop the
lines and the client will set the value of the sequence field to follow
the defined order. It's explained on the docs:

http://doc.tryton.org/4.6/trytond/doc/topics/views/index.html?highlight=sequence#tree



>
> What's a sequence anyway ?
>
> the view/sales_form.xml file conatins this line
>
> <field name="lines" colspan="4"
> view_ids="sale.sale_line_view_tree_sequence"/>
>
>
> Why does it point to the sequence rather than to the plain view ?
> Do I need to do the same ?

You should do the same if you want to allow to define the order of the
lines.



--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Cato Nano

unread,
Jan 10, 2018, 11:50:21 AM1/10/18
to tryton
Thank you Sergi
Appreciated
Reply all
Reply to author
Forward
0 new messages