Browse Source

Aug 31: [FIX] Bug Fixed 'manufacture_process_costing'

pull/332/merge
Cybrosys Technologies 8 months ago
parent
commit
bd07c0f15f
  1. 5
      manufacture_process_costing/__manifest__.py
  2. 9
      manufacture_process_costing/data/material_data.xml
  3. 7
      manufacture_process_costing/doc/RELEASE_NOTES.md
  4. 6
      manufacture_process_costing/models/direct_material_cost.py
  5. 2
      manufacture_process_costing/models/mrp_bom.py
  6. 43
      manufacture_process_costing/models/mrp_production.py

5
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,

9
manufacture_process_costing/data/material_data.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="decimal_precision_quantity" model="decimal.precision">
<field name="name">Quantity</field>
<field name="digits">2</field>
</record>
</data>
</odoo>

7
manufacture_process_costing/doc/RELEASE_NOTES.md

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

6
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',

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

43
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

Loading…
Cancel
Save