@ -0,0 +1,48 @@ |
|||
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
|||
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
|||
:alt: License: LGPL-3 |
|||
|
|||
Process Cost of Manufacturing Orders |
|||
==================================== |
|||
* This module allow to manage process cost of manufacturing orders. |
|||
|
|||
Configuration |
|||
============= |
|||
- www.odoo.com/documentation/15.0/setup/install.html |
|||
- Install our custom addon |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (LGPL v3). |
|||
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
Credits |
|||
------- |
|||
* Developer: (V16) Javid A, |
|||
(V15) Adarsh K, |
|||
Contact: odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit https://www.cybrosys.com |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import models |
|||
|
@ -0,0 +1,59 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
{ |
|||
'name': 'Process Cost of Manufacturing Orders', |
|||
'version': '15.0.1.0.0', |
|||
'category': 'Manufacturing', |
|||
'summary': """Manufacture Process Costing By Material Cost, Labour Cost and |
|||
Overhead Cost""", |
|||
'description': """This module helps to calculate process cost of |
|||
manufacturing order and workorder with material cost, labour cost and |
|||
overhead cost from components and work center. It calculates both |
|||
estimated costing and real costing. Estimated costing is done on Bill of |
|||
Material-BOM and real costing calculated on manufacturing order based on |
|||
real-time consumption and quantity consumption. You can also provide a |
|||
cancel reason for canceling the manufacture order.You can also see the |
|||
reports for BOM and Manufacture order. Also, you can add cancel |
|||
reasons.""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://cybrosys.com', |
|||
'depends': ['base', 'mrp'], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'views/res_config_settings_views.xml', |
|||
'views/mrp_bom_views.xml', |
|||
'views/mrp_production_views.xml', |
|||
'views/mrp_workcenter_views.xml', |
|||
'views/mrp_cancel_reason_views.xml', |
|||
'report/mrp_bom_cost_reports.xml', |
|||
'report/mrp_bom_cost_report_templates.xml', |
|||
'report/mrp_production_cost_reports.xml', |
|||
'report/mrp_production_cost_report_templates.xml', |
|||
], |
|||
'images': ['static/description/banner.png'], |
|||
'License': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,5 @@ |
|||
|
|||
#### 28.06.2024 |
|||
#### Version 15.0.1.0.0 |
|||
#### ADD |
|||
- Initial commit for Process Cost of Manufacturing Orders |
@ -0,0 +1,31 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import direct_labour_cost |
|||
from . import direct_material_cost |
|||
from . import direct_overhead_cost |
|||
from . import mrp_bom |
|||
from . import mrp_cancel_reason |
|||
from . import mrp_production |
|||
from . import mrp_workorder |
|||
from . import mrp_workcenter |
|||
from . import res_config_settings |
|||
|
@ -0,0 +1,64 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class DirectLabourCost(models.Model): |
|||
"""This class creates a new model with the name direct.labour.cost""" |
|||
_name = 'direct.labour.cost' |
|||
_description = 'Direct Labour Cost' |
|||
|
|||
labour_cost_id = fields.Many2one('mrp.bom', |
|||
string='Labour Cost', |
|||
help='Corresponding bill of materials') |
|||
operation = fields.Char(string='Operation', |
|||
help='Operation required for the work') |
|||
work_center_id = fields.Many2one('mrp.workcenter', |
|||
string='Work Center', |
|||
help='Corresponding work center') |
|||
planned_minute = fields.Float(string='Planned Minute', |
|||
help='Planned minutes for the work') |
|||
cost_minute = fields.Float(string='Cost/Minute', |
|||
help='Cost per minute for the work') |
|||
total_cost = fields.Float(compute='_compute_total_cost', store=True, |
|||
string='Total Cost', help='Total labour cost') |
|||
production_labour_id = fields.Many2one('mrp.production', |
|||
string='Production Labour', |
|||
help='corresponding manufacturing ' |
|||
'order') |
|||
actual_minute = fields.Float(string='Actual Minute', |
|||
help='Actual minutes taken for the work') |
|||
total_actual_cost = fields.Float(compute='_compute_total_actual_cost', |
|||
string='Total Actual Cost', |
|||
help='Total Actual labour cost') |
|||
|
|||
@api.depends('planned_minute', 'cost_minute') |
|||
def _compute_total_cost(self): |
|||
"""Calculate total_cost based on planned_minute and cost_minute""" |
|||
for rec in self: |
|||
rec.total_cost = rec.planned_minute * rec.cost_minute |
|||
|
|||
@api.depends('actual_minute', 'cost_minute') |
|||
def _compute_total_actual_cost(self): |
|||
"""Calculate total_actual_cost based on actual_minute and cost_minute""" |
|||
for rec in self: |
|||
rec.total_actual_cost = rec.actual_minute * rec.cost_minute |
@ -0,0 +1,64 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class DirectMaterialCost(models.Model): |
|||
"""This class creates a new model with the name direct.material.cost""" |
|||
_name = 'direct.material.cost' |
|||
_description = 'Direct Material Cost' |
|||
|
|||
material_cost_id = fields.Many2one('mrp.bom', |
|||
string='Material Cost', |
|||
help='Corresponding bill of materials') |
|||
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') |
|||
uom_id = fields.Many2one('uom.uom', string='UoM', |
|||
help="Unit of measure") |
|||
cost_unit = fields.Float(string='Cost/Unit', |
|||
help='Cost per unit for the work') |
|||
total_cost = fields.Float(compute='_compute_total_cost', store=True, |
|||
string='Total Cost', help='Total material cost') |
|||
production_material_id = fields.Many2one('mrp.production', |
|||
string='Production Material', |
|||
help='Corresponding manufacturing ' |
|||
'order') |
|||
actual_quantity = fields.Integer(string='Actual Quantity', |
|||
help='Actual quantity taken for the work') |
|||
total_actual_cost = fields.Float(compute='_compute_total_actual_cost', |
|||
string='Total Actual Cost', |
|||
help='Total actual material cost') |
|||
|
|||
@api.depends('planned_qty', 'cost_unit') |
|||
def _compute_total_cost(self): |
|||
"""Calculate total_cost based on planned_qty and cost_unit""" |
|||
for rec in self: |
|||
rec.total_cost = rec.planned_qty * rec.cost_unit |
|||
|
|||
@api.depends('actual_quantity', 'cost_unit') |
|||
def _compute_total_actual_cost(self): |
|||
"""Calculate total_actual_cost based on actual_quantity and cost_unit""" |
|||
for rec in self: |
|||
rec.total_actual_cost = rec.actual_quantity * rec.cost_unit |
@ -0,0 +1,64 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class DirectOverheadCost(models.Model): |
|||
"""This class creates a new model with the name direct.overhead.cost""" |
|||
_name = 'direct.overhead.cost' |
|||
_description = 'Direct Overhead Cost' |
|||
|
|||
overhead_cost_id = fields.Many2one('mrp.bom', |
|||
string='Overhead Cost', |
|||
help='Corresponding bill of materials') |
|||
operation = fields.Char(string='Operation', |
|||
help='Operation required for the work') |
|||
work_center_id = fields.Many2one('mrp.workcenter', |
|||
string='Work Center', |
|||
help='Corresponding work center') |
|||
planned_minute = fields.Float(string='Planned Minute', |
|||
help='Planned minutes for the work') |
|||
cost_minute = fields.Float(string='Cost/Minute', |
|||
help='Cost per minute for the work') |
|||
total_cost = fields.Float(compute='_compute_total_cost', store=True, |
|||
string='Total Cost', |
|||
help='Total overhead cost') |
|||
production_overhead_id = fields.Many2one('mrp.production', |
|||
string='Production Overhead', |
|||
help='corresponding manufacturing ' |
|||
'order') |
|||
actual_minute = fields.Float(string='Actual Minute', |
|||
help='Actual minutes taken for the work') |
|||
total_actual_cost = fields.Float(compute='_compute_total_actual_cost', |
|||
help='Total Actual overhead cost') |
|||
|
|||
@api.depends('planned_minute', 'cost_minute') |
|||
def _compute_total_cost(self): |
|||
"""Calculate total_cost based on planned_minute and cost_minute""" |
|||
for rec in self: |
|||
rec.total_cost = rec.planned_minute * rec.cost_minute |
|||
|
|||
@api.depends('actual_minute', 'cost_minute') |
|||
def _compute_total_actual_cost(self): |
|||
"""Calculate total_actual_cost based on actual_minute and cost_minute""" |
|||
for rec in self: |
|||
rec.total_actual_cost = rec.actual_minute * rec.cost_minute |
@ -0,0 +1,146 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class MrpBom(models.Model): |
|||
"""This class inherits the existing class mrp.bom to add the |
|||
additional features of the costing""" |
|||
_inherit = 'mrp.bom' |
|||
|
|||
material_cost_ids = fields.One2many('direct.material.cost', |
|||
'material_cost_id', |
|||
string='Material Cost', |
|||
help="Material cost") |
|||
labour_cost_ids = fields.One2many('direct.labour.cost', |
|||
'labour_cost_id', |
|||
string='Labour Cost', help="Labour cost") |
|||
overhead_cost_ids = fields.One2many('direct.overhead.cost', |
|||
'overhead_cost_id', |
|||
string='Overhead Cost', help="Overhead " |
|||
"cost") |
|||
total_material_cost = fields.Float(compute='_compute_total_material_cost', |
|||
string='Total Material Cost', |
|||
store=True, help='Total Material Cost') |
|||
total_labour_cost = fields.Float(compute='_compute_total_labour_cost', |
|||
string='Total Labour Cost', |
|||
store=True, help='Total Labour Cost') |
|||
total_overhead_cost = fields.Float(compute='_compute_total_overhead_cost', |
|||
string='Total Overhead Cost', |
|||
store=True, help='Total Overhead Cost') |
|||
|
|||
@api.onchange('bom_line_ids') |
|||
def _onchange_bom_line_ids(self): |
|||
"""write into material_cost_ids when bom_line_ids is changed""" |
|||
self.write({'material_cost_ids': [(5, 0)]}) |
|||
self.write({ |
|||
'material_cost_ids': [ |
|||
(0, 0, { |
|||
'material_cost_id': self.id, |
|||
'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, |
|||
}) for rec in self.bom_line_ids] |
|||
}) |
|||
|
|||
@api.onchange('operation_ids') |
|||
def _onchange_operation_ids(self): |
|||
"""write into labour_cost_ids and overhead_cost_ids when |
|||
operation_ids is changed""" |
|||
process = self.env['ir.config_parameter'].sudo() |
|||
process_value = process.get_param( |
|||
'manufacture_process_costing.process_costing_method') |
|||
if process_value == 'work-center': |
|||
self.write({'labour_cost_ids': [(5, 0)]}) |
|||
self.write({ |
|||
'labour_cost_ids': [ |
|||
(0, 0, { |
|||
'labour_cost_id': self.id, |
|||
'operation': rec.name, |
|||
'work_center_id': rec.workcenter_id.id, |
|||
'planned_minute': rec.time_cycle, |
|||
'cost_minute': rec.workcenter_id.labour_cost, |
|||
}) for rec in self.operation_ids] |
|||
}) |
|||
self.write({'overhead_cost_ids': [(5, 0)]}) |
|||
self.write({ |
|||
'overhead_cost_ids': [ |
|||
(0, 0, { |
|||
'overhead_cost_id': self.id, |
|||
'operation': rec.name, |
|||
'work_center_id': rec.workcenter_id.id, |
|||
'planned_minute': rec.time_cycle, |
|||
'cost_minute': rec.workcenter_id.overhead_cost, |
|||
}) for rec in self.operation_ids] |
|||
}) |
|||
else: |
|||
self.write({'labour_cost_ids': [(5, 0)]}) |
|||
self.write({ |
|||
'labour_cost_ids': [ |
|||
(0, 0, { |
|||
'labour_cost_id': self.id, |
|||
'operation': rec.name, |
|||
'work_center_id': rec.workcenter_id.id, |
|||
'planned_minute': rec.time_cycle, |
|||
}) for rec in self.operation_ids] |
|||
}) |
|||
self.write({'overhead_cost_ids': [(5, 0)]}) |
|||
self.write({ |
|||
'overhead_cost_ids': [ |
|||
(0, 0, { |
|||
'overhead_cost_id': self.id, |
|||
'operation': rec.name, |
|||
'work_center_id': rec.workcenter_id.id, |
|||
'planned_minute': rec.time_cycle, |
|||
}) for rec in self.operation_ids] |
|||
}) |
|||
|
|||
@api.depends('material_cost_ids.total_cost') |
|||
def _compute_total_material_cost(self): |
|||
"""Calculates Total material costs""" |
|||
for result in self: |
|||
result.ensure_one() |
|||
result.total_material_cost = 0.00 |
|||
if result.material_cost_ids: |
|||
result.total_material_cost = sum( |
|||
result.material_cost_ids.mapped('total_cost')) |
|||
|
|||
@api.depends('labour_cost_ids.total_cost') |
|||
def _compute_total_labour_cost(self): |
|||
"""Calculate total labour costs""" |
|||
for result in self: |
|||
result.ensure_one() |
|||
result.total_labour_cost = 0.00 |
|||
if result.labour_cost_ids: |
|||
result.total_labour_cost = sum( |
|||
result.labour_cost_ids.mapped('total_cost')) |
|||
|
|||
@api.depends('overhead_cost_ids.total_cost') |
|||
def _compute_total_overhead_cost(self): |
|||
"""Calculate total overhead costs""" |
|||
for result in self: |
|||
result.ensure_one() |
|||
result.total_overhead_cost = 0.00 |
|||
if result.overhead_cost_ids: |
|||
result.total_overhead_cost = sum( |
|||
result.overhead_cost_ids.mapped('total_cost')) |
@ -0,0 +1,50 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class MrpCancelReason(models.Model): |
|||
"""The class represents a new model mrp.cancel.reason""" |
|||
_name = 'mrp.cancel.reason' |
|||
_description = 'Mrp Cancel Reason' |
|||
_rec_name = 'manufacturing_id' |
|||
_order = "id desc" |
|||
|
|||
reason_for_cancel = fields.Text( |
|||
string='Reason For Cancel', |
|||
help='Provide a reason for the cancellation of the manufacturing order') |
|||
manufacturing_id = fields.Many2one('mrp.production', |
|||
required=True, |
|||
string='Manufacture Order', |
|||
help='Corresponding manufacturing order') |
|||
date = fields.Datetime( |
|||
string='Cancel Date', default=fields.Datetime.now(), |
|||
help='The date and time of cancelling the manufacturing order') |
|||
cancelled_by_id = fields.Many2one( |
|||
'res.users', |
|||
string='Cancelled By', |
|||
default=lambda self: self.env.user.id, |
|||
help='The corresponding user who is cancelling the order') |
|||
|
|||
def action_button_cancel(self): |
|||
"""Calls the function action_cancel() from mrp production""" |
|||
self.manufacturing_id.action_cancel() |
@ -0,0 +1,230 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import api, fields, models |
|||
from odoo.exceptions import ValidationError |
|||
|
|||
|
|||
class MrpProduction(models.Model): |
|||
"""This class inherits the existing class mrp production to add the |
|||
additional feature of the costing methods""" |
|||
_inherit = 'mrp.production' |
|||
|
|||
material_cost_ids = fields.One2many('direct.material.cost', |
|||
'production_material_id', |
|||
string='Material Costs') |
|||
labour_cost_ids = fields.One2many('direct.labour.cost', |
|||
'production_labour_id', |
|||
string='Labour Costs') |
|||
overhead_cost_ids = fields.One2many('direct.overhead.cost', |
|||
'production_overhead_id', |
|||
string='Overhead Costs') |
|||
total_material_cost = fields.Float(compute='_compute_total_material_cost', |
|||
store=True, |
|||
string='Total Material Cost', |
|||
help='Total Material Cost of production') |
|||
total_labour_cost = fields.Float(compute='_compute_total_labour_cost', |
|||
store=True, string='Total Labour Cost', |
|||
help='Total Labour Cost of production') |
|||
total_overhead_cost = fields.Float(compute='_compute_total_overhead_cost', |
|||
store=True, |
|||
string='Total Overhead Cost', |
|||
help='Total Overhead Cost of production') |
|||
total_cost = fields.Float(compute='_compute_total_cost', store=True, |
|||
help='Total Cost of production', |
|||
string='Total Cost') |
|||
total_actual_material_cost = fields.Float( |
|||
string='Total Actual Material Cost', |
|||
compute='_compute_total_actual_material_cost', store=True, |
|||
help='Total Actual Material Cost of production') |
|||
total_actual_labour_cost = fields.Float(string='Total Actual Labour Cost', |
|||
compute='_compute_total_actual_' |
|||
'labour_cost', |
|||
store=True, |
|||
help='Total Actual Labour Cost ' |
|||
'of production') |
|||
total_actual_overhead_cost = fields.Float( |
|||
string='Total Actual Overhead Cost', |
|||
compute='_compute_total_actual_overhead_cost', store=True, |
|||
help='Total Actual Overhead Cost of production') |
|||
total_actual_cost = fields.Float(compute='_compute_total_actual_cost', |
|||
store=True, string='Total Actual Cost', |
|||
help='Total Actual Cost of production') |
|||
|
|||
def action_cancel_button(self): |
|||
"""Returns the mrp.cancel.reason""" |
|||
reason = self.env['mrp.cancel.reason'].create( |
|||
{'manufacturing_id': self.id}) |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Cancel Reason', |
|||
'view_mode': 'form', |
|||
'res_model': 'mrp.cancel.reason', |
|||
'target': 'new', |
|||
'view_type': 'form', |
|||
'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) |
|||
bom = res.bom_id |
|||
if not bom: |
|||
raise ValidationError("BOM ID does not exist or is not assigned properly.") |
|||
res.write({'material_cost_ids': [(5, 0)]}) |
|||
res.write({ |
|||
'material_cost_ids': [ |
|||
(0, 0, { |
|||
'production_material_id': res.id, |
|||
'material_cost_id': self.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': self.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': self.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 |
|||
overhead_cost_ids when change in bom_id""" |
|||
self.write({'material_cost_ids': [(5, 0)]}) |
|||
self.write({ |
|||
'material_cost_ids': [ |
|||
(0, 0, { |
|||
'production_material_id': self.id, |
|||
'material_cost_id': self.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 self.bom_id.material_cost_ids] |
|||
}) |
|||
self.write({'labour_cost_ids': [(5, 0)]}) |
|||
self.write({ |
|||
'labour_cost_ids': [ |
|||
(0, 0, { |
|||
'production_labour_id': self.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 self.bom_id.labour_cost_ids] |
|||
}) |
|||
self.write({'overhead_cost_ids': [(5, 0)]}) |
|||
self.write({ |
|||
'overhead_cost_ids': [ |
|||
(0, 0, { |
|||
'production_overhead_id': self.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 self.bom_id.overhead_cost_ids] |
|||
}) |
|||
|
|||
@api.depends('material_cost_ids.total_cost') |
|||
def _compute_total_material_cost(self): |
|||
"""Calculate total_material_cost""" |
|||
for result in self: |
|||
result.total_material_cost = sum( |
|||
result.mapped('material_cost_ids').mapped('total_cost')) |
|||
|
|||
@api.depends('labour_cost_ids.total_cost') |
|||
def _compute_total_labour_cost(self): |
|||
"""Calculate total_labour_cost""" |
|||
for result in self: |
|||
result.total_labour_cost = sum( |
|||
result.mapped('labour_cost_ids').mapped('total_cost')) |
|||
|
|||
@api.depends('overhead_cost_ids.total_cost') |
|||
def _compute_total_overhead_cost(self): |
|||
"""Calculates total_overhead_cost""" |
|||
for result in self: |
|||
result.total_overhead_cost = sum( |
|||
result.mapped('overhead_cost_ids').mapped('total_cost')) |
|||
|
|||
@api.depends('total_material_cost', 'total_labour_cost', |
|||
'total_overhead_cost') |
|||
def _compute_total_cost(self): |
|||
"""Calculates total_cost""" |
|||
for rec in self: |
|||
rec.total_cost = rec.total_material_cost + \ |
|||
rec.total_labour_cost + rec.total_overhead_cost |
|||
|
|||
@api.depends('material_cost_ids.total_actual_cost') |
|||
def _compute_total_actual_material_cost(self): |
|||
"""Calculates total_actual_material_cost""" |
|||
for cost in self: |
|||
cost.total_actual_material_cost = sum( |
|||
cost.mapped('material_cost_ids').mapped('total_actual_cost')) |
|||
|
|||
@api.depends('labour_cost_ids.total_actual_cost') |
|||
def _compute_total_actual_labour_cost(self): |
|||
"""Calculates total_actual_labour_cost""" |
|||
for cost in self: |
|||
cost.total_actual_labour_cost = sum( |
|||
cost.mapped('labour_cost_ids').mapped('total_actual_cost')) |
|||
|
|||
@api.depends('overhead_cost_ids.total_actual_cost') |
|||
def _compute_total_actual_overhead_cost(self): |
|||
"""Calculates total_actual_overhead_cost""" |
|||
for cost in self: |
|||
cost.total_actual_overhead_cost = sum( |
|||
cost.mapped('overhead_cost_ids').mapped('total_actual_cost')) |
|||
|
|||
@api.depends('total_actual_material_cost', 'total_actual_labour_cost', |
|||
'total_actual_overhead_cost') |
|||
def _compute_total_actual_cost(self): |
|||
"""Calculates total_actual_cost""" |
|||
for rec in self: |
|||
rec.total_actual_cost = rec.total_actual_material_cost + \ |
|||
rec.total_actual_labour_cost + \ |
|||
rec.total_actual_overhead_cost |
@ -0,0 +1,33 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class MrpWorkcenter(models.Model): |
|||
"""This class inherits the already existing class mrp workcenter to add |
|||
the total cost of overhead and labour per minute""" |
|||
_inherit = 'mrp.workcenter' |
|||
|
|||
overhead_cost = fields.Float(string='Overhead Costs per minute', |
|||
help='Set an overhead cost cost per minute') |
|||
labour_cost = fields.Float(string='Labour Costs per minute', |
|||
help='Set an labour cost cost per minute') |
@ -0,0 +1,65 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import models |
|||
|
|||
|
|||
class MrpWorkorder(models.Model): |
|||
"""This class inherits the existing class with model name mrp.workorder |
|||
to define a function to automatically calculate the costings""" |
|||
_inherit = 'mrp.workorder' |
|||
|
|||
def button_finish(self): |
|||
"""Super the button_finish button in workorder and update the |
|||
actual_minute and actual_quantity of labour_cost_ids, |
|||
overhead_cost_ids, material_cost_ids according to the settings value""" |
|||
res = super(MrpWorkorder, self).button_finish() |
|||
process = self.env['ir.config_parameter'].sudo() |
|||
process_value = process.get_param( |
|||
'manufacture_process_costing.process_costing_method') |
|||
if process_value == 'work-center': |
|||
for rec in self.production_id.labour_cost_ids: |
|||
for val in self: |
|||
if rec.operation == val.name: |
|||
labour_id = rec.id |
|||
self.production_id.write({ |
|||
'labour_cost_ids': [ |
|||
(1, labour_id, { |
|||
'actual_minute': rec.duration |
|||
}) for rec in self] |
|||
}) |
|||
for rec in self.production_id.overhead_cost_ids: |
|||
for val in self: |
|||
if rec.operation == val.name: |
|||
overhead_id = rec.id |
|||
self.production_id.write({ |
|||
'overhead_cost_ids': [ |
|||
(1, overhead_id, { |
|||
'actual_minute': rec.duration |
|||
}) for rec in self] |
|||
}) |
|||
self.production_id.write({ |
|||
'material_cost_ids': [ |
|||
(1, rec.id, { |
|||
'actual_quantity': rec.planned_qty |
|||
}) for rec in self.production_id.material_cost_ids] |
|||
}) |
|||
return res |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
"""This class extends the 'res.config.settings' model to add a custom |
|||
field for configuring the process costing method""" |
|||
_inherit = 'res.config.settings' |
|||
|
|||
process_costing_method = fields.Selection(selection=[ |
|||
('manually', 'Manually'), ('work-center', 'Work Center')], |
|||
default='manually', string='Process Costing Method', |
|||
config_parameter='manufacture_process_costing.process_costing_method', |
|||
help='How to compute process costing, whether manually or work ' |
|||
'center based') |
@ -0,0 +1,219 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Bom cost report template --> |
|||
<template id="report_bom_cost"> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<div class="page"> |
|||
<t t-foreach="docs" t-as="data"> |
|||
<span style="font-size:30px;"> |
|||
<strong>Bill Of Materials</strong> |
|||
</span> |
|||
<table class="table table-borderless"> |
|||
<tr> |
|||
<td> |
|||
<p> |
|||
<strong>Product :</strong> |
|||
<t t-esc="data['product_tmpl_id'].name"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<p> |
|||
<strong>Reference :</strong> |
|||
<t t-esc="data['code']"/> |
|||
</p> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<p> |
|||
<strong>Product Variant :</strong> |
|||
<t t-esc="data['product_id'].name"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<p> |
|||
<strong>Bom Type :</strong> |
|||
<t t-esc="data['type']"/> |
|||
</p> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<p> |
|||
<strong>Quantity :</strong> |
|||
<t t-esc="data['product_qty']"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<p> |
|||
<strong>Company :</strong> |
|||
<t t-esc="data['company_id'].name"/> |
|||
</p> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<br/> |
|||
<span style="font-size:25px;"> |
|||
<strong>Components</strong> |
|||
</span> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Product</th> |
|||
<th>Product Qunatity</th> |
|||
<th>Product UOM</th> |
|||
<th>Variants</th> |
|||
<th>Consumed In Operation</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="data['bom_line_ids']" t-as="rec"> |
|||
<td> |
|||
<t t-esc="rec.product_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.product_qty"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.product_uom_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.product_tmpl_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.operation_id.name"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<span style="font-size:25px;"> |
|||
<strong>Direct Material Cost</strong> |
|||
</span> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Product</th> |
|||
<th>Planned Qunatity</th> |
|||
<th>UOM</th> |
|||
<th>Cost/Unit</th> |
|||
<th>Total Cost</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="data['material_cost_ids']" |
|||
t-as="rec"> |
|||
<td> |
|||
<t t-esc="rec.product_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.planned_qty"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.uom_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.cost_unit"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.total_cost"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<h6 class="oe_subtotal_footer oe_right">Total Material |
|||
Cost : |
|||
<strong> |
|||
<t t-esc="data['total_material_cost']"/> |
|||
</strong> |
|||
</h6> |
|||
<br/> |
|||
<span style="font-size:25px;"> |
|||
<strong>Direct Labour Cost</strong> |
|||
</span> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Operation</th> |
|||
<th>Work Center</th> |
|||
<th>Planned Minute</th> |
|||
<th>Cost/Minute</th> |
|||
<th>Total Cost</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="data['labour_cost_ids']" |
|||
t-as="rec"> |
|||
<td> |
|||
<t t-esc="rec.operation"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.work_center_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.planned_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.cost_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.total_cost"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<h6 class="oe_subtotal_footer oe_right">Total Labour |
|||
Cost : |
|||
<strong> |
|||
<t t-esc="data['total_labour_cost']"/> |
|||
</strong> |
|||
</h6> |
|||
<br/> |
|||
<span style="font-size:25px;"> |
|||
<strong>Direct Overhead Cost</strong> |
|||
</span> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Operation</th> |
|||
<th>Work Center</th> |
|||
<th>Planned Minute</th> |
|||
<th>Cost/Minute</th> |
|||
<th>Total Cost</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="data['overhead_cost_ids']" |
|||
t-as="rec"> |
|||
<td> |
|||
<t t-esc="rec.operation"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.work_center_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.planned_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.cost_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.total_cost"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<h6 class="oe_subtotal_footer oe_right">Total Overhead |
|||
Cost : |
|||
<strong> |
|||
<t t-esc="data['total_overhead_cost']"/> |
|||
</strong> |
|||
</h6> |
|||
<br/> |
|||
</t> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Bom cost report action --> |
|||
<record id="action_report_bom_cost" model="ir.actions.report"> |
|||
<field name="name">Bom Cost Report</field> |
|||
<field name="model">mrp.bom</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">manufacture_process_costing.report_bom_cost</field> |
|||
<field name="report_file">manufacture_process_costing.report_bom_cost</field> |
|||
<field name="print_report_name">'BOM Cost Report - %s' % object.display_name</field> |
|||
<field name="binding_model_id" ref="model_mrp_bom"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,295 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Mrp production cost report template --> |
|||
<template id="production_cost_report"> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<div class="page"> |
|||
<t t-foreach="docs" t-as="data"> |
|||
<span style="font-size:30px;"> |
|||
<strong>Manufacturing Orders - |
|||
<t t-esc="data['name']"/> |
|||
</strong> |
|||
</span> |
|||
<table class="table table-borderless"> |
|||
<tr> |
|||
<td> |
|||
<p> |
|||
<strong>Product :</strong> |
|||
<t t-esc="data['product_id'].name"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<p> |
|||
<strong>Deadline Start :</strong> |
|||
<t t-esc="data['date_planned_start']"/> |
|||
</p> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<p> |
|||
<strong>Quantity To Produce :</strong> |
|||
<t t-esc="data['product_qty']"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<p> |
|||
<strong>Responsible :</strong> |
|||
<t t-esc="data['user_id'].name"/> |
|||
</p> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<p> |
|||
<strong>Bill Of Material :</strong> |
|||
<t t-esc="data['bom_id'].product_tmpl_id.name"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<p> |
|||
<strong>Company :</strong> |
|||
<t t-esc="data['company_id'].name"/> |
|||
</p> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<p> |
|||
<strong>Source :</strong> |
|||
<t t-esc="data['origin']"/> |
|||
</p> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<br/> |
|||
<span style="font-size:25px;"> |
|||
<strong>Consumed Materials</strong> |
|||
</span> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Product</th> |
|||
<th>Unit Of Measure</th> |
|||
<th>To Consume</th> |
|||
<th>Consumed</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="data['move_raw_ids']" t-as="rec"> |
|||
<td> |
|||
<t t-esc="rec.product_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.product_uom.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.product_uom_qty"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.quantity_done"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<t t-if="data['state'] == 'done'"> |
|||
<span style="font-size:25px;"> |
|||
<strong>Finished Products</strong> |
|||
</span> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Product</th> |
|||
<th>Unit Of Measure</th> |
|||
<th>Produced</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr> |
|||
<td> |
|||
<t t-esc="data['product_id'].name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data['product_uom_id'].name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data['qty_produced']"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
</t> |
|||
<span style="font-size:25px;"> |
|||
<strong>Manufacturing Material Cost</strong> |
|||
</span> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Product</th> |
|||
<th>Planned Qunatity</th> |
|||
<th>Actual Qunatity</th> |
|||
<th>UOM</th> |
|||
<th>Cost/Unit</th> |
|||
<th>Total Cost</th> |
|||
<th>Total Actual Cost</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="data['material_cost_ids']" |
|||
t-as="rec"> |
|||
<td> |
|||
<t t-esc="rec.product_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.planned_qty"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.actual_quantity"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.uom_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.cost_unit"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.total_cost"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.total_actual_cost"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<h6 class="oe_subtotal_footer oe_right">Total Material |
|||
Cost : |
|||
<strong> |
|||
<t t-esc="data['total_material_cost']"/> |
|||
</strong> |
|||
</h6> |
|||
<h6 class="oe_subtotal_footer oe_right">Total Actual |
|||
Material Cost : |
|||
<strong> |
|||
<t t-esc="data['total_actual_material_cost']"/> |
|||
</strong> |
|||
</h6> |
|||
<br/> |
|||
<span style="font-size:25px;"> |
|||
<strong>Manufacturing Labour Cost</strong> |
|||
</span> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Operation</th> |
|||
<th>Work Center</th> |
|||
<th>Planned Minute</th> |
|||
<th>Actual Minute</th> |
|||
<th>Cost/Minute</th> |
|||
<th>Total Cost</th> |
|||
<th>Total Actual Cost</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="data['labour_cost_ids']" |
|||
t-as="rec"> |
|||
<td> |
|||
<t t-esc="rec.operation"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.work_center_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.planned_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.actual_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.cost_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.total_cost"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.total_actual_cost"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<h6 class="oe_subtotal_footer oe_right">Total Labour |
|||
Cost : |
|||
<strong> |
|||
<t t-esc="data['total_labour_cost']"/> |
|||
</strong> |
|||
</h6> |
|||
<h6 class="oe_subtotal_footer oe_right">Total Actual |
|||
Labour Cost : |
|||
<strong> |
|||
<t t-esc="data['total_actual_labour_cost']"/> |
|||
</strong> |
|||
</h6> |
|||
<br/> |
|||
<span style="font-size:25px;"> |
|||
<strong>Manufacturing Overhead Cost</strong> |
|||
</span> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Operation</th> |
|||
<th>Work Center</th> |
|||
<th>Planned Minute</th> |
|||
<th>Actual Minute</th> |
|||
<th>Cost/Minute</th> |
|||
<th>Total Cost</th> |
|||
<th>Total Actual Cost</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="data['overhead_cost_ids']" |
|||
t-as="rec"> |
|||
<td> |
|||
<t t-esc="rec.operation"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.work_center_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.planned_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.actual_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.cost_minute"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.total_cost"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="rec.total_actual_cost"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<h6 class="oe_subtotal_footer oe_right">Total Labour |
|||
Cost : |
|||
<strong> |
|||
<t t-esc="data['total_overhead_cost']"/> |
|||
</strong> |
|||
</h6> |
|||
<h6 class="oe_subtotal_footer oe_right">Total Actual |
|||
Labour Cost : |
|||
<strong> |
|||
<t t-esc="data['total_actual_overhead_cost']"/> |
|||
</strong> |
|||
</h6> |
|||
<br/> |
|||
</t> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Mrp production cost report action --> |
|||
<record id="action_production_cost_report" model="ir.actions.report"> |
|||
<field name="name">Production Cost Report</field> |
|||
<field name="model">mrp.production</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">manufacture_process_costing.production_cost_report</field> |
|||
<field name="report_file">manufacture_process_costing.production_cost_report</field> |
|||
<field name="print_report_name">'Production Cost Report - %s' % object.display_name</field> |
|||
<field name="binding_model_id" ref="model_mrp_production"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
</odoo> |
|
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 967 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 633 KiB |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 120 KiB |
After Width: | Height: | Size: 164 KiB |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 159 KiB |
After Width: | Height: | Size: 160 KiB |
After Width: | Height: | Size: 164 KiB |