IRC logs of #tryton for Thursday, 2018-05-31

chat.freenode.net #tryton log beginning Thu May 31 00:00:01 CEST 2018
-!- smarro(~sebastian@2800:af0:1028:8be::5) has joined #tryton22:49
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:20
-!- yangoon1(~mathiasb@i59F4FB4B.versanet.de) has joined #tryton02:40
-!- smarro(~sebastian@2800:af0:1028:8be::5) has joined #tryton03:07
-!- JanGB(~jan@ipservice-092-217-214-015.092.217.pools.vodafone-ip.de) has joined #tryton04:24
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton04:27
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton05:51
-!- jmpoure(~jmpoure@soy95-3-82-237-147-64.fbx.proxad.net) has joined #tryton06:44
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:58
-!- jmpoure(~jmpoure@soy95-3-82-237-147-64.fbx.proxad.net) has joined #tryton07:05
-!- jmpoure(~jmpoure@soy95-3-82-237-147-64.fbx.proxad.net) has joined #tryton07:08
-!- jmpoure(~jmpoure@soy95-3-82-237-147-64.fbx.proxad.net) has joined #tryton07:10
-!- jmpoure(~jmpoure@soy95-3-82-237-147-64.fbx.proxad.net) has joined #tryton07:13
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton07:19
mrichezhi, i need to add a confirm dialog on a button. Is it better to add <field name="confirm"> ...</field> in record model ir.model.button or just add <button confirm="..."../> in the view form ?09:12
pokolimrichez: adding confirm on the ir.model.button will make it the confirmation dialog appear on all the views that you use the button while on the view will add it only to the current view09:15
pokolimrichez: I will recomend using ir.model.button09:15
mrichezpokoli: ok thank you!09:32
mrichezpokoli: to add this <field name="confirm">...</field> to an existing ir.model.button , i've to add block <record model...> with a <field name="inherit" ref="original button..." />?09:38
pokolimrichez: no, inheriht is only for views09:39
pokolimrichez: you should use id="<parent_model>.<parent_xml_id>" on the record definition09:39
pokolimrichez: so instead of creating a new record the original one is updated09:40
mrichezpokoli: ok, it's same when i wanted to add continent to country list :-)09:40
pokolimrichez: yes. Probably we can improve the doc to explain the update behaviour: doc.tryton.org/4.8/trytond/doc/topics/modules/index.html#xml-files09:41
mrichezpokoli: indeed09:46
-!- dmollerm(~dmollerm@170.red-80-28-119.staticip.rima-tde.net) has joined #tryton09:54
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton10:14
-!- smarro(~sebastian@2800:af0:1028:8be::5) has joined #tryton10:34
-!- cappumuc(~bernhard@ppp-93-104-19-67.dynamic.mnet-online.de) has joined #tryton12:55
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton13:29
-!- sashasasha(12c247c4@gateway/web/freenode/ip.18.194.71.196) has joined #tryton13:30
-!- JanGB(~jan@nat3.hmt-leipzig.de) has left #tryton13:33
-!- thaneor(~lenovo3@179.26.122.34) has joined #tryton13:43
sashasashaHi. Does anyone know how to create table_query with left joins? The main issue is what returned id should be unique and i don't understand how to create unique id for each record in select(*columns).13:58
cedksashasasha: it depends of the type of join14:07
cedksashasasha: you must find something that is unique or compute a unique one14:07
cedksashasasha: if it is pairing that is needed, check http://szudzik.com/ElegantPairing.pdf14:09
sashasashacedk: Thank you for answer. I want to return query with 2 left joins in o2m fields. For example: party - contact mechanism - party_address.  If i have one party with 2 contact mechanisms and 2 addresses it is should be 4 records in result. And if i'm trying to set random id in columns [Literal(uuid.uuid4().int).as_('id')], within one party it turns out to be the same.14:19
sashasasha*the same id14:20
cedksashasasha: id can not be random, it must be deterministic14:23
cedksashasasha: so for what I see, you just need to pair ids from address and contact mechanism14:24
sashasashacedk: Sure, i have given uuid as an example. But it is doesn't works with left joins if party have empty address and contact mechanism. But I'll try again to make a paring with none14:27
cedksashasasha: then you need to apply twice the pairing, because you need to convert triple into integer14:43
sashasashacedk: Yes. I understand this. Sorry, I must have asked the question wrong. The main question: how to pass pairing function into select(*(columns)).15:03
cedksashasasha: you just write it as a SQL expression on the select part15:04
sashasashacedk: Got it. SQL expression via python_sql. Thank you.15:16
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton17:04
-!- JanGB(~jan@x2f7f80f.dyn.telefonica.de) has joined #tryton17:37
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton18:23
-!- mariomop(~quassel@host249.190-139-9.telecom.net.ar) has joined #tryton19:14
-!- thaneor1(~lenovo3@179.26.109.116) has joined #tryton19:35
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton20:00

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