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 #tryton22:20
-!- csotelo(~csotelo@2001:1388:49c7:1730:eab8:aa87:d997:d3dc) has joined #tryton00:41
-!- yangoon(~mathiasb@i59F52E4D.versanet.de) has joined #tryton02:58
-!- cdchapman(~perturbed@73.98.169.161) has joined #tryton05:09
-!- JanGB(~jan@ip5f5b2f5d.dynamic.kabel-deutschland.de) has joined #tryton05:38
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton06:14
-!- rpit(~rpit@p200300C88F31270056EE75FFFE0DD3C7.dip0.t-ipconnect.de) has joined #tryton06:33
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton07:02
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton07:02
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton07:03
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton07:06
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton07:17
-!- nicoe(~nicoe@2a02:578:858c:500:ee55:f9ff:fe7b:f7ac) has joined #tryton07:55
-!- JanGB(~jan@ip5f5b2f5d.dynamic.kabel-deutschland.de) has joined #tryton08:47
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)09:24
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton09:25
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 id09:27
pokolimrichez: union mixxin uses a good patern for generting unique ids: http://hg.tryton.org/trytond/file/5ec91aa9c4c7/trytond/model/union.py#l1709:29
mrichezpokoli: in my case, it's location_id, product_id and lot_id... id is generated in the query09:30
pokolimrichez: Then I will use the union mixin pattern to combine the tree ids and generate and always unique ide09:32
pokolimrichez: sorry if you are grouping the union mixin pattern won't work. But you can multiply by the total lenght of records09:34
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?)09:41
pokolimrichez: Indeed a table_query is moreless the same as a sql view09:46
pokolimrichez: you may as in the dev forum, but I don't think we can find a solution that works for all cases09:47
mrichezpokoli: ok... let's say my custom module is a temporary solution, waiting to do better using tryton model (product/lot quantity by location)09:49
cedkmrichez: indeed what you need is a bijection between 3 dimension into 1 dimension10:00
cedkI know this one which is pretty efficient for 2d: http://szudzik.com/ElegantPairing.pdf10:01
cedkindeed you could apply the transformation to the couple location_id, product_id and apply a second time on the result, lot_id10:03
cedknot sure it will be very efficient10:03
cedkmrichez: by the way are you sure you need the product_id? lot_id are linked to a single product_id10:03
cedkso you could use only location_id, lot_id10:04
mrichezcedk: but product may have no lot_id10:04
mrichezcedk: so my query is returning product having lot or not10:04
mrichezcedk: will read your pdf10:06
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 both10:06
mrichezcedk: indeed10:07
cedkmrichez: or you create two views for each case10:08
mrichezcedk: maybe, but prefer to have all on the same view... i'm using relate on variant to get my quantity view by location10:11
mrichezthanks to both of you pokoli and cedk for helping me !10:12
-!- JanGB(~jan@x59cc89f8.dyn.telefonica.de) has joined #tryton10:34
-!- JanGB(~jan@x59cc89f8.dyn.telefonica.de) has joined #tryton10:49
-!- mariomop(~quassel@181.88.200.117) has joined #tryton10:59
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton11:00
-!- LordVan(~LordVan@gentoo/developer/LordVan) has joined #tryton12:59
-!- csotelo(~csotelo@179.43.97.56) has joined #tryton13:20
-!- lukio(~lukio@host126.186-109-85.telecom.net.ar) has joined #tryton13:34
-!- JanGB(~jan@ip5f5b0aa4.dynamic.kabel-deutschland.de) has joined #tryton15:13
-!- cdchapman(~perturbed@73.98.169.212) has joined #tryton15:33
-!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton15:53
-!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton15:58
-!- lukio(~lukio@iplan.gcoop.com.ar) has joined #tryton16:13
-!- Telesight(~anthony@4dae0c97.ftth.telfortglasvezel.nl) has joined #tryton17:10
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton17:20
-!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton17:46
-!- JanGB(~jan@x2f7fbb5.dyn.telefonica.de) has joined #tryton17:56
-!- JanGB(~jan@ip5f5b2f5d.dynamic.kabel-deutschland.de) has joined #tryton18:53
-!- zmijunkie(~Adium@i577B5566.versanet.de) has joined #tryton19:45
-!- semarie_(~semarie@unaffiliated/semarie) has joined #tryton20:01
-!- lukio(~lukio@host241.190-137-235.telecom.net.ar) has joined #tryton20:10

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