chat.freenode.net #tryton log beginning Mon 23 Dec 2019 12:00:01 AM CET | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 23:53 | |
-!- thaneor(~lenovo3@r179-24-118-100.dialup.adsl.anteldata.net.uy) has joined #tryton | 01:21 | |
-!- josesalvador(~josesalva@84.124.29.26.static.user.ono.com) has joined #tryton | 08:10 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 08:38 | |
amprxc | Hello, I'm new with tryton, and i need some help please. I would like to get a list from the tryton database, and then print the list in DESC order in SAO. I tried to put the "oder" parameter in my sql request (product_version_list = Pool().get('product.product').search(['product_name', '=', self.product_name], order=[('version', 'DESC')])), and | 08:43 |
---|---|---|
amprxc | then I get a list in DESC order, but the printed list in SAO is still in ASC order... Someone told me to look arround "ir.action.act_window", "ModelSQL._order", but I don't get what I have to do or change. I can't find any example of a SAO DESC list on the internet... (my list is a list where you select the value). Thanks for your future help. | 08:43 |
amprxc | Don't hesitate to ask questions | 08:43 |
pokoli | amprxc: your server code looks good to me | 08:46 |
pokoli | amprxc: How you show the list on SAO? using an action window? | 08:47 |
pokoli | amprxc: an action window is represented as a new tab on SAO | 08:47 |
amprxc | Hello pokoli and thanks for ur answer. The problem isn't my sql request, because when I print the result of my request, the list is in DESC order. But when I print that list in SAO in a list field when you can select the value, the list is in ASC order | 08:48 |
pokoli | amprxc: you are using a many2one field with a selection value? | 08:49 |
pokoli | amprxc: or a selection field? | 08:49 |
amprxc | pokoli a selection field | 08:50 |
amprxc | Uploaded file: https://uploads.kiwiirc.com/files/9a25a98ebd4676922e2469611a65171c/pasted.txt | 08:50 |
amprxc | product_version = fields.Function( fields.Selection( 'on_change_with_product_version', 'Producct version', required=True), ) | 08:50 |
pokoli | amprxc: then you should set the sort attribute to False. See: https://docs.tryton.org/projects/server/en/latest/ref/models/fields.html#trytond.model.fields.Selection.sort | 08:51 |
amprxc | pokoli with this attribute, the selecion field will be printed in the same order than my sql request ? | 08:52 |
pokoli | amprxc: if you are using a function to get the selection values yes | 08:52 |
pokoli | amprxc: otherwise the values are sorted based alfapheticaly on client side | 08:53 |
amprxc | Ok thaks I will try that | 08:53 |
amprxc | It's working ! Thanks ! I love u <3 | 08:55 |
-!- nicoe(~nicoe@2a02:2788:54:5a3:7e2a:31ff:fe5e:b25d) has joined #tryton | 10:11 | |
-!- thaneor(~lenovo3@r179-25-52-141.dialup.adsl.anteldata.net.uy) has joined #tryton | 10:23 | |
-!- josesalvador(~josesalva@170.253.41.74) has joined #tryton | 15:05 | |
-!- thaneor1(~lenovo3@r179-24-36-14.dialup.adsl.anteldata.net.uy) has joined #tryton | 18:33 | |
-!- SimAlbertiBeltra(sim6matrix@gateway/shell/matrix.org/x-jkzcpmjrdjvojrlv) has joined #tryton | 19:05 | |
-!- aydiomio(be0c1fa2@corp-190-12-31-162.cue.puntonet.ec) has joined #tryton | 20:38 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!