Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0] [MIG] stock_available_mrp: Migration to 17.0 #24

Draft
wants to merge 68 commits into
base: 17.0
Choose a base branch
from

Conversation

bizzappdev
Copy link

No description provided.

sbidoul and others added 30 commits May 10, 2024 10:57
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.
    * mrp_bom.name has been deleted.
    * mrp_bom_line.type moved to mrp_bom.type.
    * Fix missing group_mrp_user issue.
    * Change versions
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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/
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
Cédric Pigeon and others added 23 commits May 10, 2024 10:57
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-14.0/stock-logistics-warehouse-14.0-stock_available_mrp
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_available_mrp/
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/
@bizzappdev bizzappdev force-pushed the 17.0-mig-stock_available_mrp-BAD branch from cbccdab to f803099 Compare May 20, 2024 12:08
@bizzappdev bizzappdev marked this pull request as ready for review May 20, 2024 14:48
@rpinset rpinset mentioned this pull request Jun 28, 2024
6 tasks
@rpinset
Copy link
Member

rpinset commented Jun 28, 2024

hello @bizzappdev
I tested your branch and offer you a fix in order to correctly recover the ir.config.parameter
BizzAppDev-Systems#1

Couldn't there be a calculation problem?
The immediately_usable_qty field only gives the potential quantity.
image

Shouldn't this be "stock in hand + potential_qty" in order to have our stock of finished product already available increased by that which can be manufactured?

@bizzappdev
Copy link
Author

@rpinset thank you for the review, and MR
IMO, your proposed MR is a partial fix, which will create a problem for the Migrated database problem.
But for sure, a fix is needed.
Right now, we have a bug in the migration script, which we will have to fix.
Soon, we will do the new fix commit.

@bizzappdev bizzappdev marked this pull request as draft June 28, 2024 10:53
@rpinset
Copy link
Member

rpinset commented Jun 28, 2024

BizzAppDev-Systems#2

this is a suggestion to modify the migration script
because if the key is not stock_available_mrp.stock_available_mrp_based_on then the calculation is not done according to the desired config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.