From 1688ab82837d45e4eb56d75f75a6d87ced41b904 Mon Sep 17 00:00:00 2001 From: PauBForgeFlow Date: Fri, 15 Sep 2023 16:19:57 +0200 Subject: [PATCH] [MIG] mrp_flattened_bom_xlsx_subcontracting_cost: Migration to 16.0 --- .../__manifest__.py | 2 +- .../models/mrp_bom.py | 10 +++------- test-requirements.txt | 3 +++ 3 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 test-requirements.txt diff --git a/mrp_flattened_bom_xlsx_subcontracting_cost/__manifest__.py b/mrp_flattened_bom_xlsx_subcontracting_cost/__manifest__.py index 0d69872b..d24564b9 100644 --- a/mrp_flattened_bom_xlsx_subcontracting_cost/__manifest__.py +++ b/mrp_flattened_bom_xlsx_subcontracting_cost/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Export Flattened BOM to Excel with subcontracting cost", - "version": "14.0.1.0.0", + "version": "16.0.1.0.0", "category": "Manufacturing", "author": "ForgeFlow, Odoo Community Association (OCA)", "website": "https://github.com/OCA/manufacture-reporting", diff --git a/mrp_flattened_bom_xlsx_subcontracting_cost/models/mrp_bom.py b/mrp_flattened_bom_xlsx_subcontracting_cost/models/mrp_bom.py index 7c9c63b0..323fc6f7 100644 --- a/mrp_flattened_bom_xlsx_subcontracting_cost/models/mrp_bom.py +++ b/mrp_flattened_bom_xlsx_subcontracting_cost/models/mrp_bom.py @@ -3,18 +3,14 @@ from odoo import fields, models -from odoo.addons import decimal_precision as dp - -UNIT = dp.get_precision("Product Price") - class MrpBom(models.Model): _inherit = "mrp.bom" subcontracting_cost = fields.Float( - string="Subcontracting Cost", + string="Subcontracting Costs", compute="_compute_subcontracting_cost", - digits=UNIT, + digits="Product Price", ) def _compute_subcontracting_cost(self): @@ -23,7 +19,7 @@ def _compute_subcontracting_cost(self): if bom.type == "subcontract" and bom.subcontractor_ids: supplier_info = supplier_info_obj.search( [ - ("name", "=", bom.subcontractor_ids[0].id), + ("partner_id", "=", bom.subcontractor_ids[0].id), ("product_tmpl_id", "=", bom.product_tmpl_id.id), ], limit=1, diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..d19a322a --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ +odoo-addon-mrp_flattened_bom_xlsx_direct_materials_cost@git+https://github.com/OCA/manufacture-reporting.git@refs/pull/116/head#subdirectory=setup/mrp_flattened_bom_xlsx_direct_materials_cost +odoo-addon-mrp_flattened_bom_xlsx@git+https://github.com/OCA/manufacture-reporting.git@refs/pull/112/head#subdirectory=setup/mrp_flattened_bom_xlsx +odoo-addon-report_xlsx@git+https://github.com/OCA/reporting-engine.git@16.0#subdirectory=setup/report_xlsx