Sort query grid products in sales

46 views
Skip to first unread message

Lucas Riccombene

unread,
Dec 9, 2015, 8:55:06 PM12/9/15
to tryton
Consultation is very fucked up the issue of ordering the products of a sale.
The sale has a grid of products, these are the ones added as they're loaded in the order, however once I would load the products they can be ordered
hitting the head of the grid as is done in other parts you order the grids
Well here I am investigating but nothing that a little lost even with the topic. Gradually overcoming situations.

Cheers

Sergi Almacellas Abellana

unread,
Dec 10, 2015, 8:52:48 AM12/10/15
to try...@googlegroups.com
El 09/12/15 a les 21:01, Lucas Riccombene ha escrit:
In which field are you trying to order? Maybe the fields it's some kind
of Functional field on which have no order function defined, so that's
why you can not order on the client.

Hope it helps!

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

Karla Stenger

unread,
Dec 10, 2015, 9:00:25 AM12/10/15
to try...@googlegroups.com

Hi Lucas,
if the problem is that lines can be sorted you can prevent it by using the view "sale.sale_line_view_tree" instead of the default one "sale.sale_line_view_tree_sequence".

You can do this from your own module by adding this in your view/sale_form.xml file:

    <xpath expr="/form/notebook/page[@id='sale']/field[@name='lines']"
        position="replace_attributes">
        <field name="lines" view_ids="sale.sale_line_view_tree"/>
    </xpath>

that replaces the definition of view_ids which comes from sale/view/sale_form.xml:
            <field name="lines" colspan="4"
                view_ids="sale.sale_line_view_tree_sequence"/>

I am not sure that you also want to make the sequence readonly or something like that.

Hope this finally helps you
cheers,
Karla
 

--
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/b6890681-9f55-49fa-ae61-1e400a39c206%40googlegroups.com.



--
-------------------------
Karla  Mª  Stenger  Sábat
karla....@gmail.com

Cédric Krier

unread,
Dec 10, 2015, 9:30:29 AM12/10/15
to try...@googlegroups.com
It is not the view that defines the order but the order of the One2Many
or the default order of the Model. Here it is the default order of
SaleLine.
The view "sequence" is only there to enforce this behaviour.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
Reply all
Reply to author
Forward
0 new messages