Skip to content

Commit

Permalink
[MIG] mrp_flattened_bom_xlsx_subcontracting_cost: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PauBForgeFlow committed Sep 15, 2023
1 parent 02b24c8 commit 1688ab8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mrp_flattened_bom_xlsx_subcontracting_cost/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 3 additions & 7 deletions mrp_flattened_bom_xlsx_subcontracting_cost/models/mrp_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -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/[email protected]#subdirectory=setup/report_xlsx

0 comments on commit 1688ab8

Please sign in to comment.