[18.0][MIG] stock_available_mrp: Migration to 18.0#68
Conversation
c460a23 to
46b084b
Compare
|
/ocabot migration stock_available_mrp |
5151f39 to
093f7a0
Compare
ellbristow
left a comment
There was a problem hiding this comment.
This caused problems for one of our customers who send the immediately usable quantity to Magento via EDI and it was sending the wrong stock figures.
| ) | ||
|
|
||
| res[product.id]["potential_qty"] = potential_qty | ||
| res[product.id]["immediately_usable_qty"] += potential_qty |
There was a problem hiding this comment.
In the case of Kits this is wrong. Odoo already includes the buildable quantity upstream, so this modification is adding additional stock (double counting the Available stock). By returning this to = and limiting this to Kits, both kits and manufactured show the correct Available qty.
| res[product.id]["immediately_usable_qty"] += potential_qty | |
| if bom_id.type == "phantom": | |
| res[product.id]["immediately_usable_qty"] = potential_qty |
There was a problem hiding this comment.
Apologies for the late response and thank you very much for suggesting the fix. Added in a separate commit.
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Compute potential quantities for both product templates and variants. To keep the code simple, only the biggest potential of any single variant is accounted for in the template's potential. Take all levels of phantom BoM into account, respects validity dates etc. thanks to the use of the standard method _bom_explode, as suggested by @gdgellatly in OCA/stock-logistics-warehouse#5 (comment) Improve tests, rewritten in python. Adhere to new file/manifest/README conventions. Simplify copyright headers
sudo is not required since mrp.bom are readable to groups with access to the qty_x fields on a product. Moreover using sudo to retrive the bom will ignore the company_id defined on the bom
Record rules used to not be checked on stock quants, but now they are since Odoo's commit 2fd14db57433d08ab368a7e18d18ae8d49dafab1 (odoo/odoo@2fd14db). In our test we changed the company of the products and BoMs but we neglected that the stock was not attached to the right company, and that made the test fail. To fix that, make the test inventory for the right company. Since there is a little inconsistency in the demo data with a negative quantity of an unrelated product, use the `partial` filter for the inventories instead of the `none` filter, so that no wrong inventory lines are added automatically.
…ch field use to compute potential
…ew + small improvements
Currently translated at 100.0% (5 of 5 strings) Translation: stock-logistics-warehouse-15.0/stock-logistics-warehouse-15.0-stock_available_mrp Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_available_mrp/ca/
Currently translated at 100.0% (10 of 10 strings) Translation: stock-logistics-availability-16.0/stock-logistics-availability-16.0-stock_available_mrp Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-availability-16-0/stock-logistics-availability-16-0-stock_available_mrp/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-availability-16.0/stock-logistics-availability-16.0-stock_available_mrp Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-availability-16-0/stock-logistics-availability-16-0-stock_available_mrp/
Currently translated at 100.0% (2 of 2 strings) Translation: stock-logistics-availability-16.0/stock-logistics-availability-16.0-stock_available_mrp Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-availability-16-0/stock-logistics-availability-16-0-stock_available_mrp/es/
Currently translated at 100.0% (2 of 2 strings) Translation: stock-logistics-availability-16.0/stock-logistics-availability-16.0-stock_available_mrp Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-availability-16-0/stock-logistics-availability-16-0-stock_available_mrp/it/
When a BoM is linked just to one variant through field `product_id`, it is taken in account when computing stock of the rest of variants of the same template.
Currently translated at 100.0% (6 of 6 strings) Translation: stock-logistics-availability-17.0/stock-logistics-availability-17.0-stock_available_mrp Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-availability-17-0/stock-logistics-availability-17-0-stock_available_mrp/it/
…ble_qty instead of replacing it
806bb22 to
7c1e45c
Compare
…ameters The configuration parameter in which the field to use was stored was actually not used. Instead, another configuration parameter, for which a default value was provided in xml data was used.
Use variant-specific BoMs when computing potential stock, including nested phantom BoMs, instead of selecting the first template BoM.
779397f to
7f0c794
Compare
… for kit products Co-authored-by: Elliott Bristow <elliott@glo.systems>
7f0c794 to
728d4b3
Compare
Superseding #38