From ba450b568f4d63b2a224593ba1a17d2b240fe041 Mon Sep 17 00:00:00 2001 From: clesgow Date: Thu, 10 Nov 2022 16:32:04 +0000 Subject: [PATCH] [FIX] mrp: Allow leaving the BOM Overview Typo made the call to `this.changeFolded` instead of `this.props.changeFolded`. As it couldn't be found in the unmount, it raised an error each time the user tried to leave the report. Steps to reproduce : Go to MRP -> Products -> Bill of Materials -> Any BoM -> Overview -> Go anywhere else than the report. Also got rid of the now useless `this.bus` in the main overview component. opw-3061658 closes odoo/odoo#105773 X-original-commit: c22e7a2a245ce98654a4d99a663c555bedfee165 Signed-off-by: Tiffany Chang --- .../mrp/static/src/components/bom_overview/mrp_bom_overview.js | 1 - .../bom_overview_extra_block/mrp_bom_overview_extra_block.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/mrp/static/src/components/bom_overview/mrp_bom_overview.js b/addons/mrp/static/src/components/bom_overview/mrp_bom_overview.js index 516a50f3549..c3992222016 100644 --- a/addons/mrp/static/src/components/bom_overview/mrp_bom_overview.js +++ b/addons/mrp/static/src/components/bom_overview/mrp_bom_overview.js @@ -11,7 +11,6 @@ export class BomOverviewComponent extends Component { setup() { this.orm = useService("orm"); this.actionService = useService("action"); - this.bus = new EventBus(); this.variants = []; this.warehouses = []; diff --git a/addons/mrp/static/src/components/bom_overview_extra_block/mrp_bom_overview_extra_block.js b/addons/mrp/static/src/components/bom_overview_extra_block/mrp_bom_overview_extra_block.js index b67cb0aa54f..49e6a5daf28 100644 --- a/addons/mrp/static/src/components/bom_overview_extra_block/mrp_bom_overview_extra_block.js +++ b/addons/mrp/static/src/components/bom_overview_extra_block/mrp_bom_overview_extra_block.js @@ -25,7 +25,7 @@ export class BomOverviewExtraBlock extends Component { onWillUnmount(() => { // Need to notify main component that the block was folded so it doesn't appear on the PDF. - this.changeFolded({ ids: [this.identifier], isFolded: true }); + this.props.changeFolded({ ids: [this.identifier], isFolded: true }); }); }