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