IRC logs of #tryton for Monday, 2019-12-23

chat.freenode.net #tryton log beginning Mon 23 Dec 2019 12:00:01 AM CET
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:53
-!- thaneor(~lenovo3@r179-24-118-100.dialup.adsl.anteldata.net.uy) has joined #tryton01:21
-!- josesalvador(~josesalva@84.124.29.26.static.user.ono.com) has joined #tryton08:10
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:38
amprxcHello, 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')])), and08:43
amprxcthen 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
amprxcDon't hesitate to ask questions08:43
pokoliamprxc: your server code looks good to me08:46
pokoliamprxc: How you show the list on SAO? using an action window?08:47
pokoliamprxc: an action window is represented as a new tab on SAO08:47
amprxcHello 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 order08:48
pokoliamprxc: you are using a many2one field with a selection value?08:49
pokoliamprxc: or a selection field?08:49
amprxcpokoli a selection field08:50
amprxcUploaded file: https://uploads.kiwiirc.com/files/9a25a98ebd4676922e2469611a65171c/pasted.txt08:50
amprxcproduct_version = fields.Function(        fields.Selection(            'on_change_with_product_version',            'Producct version', required=True),     )08:50
pokoliamprxc: 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.sort08:51
amprxcpokoli with this attribute, the selecion field will be printed in the same order than my sql request ?08:52
pokoliamprxc: if you are using a function to get the selection values yes08:52
pokoliamprxc: otherwise the values are sorted based alfapheticaly on client side08:53
amprxcOk thaks I will try that08:53
amprxcIt's working ! Thanks ! I love u <308:55
-!- nicoe(~nicoe@2a02:2788:54:5a3:7e2a:31ff:fe5e:b25d) has joined #tryton10:11
-!- thaneor(~lenovo3@r179-25-52-141.dialup.adsl.anteldata.net.uy) has joined #tryton10:23
-!- josesalvador(~josesalva@170.253.41.74) has joined #tryton15:05
-!- thaneor1(~lenovo3@r179-24-36-14.dialup.adsl.anteldata.net.uy) has joined #tryton18:33
-!- SimAlbertiBeltra(sim6matrix@gateway/shell/matrix.org/x-jkzcpmjrdjvojrlv) has joined #tryton19:05
-!- aydiomio(be0c1fa2@corp-190-12-31-162.cue.puntonet.ec) has joined #tryton20:38

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!