Commit Graph

16 Commits

Author SHA1 Message Date
david
beddc64941 [FIX] stock_available_mrp: normal BoM available to promise
Normal BoM products (those which are manufactured) are regular stored
products and their immediately_usable_qty will be summed with potential
stock. This was the expected behavior of the module and it was lost at
some point.

Phantom BoM products (kits) don't have real stock so their available to
promise quantity will be the same as the potential.

As an improvement, we've added the possibility to override the sum of
potential and available to promise. In some cases such addition doesn't
make sense as we don't know how long can take to manufacture those potential
units.

TT35589
2022-04-06 10:25:44 +02:00
Denis Roussel
2e8c5397e6 [TESTS] stock_available_mrp: Add test for phantom bom 2022-02-28 16:53:42 +01:00
david
a47492f645 [FIX] stock_available_mrp: non storable components
If a Bill of Materials contains a non storable component (consumable or
even service) the potential quantity will allways be 0. We should only
consider storable components as others are considered infinite.

TT33175
2021-12-01 19:10:58 +01:00
Víctor Martínez
6ad6a36495 [MIG] stock_available_mrp: Migration to 13.0 2021-05-19 16:40:46 +02:00
Víctor Martínez
84a04a66d0 [IMP] stock_available_mrp: black, isort, prettier 2021-05-13 16:17:07 +02:00
david
5d4a56bcb5 [FIX] stock_available_mrp: don't force type
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
2021-05-13 16:16:30 +02:00
david
bccb73635e [FIX] stock_available_mrp: upstream compatibility
After this change 3d34d58388
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.
2021-05-13 16:16:30 +02:00
Florian da Costa
779c73a3ae Migrate stock_available_mrp to v12 2021-05-13 16:16:30 +02:00
Timon Tschanz
6a444a5bcc [11.0][MIG] port stock_available_mrp to 11.0 2021-05-13 16:16:30 +02:00
Cédric Pigeon
42470f1f3b [10.0][MIG] port stock_available_mrp to 10.0 2021-05-13 16:16:30 +02:00
Cyril Gaudin
c57208670a V9 migration modifications.
* mrp_bom.name has been deleted.
    * mrp_bom_line.type moved to mrp_bom.type.
    * Fix missing group_mrp_user issue.
    * Change versions
2021-05-13 16:16:30 +02:00
Cyril Gaudin
4d2b9567e7 [FIX+IMP] stock_available_mrp: fix recursive potential_qty in list view + small improvements 2021-05-13 16:16:30 +02:00
Cyril Gaudin
3801d3481c stock_available_mrp: fix BOM qty (multi-units, efficiency) 2021-05-13 16:16:30 +02:00
Lionel Sausin
09cf0cc3f2 [FIX] fix multi-company test
Record rules used to not be checked on stock quants, but now they are since Odoo's commit 2fd14db57433d08ab368a7e18d18ae8d49dafab1 (https://github.com/odoo/odoo/commit/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.
2021-05-13 16:16:30 +02:00
Laurent Mignon (ACSONE)
92de1c7455 [FIX] Browse mrp.bom as current user
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
2021-05-13 16:16:30 +02:00
Lionel Sausin
e13f22c1ca [MIGR] stock_available_mrp: migrate to v8
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 https://github.com/OCA/stock-logistics-warehouse/pull/5#issuecomment-66902191
Improve tests, rewritten in python.
Adhere to new file/manifest/README conventions.
Simplify copyright headers
2021-05-13 16:16:30 +02:00