IRC logs of #tryton for Thursday, 2022-09-22

irc.libera.chat #tryton log beginning Thu Sep 22 12:00:01 AM CEST 2022
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton22:10
-!- springwurm(~springwur@5.104.149.54) has joined #tryton05:38
-!- mrichez(~Maxime@mail.saluc.com) has joined #tryton06:21
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton06:41
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:53
-!- ChanServ changed mode/#tryton -> +o cedk 06:53
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton06:55
mrichezHi, in the client you can easily find a lot doing a relate on lot number and choosing "Locations List Quantity" to get all the locations and the quantities of this lot. How to do such thing in code ? We have a route for an api. User give the lot number, api should return locations and quantities (a sort of "Product_by_locations", but in this case it would be "Locations_by_lot" ;-) )07:12
cedkmrichez: you can use product_by_locations with grouping by lot and filtered by a list of lots07:14
mrichezcedk: ok thanks :-)07:15
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton07:36
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton07:48
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton08:20
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton10:32
-!- springwurm(~springwur@5.104.149.54) has joined #tryton12:12
mrichezcedk: i did what you suggest with product_by_locations but i thought i'll have the locations with the quantities when doing products_by_location on storage zone with childs. I'm just getting the whole quantity. What i'm expecting is getting each locations with lot and the quantity (like for the relate)12:48
cedkmrichez: if you want to group by lot, you must add 'lot' to grouping12:52
cedkmrichez: like it is done in the stock_lot module test12:53
mrichezcedk: that's what i did 12:53
mrichezcedk: https://pastebin.com/qBSG83Ke12:54
mrichezbut i'm doing products_by_location on storage_zone (because we have a lot of locations). Result i was expecting is each child location with lot quantity (like for the relate)12:55
mrichezcedk: here, i'm just getting storage_zone, product, lot  : quantity total12:55
mrichezcedk: i was hoping location1: qty1 , location2: qty2, ...12:57
cedkmrichez: you must pass the location_ids you want13:05
mrichezcedk: i don't know the locations... i could be in any location (2000 locations) .. so my question.. how to reproduce the relate that display locations and quantity on lot ? (is this relate doing a loop on each location ?)13:08
cedkmrichez: the view is only for 1 lot, so you can browse/search the location with the proper lot in the context13:09
cedkor you have to pass all the location ids if you want to search for many lots13:10
mrichezcedk: my search is for 1 lot13:10
mrichezcedk: which view are you talking ? 13:26
-!- rpit(~rpit@p200300c88f07c3004b32d530ec5a8be7.dip0.t-ipconnect.de) has joined #tryton13:34
mrichezcedk: ok, i think i've found13:43
mrichezcedk: yes :-)13:56
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton18:50

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