[18.0][MIG] stock_available_mrp: Migration to 18.0#68
Open
StefanRijnhart wants to merge 56 commits intoOCA:18.0from
Open
[18.0][MIG] stock_available_mrp: Migration to 18.0#68StefanRijnhart wants to merge 56 commits intoOCA:18.0from
StefanRijnhart wants to merge 56 commits intoOCA:18.0from
Conversation
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
* mrp_bom.name has been deleted.
* mrp_bom_line.type moved to mrp_bom.type.
* Fix missing group_mrp_user issue.
* Change versions
…recordset + Condition never statisfied
…of immediately usable qty
c10521e to
b9a501a
Compare
…ilable_immediately
Currently translated at 100.0% (7 of 7 strings) Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_available_mrp Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_available_mrp/zh_CN/
Currently translated at 100.0% (7 of 7 strings) Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_available_mrp Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_available_mrp/fr/
After this change odoo/odoo@3d34d58 it isn't possible to have an storable kit product anymore. The main issue is that we have to drop some uses cases that this module considered for this kind of situations.
In Odoo change odoo/odoo@3d34d58 the products with Kit BoMs couldn't longer be other than `consu`. This was reverted in odoo/odoo@6c4623a and some products are raising errors when forcing the type
b9a501a to
025b0e7
Compare
025b0e7 to
34dbfec
Compare
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
c460a23 to
46b084b
Compare
Member
Author
|
/ocabot migration stock_available_mrp |
224cb3c to
eb9b6df
Compare
eb9b6df to
5151f39
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.
5151f39 to
093f7a0
Compare
ellbristow
suggested changes
Feb 6, 2026
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.
Suggested change
| res[product.id]["immediately_usable_qty"] += potential_qty | |
| if bom_id.type == "phantom": | |
| res[product.id]["immediately_usable_qty"] = potential_qty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseding #38