mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
================ MRP Project Link ================ This module links projects and tasks to *manufacturing orders* (MO) and *work orders* (WO). Usage ===== In a manufacturing order (MO), you can select a project to be attached to it. If none is selected, a project is automatically created when the MO is confirmed. When the MO starts, a task is created and assigned to the order.
19 lines
595 B
Python
19 lines
595 B
Python
# -*- coding: utf-8 -*-
|
|
# (c) 2014 Daniel Campos <danielcampos@avanzosc.es>
|
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
|
|
from openerp import models, fields, api
|
|
|
|
|
|
class ProjectProject(models.Model):
|
|
_inherit = 'project.project'
|
|
|
|
@api.one
|
|
def _project_shortcut_count(self):
|
|
self.production_count = len(
|
|
self.env['mrp.production'].search([('project_id', '=', self.id)]))
|
|
|
|
production_count = fields.Integer(
|
|
string='Manufacturing Count', compute=_project_shortcut_count)
|
|
automatic_creation = fields.Boolean('Automatic Creation')
|