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 #tryton00:12
-!- thaneor(~lenovo3@r179-24-118-100.dialup.adsl.anteldata.net.uy) has joined #tryton02:12
-!- josesalvador(~josesalva@84.124.29.26.static.user.ono.com) has joined #tryton09:12
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:12
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')])), and09:12
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.09:12
amprxcDon't hesitate to ask questions09:12
pokoliamprxc: your server code looks good to me09:12
pokoliamprxc: How you show the list on SAO? using an action window?09:12
pokoliamprxc: an action window is represented as a new tab on SAO09:12
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 order09:12
pokoliamprxc: you are using a many2one field with a selection value?09:12
pokoliamprxc: or a selection field?09:12
amprxcpokoli a selection field09:12
amprxcUploaded file: https://uploads.kiwiirc.com/files/9a25a98ebd4676922e2469611a65171c/pasted.txt09:12
amprxcproduct_version = fields.Function(        fields.Selection(            'on_change_with_product_version',            'Producct version', required=True),     )09:12
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.sort09:12
amprxcpokoli with this attribute, the selecion field will be printed in the same order than my sql request ?09:12
pokoliamprxc: if you are using a function to get the selection values yes09:12
pokoliamprxc: otherwise the values are sorted based alfapheticaly on client side09:12
amprxcOk thaks I will try that09:12
amprxcIt's working ! Thanks ! I love u <309:12
-!- nicoe(~nicoe@2a02:2788:54:5a3:7e2a:31ff:fe5e:b25d) has joined #tryton11:12
-!- thaneor(~lenovo3@r179-25-52-141.dialup.adsl.anteldata.net.uy) has joined #tryton11:12
-!- josesalvador(~josesalva@170.253.41.74) has joined #tryton16:12
-!- thaneor1(~lenovo3@r179-24-36-14.dialup.adsl.anteldata.net.uy) has joined #tryton19:12
-!- SimAlbertiBeltra(sim6matrix@gateway/shell/matrix.org/x-jkzcpmjrdjvojrlv) has joined #tryton20:12
-!- aydiomio(be0c1fa2@corp-190-12-31-162.cue.puntonet.ec) has joined #tryton21:12

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