Steps to reproduce the bug:
- Create a BOM:
- Set the quantity of the finished product and component as more than 1
- Save > Go to BOM Structure & Cost > the quantity in the input is set on 3
- Print
Problem:
The report generated shows the qty and cost for production of 1 unit of product, regardless of the BOM quantity set in the input
The "_onClickPrint" function tries to get the quantity of the bom in the context,
but since the value of "this.given_context.searchQty" is null, the function will use the default value of 1.
The "searchQty" is only set in the "onchange", so we can manually trigger it when initiating the page so that the "searchQty" is set correctly
opw-2691632
closesodoo/odoo#80524
X-original-commit: dcd3de94f708425ca06527483cf30e21077caab0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>