Browse Source

Apr 17 [UPDT] : Bug Fixed 'manufacture_process_costing'

pull/278/merge
AjmalCybro 1 year ago
parent
commit
919d12bfa6
  1. 2
      manufacture_process_costing/__manifest__.py
  2. 7
      manufacture_process_costing/doc/RELEASE_NOTES.md
  3. 2
      manufacture_process_costing/models/mrp_bom.py
  4. 43
      manufacture_process_costing/models/mrp_production.py

2
manufacture_process_costing/__manifest__.py

@ -21,7 +21,7 @@
#############################################################################
{
'name': 'Process Cost of Manufacturing Orders',
'version': '16.0.1.0.0',
'version': '16.0.1.0.1',
'category': 'Manufacturing',
'summary': """Manufacture Process Costing By Material Cost, Labour Cost and
Overhead Cost""",

7
manufacture_process_costing/doc/RELEASE_NOTES.md

@ -1,6 +1,11 @@
## Module <manufacture_process_costing>
#### 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.

2
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.lst_price,
'cost_unit': rec.product_id.standard_price,
}) for rec in self.bom_line_ids]
})

43
manufacture_process_costing/models/mrp_production.py

@ -82,6 +82,49 @@ 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

Loading…
Cancel
Save