diff --git a/manufacture_process_costing/__manifest__.py b/manufacture_process_costing/__manifest__.py index 81f49b46d..547a2b096 100755 --- a/manufacture_process_costing/__manifest__.py +++ b/manufacture_process_costing/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': 'Process Cost of Manufacturing Orders', - 'version': '16.0.1.0.1', + 'version': '16.0.1.0.0', 'category': 'Manufacturing', 'summary': """Manufacture Process Costing By Material Cost, Labour Cost and Overhead Cost""", @@ -41,6 +41,7 @@ 'depends': ['base', 'mrp'], 'data': [ 'security/ir.model.access.csv', + 'data/material_data.xml', 'views/res_config_settings_views.xml', 'views/mrp_bom_views.xml', 'views/mrp_production_views.xml', @@ -51,7 +52,7 @@ 'report/mrp_production_cost_reports.xml', 'report/mrp_production_cost_report_templates.xml', ], - 'images': ['static/description/banner.jpg'], + 'images': ['/static/description/banner.jpg'], 'license': 'LGPL-3', 'installable': True, 'auto_install': False, diff --git a/manufacture_process_costing/data/material_data.xml b/manufacture_process_costing/data/material_data.xml new file mode 100644 index 000000000..d8f4fcef9 --- /dev/null +++ b/manufacture_process_costing/data/material_data.xml @@ -0,0 +1,9 @@ + + + + + Quantity + 2 + + + diff --git a/manufacture_process_costing/doc/RELEASE_NOTES.md b/manufacture_process_costing/doc/RELEASE_NOTES.md index 080d82807..830bfb6ff 100755 --- a/manufacture_process_costing/doc/RELEASE_NOTES.md +++ b/manufacture_process_costing/doc/RELEASE_NOTES.md @@ -1,11 +1,6 @@ +## Module #### 2.12.2023 #### Version 16.0.1.0.0 #### ADD - Initial commit for Process Cost of Manufacturing Orders - - -#### 11.04.2024 -#### Version 16.0.1.0.1 -#### BUGFIX -- Added The costing of a manufacturing order if a manufacturing order is created through a sale order. \ No newline at end of file diff --git a/manufacture_process_costing/models/direct_material_cost.py b/manufacture_process_costing/models/direct_material_cost.py index 86a8e7eff..271a94195 100755 --- a/manufacture_process_costing/models/direct_material_cost.py +++ b/manufacture_process_costing/models/direct_material_cost.py @@ -20,6 +20,7 @@ # ############################################################################# from odoo import api, fields, models +from odoo.addons.base.models.decimal_precision import dp class DirectMaterialCost(models.Model): @@ -33,8 +34,9 @@ class DirectMaterialCost(models.Model): product_id = fields.Many2one('product.product', string='Product', help='Product required for the work') - planned_qty = fields.Integer(string='Planned Qty', - help='Planned minutes for the work') + planned_qty = fields.Float(string='Planned Qty', + help='Planned minutes for the work', + digits=dp.get_precision('Quantity')) uom_id = fields.Many2one('uom.uom', string='UoM', help="Unit of measure") cost_unit = fields.Float(string='Cost/Unit', diff --git a/manufacture_process_costing/models/mrp_bom.py b/manufacture_process_costing/models/mrp_bom.py index a75f20b45..b40358329 100755 --- a/manufacture_process_costing/models/mrp_bom.py +++ b/manufacture_process_costing/models/mrp_bom.py @@ -59,7 +59,7 @@ class MrpBom(models.Model): 'product_id': rec.product_id.id, 'planned_qty': rec.product_qty, 'uom_id': rec.product_id.uom_id.id, - 'cost_unit': rec.product_id.standard_price, + 'cost_unit': rec.product_id.lst_price, }) for rec in self.bom_line_ids] }) diff --git a/manufacture_process_costing/models/mrp_production.py b/manufacture_process_costing/models/mrp_production.py index bca587def..46699bac0 100755 --- a/manufacture_process_costing/models/mrp_production.py +++ b/manufacture_process_costing/models/mrp_production.py @@ -82,49 +82,6 @@ class MrpProduction(models.Model): 'res_id': reason.id, } - @api.model_create_multi - def create(self, vals_list): - """Writes data to material_cost_ids, labour_cost_ids and - overhead_cost_ids when change in bom_id""" - res = super().create(vals_list) - res.write({'material_cost_ids': [(5, 0)]}) - res.write({ - 'material_cost_ids': [ - (0, 0, { - 'production_material_id': res.id, - 'material_cost_id': res.bom_id.id, - 'product_id': rec.product_id.id, - 'planned_qty': rec.planned_qty, - 'uom_id': rec.uom_id.id, - 'cost_unit': rec.cost_unit, - }) for rec in res.bom_id.material_cost_ids] - }) - res.write({'labour_cost_ids': [(5, 0)]}) - res.write({ - 'labour_cost_ids': [ - (0, 0, { - 'production_labour_id': res.id, - 'labour_cost_id': rec.id, - 'operation': rec.operation, - 'work_center_id': rec.work_center_id.id, - 'planned_minute': rec.planned_minute, - 'cost_minute': rec.cost_minute, - }) for rec in res.bom_id.labour_cost_ids] - }) - res.write({'overhead_cost_ids': [(5, 0)]}) - res.write({ - 'overhead_cost_ids': [ - (0, 0, { - 'production_overhead_id': res.id, - 'overhead_cost_id': rec.id, - 'operation': rec.operation, - 'work_center_id': rec.work_center_id.id, - 'planned_minute': rec.planned_minute, - 'cost_minute': rec.cost_minute, - }) for rec in res.bom_id.overhead_cost_ids] - }) - return res - @api.onchange('bom_id') def _onchange_bom_id(self): """Writes data to material_cost_ids, labour_cost_ids and