summaryrefslogtreecommitdiff
path: root/doc/python3.rst
diff options
context:
space:
mode:
authorAdrien Widart <awt@odoo.com>2020-12-29 15:07:36 +0000
committerAdrien Widart <awt@odoo.com>2021-01-11 09:30:01 +0000
commit609e2f4427082431b56aa8f999d74ed9d39db653 (patch)
tree3e037e50c6e4a6644651832a44265b0ad41b3d34 /doc/python3.rst
parent6c199562ecce5d08bc5d971a920a20756f3cb098 (diff)
[FIX] mrp: reordering rules for BoM product
When running the scheduler, if one of the concerned product is a kit, it will always generate a RfQ for the components, even if there are already enough of them. To reproduce the error: (Need purchase) 1. Create 2 products P and P_compo - Both must be storable products - P_compo must have at least one vendor 2. Go on P-product page 3. Add a reordering rule (e.g., min: 5 and max: 10) 4. Add a BoM - Must be a Kit - Add P_compo to components 5. Inventory > Operations > Run Scheduler 6. Go to Purchase, find the generated RfQ 7. Confirm the order, Receive Products, Validate 8. Go on P-product's page - As you can see, you have enough P-products on hand 9. Repeat steps 5-6 => You should not find any RfQ since you already have enough P-products. When checking the P-product's page, you can see the correct quantity on hand because it uses the `_compute_quantities` method and this one has been overridden in the mrp-module so a kit will be correctly computed. However, when running the scheduler, it uses another method to get the current quantities: `_compute_quantities_dict`. Since this method has not been overridden in mrp-module, it will use the basic implementation and this one does not consider the possibility for a product to be a kit. This fix creates an override of `_compute_quantities_dict` so it can compute the correct quantities of products with 'phantom' as BoM type. Moreover, for the code to be simpler and clearer, thix fix also merges `_compute_quantities` and the new `_compute_quantities_dict`. OPW-2421841 closes odoo/odoo#64277 X-original-commit: de40662a1853b99856ebb2138baa37fc05cc00e8 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'doc/python3.rst')
0 files changed, 0 insertions, 0 deletions