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 -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/6b5d6323-0152-fc9b-2b48-0f97c76dec96%40koolpi.com.
