mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
Merge pull request #85 from ddico/submit_add_timesheet_to_cost
[FIX] mrp_production_real_cost - include timesheet in cost
This commit is contained in:
@@ -8,3 +8,4 @@ from . import account_analytic_line
|
||||
from . import project_project
|
||||
from . import project_task
|
||||
from . import project_task_work
|
||||
from . import hr_analytic_timesheet
|
||||
|
||||
16
mrp_project/models/hr_analytic_timesheet.py
Normal file
16
mrp_project/models/hr_analytic_timesheet.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2016 Daniel Dico <dd@oerp.ca>
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
from openerp import models, api
|
||||
|
||||
|
||||
class HrAnalyticTimesheet(models.Model):
|
||||
_inherit = "hr.analytic.timesheet"
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
production = self._context.get('production', False)
|
||||
vals['mrp_production_id'] = vals.get(
|
||||
'mrp_production_id', False) or production and production.id
|
||||
return super(HrAnalyticTimesheet, self).create(vals)
|
||||
@@ -91,3 +91,8 @@ class MrpProductionWorkcenterLine(models.Model):
|
||||
work_ids = fields.One2many(
|
||||
comodel_name="project.task.work", inverse_name="workorder",
|
||||
string="Task works")
|
||||
|
||||
@api.multi
|
||||
def write(self, vals, update=True):
|
||||
return super(MrpProductionWorkcenterLine, self.with_context(
|
||||
production=self.production_id)).write(vals)
|
||||
|
||||
@@ -29,3 +29,8 @@ class ProjectTask(models.Model):
|
||||
(task.id, "[%s] %s" % (task.user_id.name, task.name)))
|
||||
return res
|
||||
return super(ProjectTask, self).name_get()
|
||||
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
return super(ProjectTask, self.with_context(
|
||||
production=self.mrp_production_id)).write(vals)
|
||||
|
||||
Reference in New Issue
Block a user