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 #tryton | 22:10 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 05:38 | |
-!- mrichez(~Maxime@mail.saluc.com) has joined #tryton | 06:21 | |
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton | 06:41 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 06:53 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 06:53 | |
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton | 06:55 | |
mrichez | Hi, 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 |
---|---|---|
cedk | mrichez: you can use product_by_locations with grouping by lot and filtered by a list of lots | 07:14 |
mrichez | cedk: ok thanks :-) | 07:15 |
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton | 07:36 | |
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton | 07:48 | |
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton | 08:20 | |
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton | 10:32 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 12:12 | |
mrichez | cedk: 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 |
cedk | mrichez: if you want to group by lot, you must add 'lot' to grouping | 12:52 |
cedk | mrichez: like it is done in the stock_lot module test | 12:53 |
mrichez | cedk: that's what i did | 12:53 |
mrichez | cedk: https://pastebin.com/qBSG83Ke | 12:54 |
mrichez | but 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 |
mrichez | cedk: here, i'm just getting storage_zone, product, lot : quantity total | 12:55 |
mrichez | cedk: i was hoping location1: qty1 , location2: qty2, ... | 12:57 |
cedk | mrichez: you must pass the location_ids you want | 13:05 |
mrichez | cedk: 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 |
cedk | mrichez: the view is only for 1 lot, so you can browse/search the location with the proper lot in the context | 13:09 |
cedk | or you have to pass all the location ids if you want to search for many lots | 13:10 |
mrichez | cedk: my search is for 1 lot | 13:10 |
mrichez | cedk: which view are you talking ? | 13:26 |
-!- rpit(~rpit@p200300c88f07c3004b32d530ec5a8be7.dip0.t-ipconnect.de) has joined #tryton | 13:34 | |
mrichez | cedk: ok, i think i've found | 13:43 |
mrichez | cedk: yes :-) | 13:56 |
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton | 18:50 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!