@ -0,0 +1,50 @@ | 
				
			|||||
 | 
					.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg | 
				
			||||
 | 
					   :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html | 
				
			||||
 | 
					   :alt: License: AGPL-3 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Manufacturing (MRP) Timesheet | 
				
			||||
 | 
					============================= | 
				
			||||
 | 
					This module will help you to create timesheet for manufacturing orders according to the work order time tracking. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Configuration | 
				
			||||
 | 
					============= | 
				
			||||
 | 
					* No additional configurations needed | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Company | 
				
			||||
 | 
					------- | 
				
			||||
 | 
					* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					License | 
				
			||||
 | 
					------- | 
				
			||||
 | 
					General Public License, Version 3 (AGPL v3). | 
				
			||||
 | 
					(https://www.gnu.org/licenses/agpl-3.0-standalone.html) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Credits | 
				
			||||
 | 
					------- | 
				
			||||
 | 
					Developer : | 
				
			||||
 | 
					    (V16) Amaya Aravind @ Cybrosys, | 
				
			||||
 | 
					    (V17) Safa Faheem PE @Cybrosys, | 
				
			||||
 | 
					    (V18) Akhil @Cybrosys | 
				
			||||
 | 
					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 `Our Website <https://cybrosys.com/>`__ | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Further information | 
				
			||||
 | 
					=================== | 
				
			||||
 | 
					HTML Description: `<static/description/index.html>`__ | 
				
			||||
@ -0,0 +1,22 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | 
				
			||||
 | 
					#    Author: Cybrosys Technologies(<https://www.cybrosys.com>). | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					from . import models | 
				
			||||
@ -0,0 +1,46 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | 
				
			||||
 | 
					#    Author: Cybrosys Technologies(<https://www.cybrosys.com>). | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					{ | 
				
			||||
 | 
					    'name': 'Manufacturing (MRP) Timesheet', | 
				
			||||
 | 
					    'version': '18.0.1.0.0', | 
				
			||||
 | 
					    'category': 'Manufacturing,Project', | 
				
			||||
 | 
					    'summary': 'Timesheet for manufacturing.', | 
				
			||||
 | 
					    'description': """ This module will help you to create timesheet for  | 
				
			||||
 | 
					    manufacturing orders according to the work order time tracking.Separate | 
				
			||||
 | 
					     Project and tasks will be created for managing manufacturing orders""", | 
				
			||||
 | 
					    'author': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'company': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'maintainer': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'website': "https://www.cybrosys.com", | 
				
			||||
 | 
					    'depends': ['base', 'mrp', 'hr_timesheet', 'project'], | 
				
			||||
 | 
					    'data': [ | 
				
			||||
 | 
					        'views/mrp_production_views.xml', | 
				
			||||
 | 
					        'views/account_analytic_line_views.xml', | 
				
			||||
 | 
					        'views/project_project_views.xml', | 
				
			||||
 | 
					        'views/mrp_timesheet_views.xml', | 
				
			||||
 | 
					    ], | 
				
			||||
 | 
					    'images': ['static/description/banner.png'], | 
				
			||||
 | 
					    'license': 'AGPL-3', | 
				
			||||
 | 
					    'installable': True, | 
				
			||||
 | 
					    'auto_install': False, | 
				
			||||
 | 
					    'application': False, | 
				
			||||
 | 
					} | 
				
			||||
@ -0,0 +1,6 @@ | 
				
			|||||
 | 
					## Module <manufacturing_timesheet> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					#### 19.11.2024 | 
				
			||||
 | 
					#### Version 18.0.1.0.0 | 
				
			||||
 | 
					#### ADD | 
				
			||||
 | 
					- Initial Commit for Manufacturing (MRP) Timesheet | 
				
			||||
@ -0,0 +1,24 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | 
				
			||||
 | 
					#    Author: Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					from . import account_analytic_line | 
				
			||||
 | 
					from . import mrp_workorder | 
				
			||||
 | 
					from . import project_project | 
				
			||||
@ -0,0 +1,33 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | 
				
			||||
 | 
					#    Author: Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class AccountAnalyticLine(models.Model): | 
				
			||||
 | 
					    """Inherited model account_analytic_line to add a new field related | 
				
			||||
 | 
					       to manufacturing timesheet.""" | 
				
			||||
 | 
					    _inherit = 'account.analytic.line' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    is_manufacturing = fields.Boolean(string='Is Manufacturing', invisible=True, | 
				
			||||
 | 
					                                      help='This boolean will help to ' | 
				
			||||
 | 
					                                           'recognise the timesheet related' | 
				
			||||
 | 
					                                           ' to manufacturing.') | 
				
			||||
@ -0,0 +1,162 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | 
				
			||||
 | 
					#    Author: Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					from datetime import datetime | 
				
			||||
 | 
					from odoo import fields, models, api | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class MrpWorkorder(models.Model): | 
				
			||||
 | 
					    """Inherited model mrp_workorder to add field and functions related to | 
				
			||||
 | 
					       manufacturing timesheet. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        Methods: | 
				
			||||
 | 
					            button_start(self): | 
				
			||||
 | 
					                Supering the function of start button to start the time of | 
				
			||||
 | 
					                timesheet. | 
				
			||||
 | 
					            button_pending(self): | 
				
			||||
 | 
					                Supering the function of pause button to set timesheet in | 
				
			||||
 | 
					                progress state. | 
				
			||||
 | 
					            button_finish(self): | 
				
			||||
 | 
					                Supering the function of done button to calculate total | 
				
			||||
 | 
					                time in timesheet. | 
				
			||||
 | 
					    """ | 
				
			||||
 | 
					    _inherit = 'mrp.workorder' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    employee_id = fields.Many2one('hr.employee', string='Employee', | 
				
			||||
 | 
					                                  readonly=False, required=True, | 
				
			||||
 | 
					                                  help='Employee in work order', compute="_compute_employee_id",store=True) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def button_start(self): | 
				
			||||
 | 
					        """ Supering the function of start button to start the timer | 
				
			||||
 | 
					            of timesheet. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            Boolean: Returns true | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        res = super(MrpWorkorder, self).button_start() | 
				
			||||
 | 
					        project = self.env['project.project'].search( | 
				
			||||
 | 
					            [('name', '=', ("MO: {}".format(self.production_id.name)))]) | 
				
			||||
 | 
					        if project: | 
				
			||||
 | 
					            task_id = project.task_ids.search([('name', '=', ( | 
				
			||||
 | 
					                "{} in {} for {} on {}".format(self.name, | 
				
			||||
 | 
					                                               self.workcenter_id.name, | 
				
			||||
 | 
					                                               self.product_id.display_name, | 
				
			||||
 | 
					                                               str(self.date_start))))]) | 
				
			||||
 | 
					            if not task_id: | 
				
			||||
 | 
					                task_id = self.env['project.task'].create({ | 
				
			||||
 | 
					                    'name': ("{} in {} for {} on {}".format(self.name, | 
				
			||||
 | 
					                                                            self.workcenter_id.name, | 
				
			||||
 | 
					                                                            self.product_id.display_name, | 
				
			||||
 | 
					                                                            str(self.date_start))), | 
				
			||||
 | 
					                    'project_id': project.id, | 
				
			||||
 | 
					                    'date_assign': self.date_start, | 
				
			||||
 | 
					                    'date_deadline': self.date_finished, | 
				
			||||
 | 
					                    'allocated_hours': self.duration_expected, | 
				
			||||
 | 
					                }) | 
				
			||||
 | 
					                self.env['account.analytic.line'].create({ | 
				
			||||
 | 
					                    'task_id': task_id.id, | 
				
			||||
 | 
					                    'date': datetime.today(), | 
				
			||||
 | 
					                    'name': ("{} in {} for {}".format(self.name, | 
				
			||||
 | 
					                                                      self.workcenter_id.name, | 
				
			||||
 | 
					                                                      self.product_id.display_name)), | 
				
			||||
 | 
					                    'employee_id': self.employee_id.id, | 
				
			||||
 | 
					                    'is_manufacturing': True | 
				
			||||
 | 
					                }) | 
				
			||||
 | 
					        else: | 
				
			||||
 | 
					            project_id = self.env['project.project'].create( | 
				
			||||
 | 
					                {'name': ("MO: {}".format(self.production_id.name)), | 
				
			||||
 | 
					                 'is_manufacturing': True}) | 
				
			||||
 | 
					            task_id = project_id.task_ids.search([('name', '=', ( | 
				
			||||
 | 
					                "{} in {} for {} on {}".format(self.name, | 
				
			||||
 | 
					                                               self.workcenter_id.name, | 
				
			||||
 | 
					                                               self.product_id.display_name, | 
				
			||||
 | 
					                                               str(self.date_start))))]) | 
				
			||||
 | 
					            if not task_id: | 
				
			||||
 | 
					                task_id = self.env['project.task'].create({ | 
				
			||||
 | 
					                    'name': ("{} in {} for {} on {}".format(self.name, | 
				
			||||
 | 
					                                                            self.workcenter_id.name, | 
				
			||||
 | 
					                                                            self.product_id.display_name, | 
				
			||||
 | 
					                                                            str(self.date_start))), | 
				
			||||
 | 
					                    'project_id': project_id.id, | 
				
			||||
 | 
					                    'date_assign': self.date_start, | 
				
			||||
 | 
					                    'date_deadline': self.date_finished, | 
				
			||||
 | 
					                    'allocated_hours': self.duration_expected, | 
				
			||||
 | 
					                }) | 
				
			||||
 | 
					                self.env['account.analytic.line'].create({ | 
				
			||||
 | 
					                    'task_id': task_id.id, | 
				
			||||
 | 
					                    'date': datetime.today(), | 
				
			||||
 | 
					                    'name': ("{} in {} for {}".format(self.name, | 
				
			||||
 | 
					                                                      self.workcenter_id.name, | 
				
			||||
 | 
					                                                      self.product_id.display_name)), | 
				
			||||
 | 
					                    'employee_id': self.employee_id.id, | 
				
			||||
 | 
					                    'is_manufacturing': True | 
				
			||||
 | 
					                }) | 
				
			||||
 | 
					        return res | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def button_pending(self): | 
				
			||||
 | 
					        """ Supering the function of pause button to set timesheet in | 
				
			||||
 | 
					            progress state. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            Boolean: Returns true | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        res = super(MrpWorkorder, self).button_pending() | 
				
			||||
 | 
					        project = self.env['project.project'].search( | 
				
			||||
 | 
					            [('name', '=', ("MO: {}".format(self.production_id.name)))]) | 
				
			||||
 | 
					        task_id = project.task_ids.search([('name', '=', ( | 
				
			||||
 | 
					            "{} in {} for {} on {}".format(self.name, self.workcenter_id.name, | 
				
			||||
 | 
					                                           self.product_id.display_name, | 
				
			||||
 | 
					                                           str(self.date_start))))]) | 
				
			||||
 | 
					        task_id.write({ | 
				
			||||
 | 
					            'allocated_hours': self.duration_expected | 
				
			||||
 | 
					        }) | 
				
			||||
 | 
					        timesheet = task_id.mapped('timesheet_ids') | 
				
			||||
 | 
					        for rec in timesheet: | 
				
			||||
 | 
					            rec.write({ | 
				
			||||
 | 
					                'unit_amount': self.duration, | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					        return res | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def button_finish(self): | 
				
			||||
 | 
					        """ Supering the function of done button to calculate total time in | 
				
			||||
 | 
					            timesheet. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            Boolean: Returns true | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        res = super(MrpWorkorder, self).button_finish() | 
				
			||||
 | 
					        project = self.env['project.project'].search( | 
				
			||||
 | 
					            [('name', '=', ("MO: {}".format(self.production_id.name)))]) | 
				
			||||
 | 
					        task_id = project.task_ids.search([('name', '=', ( | 
				
			||||
 | 
					            "{} in {} for {} on {}".format(self.name, self.workcenter_id.name, | 
				
			||||
 | 
					                                           self.product_id.display_name, | 
				
			||||
 | 
					                                           str(self.date_start))))]) | 
				
			||||
 | 
					        task_id.write({ | 
				
			||||
 | 
					            'allocated_hours': self.duration_expected | 
				
			||||
 | 
					        }) | 
				
			||||
 | 
					        timesheet = task_id.mapped('timesheet_ids') | 
				
			||||
 | 
					        for rec in timesheet: | 
				
			||||
 | 
					            rec.write({ | 
				
			||||
 | 
					                'unit_amount': self.duration, | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					        return res | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.depends('employee_id') | 
				
			||||
 | 
					    def _compute_employee_id(self): | 
				
			||||
 | 
					        for workorder in self: | 
				
			||||
 | 
					               workorder.employee_id = workorder.employee_id | 
				
			||||
@ -0,0 +1,33 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | 
				
			||||
 | 
					#    Author: Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					################################################################################ | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class ProjectProject(models.Model): | 
				
			||||
 | 
					    """Inherited model project_project to add a new field related to | 
				
			||||
 | 
					       manufacturing timesheet""" | 
				
			||||
 | 
					    _inherit = 'project.project' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    is_manufacturing = fields.Boolean(string='Is Manufacturing', | 
				
			||||
 | 
					                                      help='This boolean will help to ' | 
				
			||||
 | 
					                                           'recognise the projects related' | 
				
			||||
 | 
					                                           ' to manufacturing.') | 
				
			||||
| 
		 After Width: | Height: | Size: 2.2 KiB  | 
| 
		 After Width: | Height: | Size: 28 KiB  | 
| 
		 After Width: | Height: | Size: 628 KiB  | 
| 
		 After Width: | Height: | Size: 1.1 KiB  | 
| 
		 After Width: | Height: | Size: 210 KiB  | 
| 
		 After Width: | Height: | Size: 209 KiB  | 
| 
		 After Width: | Height: | Size: 109 KiB  | 
| 
		 After Width: | Height: | Size: 495 B  | 
| 
		 After Width: | Height: | Size: 1.0 KiB  | 
| 
		 After Width: | Height: | Size: 624 B  | 
| 
		 After Width: | Height: | Size: 136 KiB  | 
| 
		 After Width: | Height: | Size: 214 KiB  | 
| 
		 After Width: | Height: | Size: 36 KiB  | 
| 
		 After Width: | Height: | Size: 3.6 KiB  | 
| 
		 After Width: | Height: | Size: 310 B  | 
| 
		 After Width: | Height: | Size: 929 B  | 
| 
		 After Width: | Height: | Size: 1.3 KiB  | 
| 
		 After Width: | Height: | Size: 3.3 KiB  | 
| 
		 After Width: | Height: | Size: 1.4 KiB  | 
| 
		 After Width: | Height: | Size: 17 KiB  | 
| 
		 After Width: | Height: | Size: 542 B  | 
| 
		 After Width: | Height: | Size: 576 B  | 
| 
		 After Width: | Height: | Size: 733 B  | 
| 
		 After Width: | Height: | Size: 4.3 KiB  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 4.0 KiB  | 
| 
		 After Width: | Height: | Size: 1.7 KiB  | 
| 
		 After Width: | Height: | Size: 330 KiB  | 
| 
		 After Width: | Height: | Size: 2.2 KiB  | 
| 
		 After Width: | Height: | Size: 911 B  | 
| 
		 After Width: | Height: | Size: 1.1 KiB  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 600 B  | 
| 
		 After Width: | Height: | Size: 673 B  | 
| 
		 After Width: | Height: | Size: 2.0 KiB  | 
| 
		 After Width: | Height: | Size: 462 B  | 
| 
		 After Width: | Height: | Size: 2.1 KiB  | 
| 
		 After Width: | Height: | Size: 926 B  | 
| 
		 After Width: | Height: | Size: 9.0 KiB  | 
| 
		 After Width: | Height: | Size: 23 KiB  | 
| 
		 After Width: | Height: | Size: 7.0 KiB  | 
| 
		 After Width: | Height: | Size: 878 B  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 653 B  | 
| 
		 After Width: | Height: | Size: 800 B  | 
| 
		 After Width: | Height: | Size: 905 B  | 
| 
		 After Width: | Height: | Size: 189 KiB  | 
| 
		 After Width: | Height: | Size: 4.3 KiB  | 
| 
		 After Width: | Height: | Size: 839 B  | 
| 
		 After Width: | Height: | Size: 1.7 KiB  | 
| 
		 After Width: | Height: | Size: 5.9 KiB  | 
| 
		 After Width: | Height: | Size: 1.6 KiB  | 
| 
		 After Width: | Height: | Size: 34 KiB  | 
| 
		 After Width: | Height: | Size: 26 KiB  | 
| 
		 After Width: | Height: | Size: 3.8 KiB  | 
| 
		 After Width: | Height: | Size: 23 KiB  | 
| 
		 After Width: | Height: | Size: 1.9 KiB  | 
| 
		 After Width: | Height: | Size: 2.3 KiB  | 
| 
		 After Width: | Height: | Size: 427 B  | 
| 
		 After Width: | Height: | Size: 627 B  | 
| 
		 After Width: | Height: | Size: 1.1 KiB  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 988 B  | 
| 
		 After Width: | Height: | Size: 3.7 KiB  | 
| 
		 After Width: | Height: | Size: 5.0 KiB  | 
| 
		 After Width: | Height: | Size: 875 B  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 767 KiB  | 
| 
		 After Width: | Height: | Size: 138 KiB  | 
| 
		 After Width: | Height: | Size: 760 KiB  | 
| 
		 After Width: | Height: | Size: 92 KiB  | 
| 
		 After Width: | Height: | Size: 697 KiB  | 
| 
		 After Width: | Height: | Size: 1.1 MiB  | 
| 
		 After Width: | Height: | Size: 129 KiB  | 
| 
		 After Width: | Height: | Size: 111 KiB  | 
| 
		 After Width: | Height: | Size: 47 KiB  | 
| 
		 After Width: | Height: | Size: 126 KiB  | 
| 
		 After Width: | Height: | Size: 139 KiB  | 
| 
		 After Width: | Height: | Size: 73 KiB  | 
| 
		 After Width: | Height: | Size: 43 KiB  | 
| 
		 After Width: | Height: | Size: 110 KiB  | 
| 
		 After Width: | Height: | Size: 143 KiB  | 
| 
		 After Width: | Height: | Size: 110 KiB  | 
| 
		 After Width: | Height: | Size: 143 KiB  | 
| 
		 After Width: | Height: | Size: 880 KiB  | 
| 
		 After Width: | Height: | Size: 88 KiB  | 
| 
		 After Width: | Height: | Size: 11 KiB  | 
@ -0,0 +1,30 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="UTF-8" ?> | 
				
			||||
 | 
					<odoo> | 
				
			||||
 | 
					<!--   inherited tree view for all manufacturing timesheet--> | 
				
			||||
 | 
					    <record id="timesheet_view_tree_user" model="ir.ui.view"> | 
				
			||||
 | 
					        <field name="name">account.analytic.line.view.tree.inherit.manufacturing.timesheet</field> | 
				
			||||
 | 
					        <field name="model">account.analytic.line</field> | 
				
			||||
 | 
					        <field name="inherit_id" | 
				
			||||
 | 
					               ref="hr_timesheet.timesheet_view_tree_user"/> | 
				
			||||
 | 
					        <field name="arch" type="xml"> | 
				
			||||
 | 
					            <xpath expr="//field[@name='unit_amount']" | 
				
			||||
 | 
					                   position="after"> | 
				
			||||
 | 
					                <field name="is_manufacturing" invisible="1"/> | 
				
			||||
 | 
					            </xpath> | 
				
			||||
 | 
					        </field> | 
				
			||||
 | 
					    </record> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<!--    inherited tree view for my manufacturing timesheet--> | 
				
			||||
 | 
					    <record id="hr_timesheet_line_tree" model="ir.ui.view"> | 
				
			||||
 | 
					        <field name="name">account.analytic.line.view.tree.inherit.manufacturing.timesheet</field> | 
				
			||||
 | 
					        <field name="model">account.analytic.line</field> | 
				
			||||
 | 
					        <field name="inherit_id" | 
				
			||||
 | 
					               ref="hr_timesheet.hr_timesheet_line_tree"/> | 
				
			||||
 | 
					        <field name="arch" type="xml"> | 
				
			||||
 | 
					            <xpath expr="//field[@name='unit_amount']" | 
				
			||||
 | 
					                   position="after"> | 
				
			||||
 | 
					                <field name="is_manufacturing" invisible="1"/> | 
				
			||||
 | 
					            </xpath> | 
				
			||||
 | 
					        </field> | 
				
			||||
 | 
					    </record> | 
				
			||||
 | 
					</odoo> | 
				
			||||
@ -0,0 +1,13 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="UTF-8" ?> | 
				
			||||
 | 
					<odoo> | 
				
			||||
 | 
					<record id="mrp_production_workorder_tree_editable_view_inherit_manufacturing_timesheet" model="ir.ui.view"> | 
				
			||||
 | 
					        <field name="name">mrp.production.work.order.list.editable.inherit.manufacturing.timesheet</field> | 
				
			||||
 | 
					        <field name="model">mrp.workorder</field> | 
				
			||||
 | 
					        <field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/> | 
				
			||||
 | 
					        <field name="arch" type="xml"> | 
				
			||||
 | 
					            <xpath expr="//field[@name='product_id']" position="after"> | 
				
			||||
 | 
					                <field name="employee_id" optional="show"/> | 
				
			||||
 | 
					            </xpath> | 
				
			||||
 | 
					        </field> | 
				
			||||
 | 
					    </record> | 
				
			||||
 | 
					</odoo> | 
				
			||||
@ -0,0 +1,29 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="UTF-8" ?> | 
				
			||||
 | 
					<odoo> | 
				
			||||
 | 
					<!--       action for manufacturing timesheet--> | 
				
			||||
 | 
					        <record id="manufacturing_timesheet_action" model="ir.actions.act_window"> | 
				
			||||
 | 
					            <field name="name">Timesheet</field> | 
				
			||||
 | 
					            <field name="type">ir.actions.act_window</field> | 
				
			||||
 | 
					            <field name="res_model">account.analytic.line</field> | 
				
			||||
 | 
					            <field name="view_mode">list</field> | 
				
			||||
 | 
					            <field name="context">{'create': False}</field> | 
				
			||||
 | 
					            <field name="domain">[('is_manufacturing','=',True)] | 
				
			||||
 | 
					            </field> | 
				
			||||
 | 
					            <field name="help" type="html"> | 
				
			||||
 | 
					                <p class="o_view_nocontent_smiling_face"> | 
				
			||||
 | 
					                    No Timesheet | 
				
			||||
 | 
					                </p> | 
				
			||||
 | 
					            </field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        <menuitem id="manufacturing_timesheet_menu_root" | 
				
			||||
 | 
					                  name="Timesheet" | 
				
			||||
 | 
					                  parent="mrp.menu_mrp_root" | 
				
			||||
 | 
					                  sequence="23"/> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        <menuitem id="manufacturing_timesheet_all_menu_root" | 
				
			||||
 | 
					                  name="Timesheet" | 
				
			||||
 | 
					                  parent="manufacturing_timesheet.manufacturing_timesheet_menu_root" | 
				
			||||
 | 
					                  action="manufacturing_timesheet_action" | 
				
			||||
 | 
					                  sequence="5"/> | 
				
			||||
 | 
					</odoo> | 
				
			||||