IRC logs of #tryton for Wednesday, 2018-04-18

chat.freenode.net #tryton log beginning Wed Apr 18 00:00:01 CEST 2018
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton00:04
-!- csotelo(~csotelo@2001:1388:49c7:1730:eab8:aa87:d997:d3dc) has joined #tryton02:04
-!- yangoon(~mathiasb@i59F52E4D.versanet.de) has joined #tryton04:04
-!- cdchapman(~perturbed@73.98.169.161) has joined #tryton07:04
-!- JanGB(~jan@ip5f5b2f5d.dynamic.kabel-deutschland.de) has joined #tryton07:04
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton08:04
-!- rpit(~rpit@p200300C88F31270056EE75FFFE0DD3C7.dip0.t-ipconnect.de) has joined #tryton08:04
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton09:04
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:04
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton09:04
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton09:04
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:04
-!- nicoe(~nicoe@2a02:578:858c:500:ee55:f9ff:fe7b:f7ac) has joined #tryton09:04
-!- JanGB(~jan@ip5f5b2f5d.dynamic.kabel-deutschland.de) has joined #tryton10:04
mrichezpokoli: back with my yesterday problem... solved. It was indeed idempotency problem on the id generation. So another question, what's the best way to generate a unique id with a view (i'm using row_number)11:04
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton11:04
pokolimrichez: normally it depends on the data you are generating, for example if you are grouping by month and year, it's a good idea to include both parameters as part of the id11:04
pokolimrichez: union mixxin uses a good patern for generting unique ids: http://hg.tryton.org/trytond/file/5ec91aa9c4c7/trytond/model/union.py#l1711:04
mrichezpokoli: in my case, it's location_id, product_id and lot_id... id is generated in the query11:04
pokolimrichez: Then I will use the union mixin pattern to combine the tree ids and generate and always unique ide11:04
pokolimrichez: sorry if you are grouping the union mixin pattern won't work. But you can multiply by the total lenght of records11:04
mrichezpokoli: data from my model are from an sql view (probably not the really best way to develop with tryton), so my question is more about postgresql and the way to get a unique id... row_number seems correct, but it was just to know if someone do it a better way (may be i should ask question in dev forum?)11:04
pokolimrichez: Indeed a table_query is moreless the same as a sql view11:04
pokolimrichez: you may as in the dev forum, but I don't think we can find a solution that works for all cases11:04
mrichezpokoli: ok... let's say my custom module is a temporary solution, waiting to do better using tryton model (product/lot quantity by location)11:04
cedkmrichez: indeed what you need is a bijection between 3 dimension into 1 dimension12:04
cedkI know this one which is pretty efficient for 2d: http://szudzik.com/ElegantPairing.pdf12:04
cedkindeed you could apply the transformation to the couple location_id, product_id and apply a second time on the result, lot_id12:04
cedknot sure it will be very efficient12:04
cedkmrichez: by the way are you sure you need the product_id? lot_id are linked to a single product_id12:04
cedkso you could use only location_id, lot_id12:04
mrichezcedk: but product may have no lot_id12:04
mrichezcedk: so my query is returning product having lot or not12:04
mrichezcedk: will read your pdf12:04
cedkmrichez: so maybe you can use a convention: positive id for product and negative id for lot_id like that you have a single id for both12:04
mrichezcedk: indeed12:04
cedkmrichez: or you create two views for each case12:04
mrichezcedk: maybe, but prefer to have all on the same view... i'm using relate on variant to get my quantity view by location12:04
mrichezthanks to both of you pokoli and cedk for helping me !12:04
-!- JanGB(~jan@x59cc89f8.dyn.telefonica.de) has joined #tryton12:04
-!- JanGB(~jan@x59cc89f8.dyn.telefonica.de) has joined #tryton12:04
-!- mariomop(~quassel@181.88.200.117) has joined #tryton12:04
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton13:04
-!- LordVan(~LordVan@gentoo/developer/LordVan) has joined #tryton14:04
-!- csotelo(~csotelo@179.43.97.56) has joined #tryton15:04
-!- lukio(~lukio@host126.186-109-85.telecom.net.ar) has joined #tryton15:04
-!- JanGB(~jan@ip5f5b0aa4.dynamic.kabel-deutschland.de) has joined #tryton17:04
-!- cdchapman(~perturbed@73.98.169.212) has joined #tryton17:04
-!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton17:04
-!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton17:04
-!- lukio(~lukio@iplan.gcoop.com.ar) has joined #tryton18:04
-!- Telesight(~anthony@4dae0c97.ftth.telfortglasvezel.nl) has joined #tryton19:04
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton19:04
-!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton19:04
-!- JanGB(~jan@x2f7fbb5.dyn.telefonica.de) has joined #tryton19:04
-!- JanGB(~jan@ip5f5b2f5d.dynamic.kabel-deutschland.de) has joined #tryton20:04
-!- zmijunkie(~Adium@i577B5566.versanet.de) has joined #tryton21:04
-!- semarie_(~semarie@unaffiliated/semarie) has joined #tryton22:04
-!- lukio(~lukio@host241.190-137-235.telecom.net.ar) has joined #tryton22:04

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