[FIX] mrp: display the BoM overview of the current product variant
Stpes to reproduce the bug:
- Create a storable product “P1” with 2 variants:
- Color: Red and blue in this order
- Create a BoM for each variant
- Create a SO:
- select the product “P1 - blue” → the second variant
- Click on the forecast button → manufacturing forecast
Problem:
The BoM overview is showing the wrong product variation because it pulls
the default BoM of the base product (always the first variant from the
list)
opw-3166074
closes odoo/odoo#115421
X-original-commit: 873d6d921c3955b707d10826a898ae405f296531
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
This commit is contained in:
@@ -8,8 +8,8 @@ patch(ForecastedButtons.prototype, 'mrp.ForecastedButtons',{
|
||||
setup() {
|
||||
this._super.apply();
|
||||
onWillStart(async () =>{
|
||||
const res = await this.orm.call(this.resModel, 'read', [this.productId], {fields: ['bom_ids']});
|
||||
this.bomId = res[0].bom_ids && res[0].bom_ids[0];
|
||||
const res = (await this.orm.call(this.resModel, 'read', [this.productId], {fields: ['bom_ids', 'variant_bom_ids']}))[0];
|
||||
this.bomId = res.variant_bom_ids[0] || res.bom_ids[0];
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user