Files
odoo_source/addons/project_mrp/models/project.py
T
yhu-odoo f2422345fc [ADD] project_mrp: monitoring mrp in project
Show mrp information in project when both use the same analytic account.

Task-2469742
PR #68708
2021-08-27 16:40:49 +00:00

25 lines
829 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class Project(models.Model):
_inherit = "project.project"
production_count = fields.Integer(related="analytic_account_id.production_count")
workorder_count = fields.Integer(related="analytic_account_id.workorder_count")
bom_count = fields.Integer(related="analytic_account_id.bom_count")
def action_view_mrp_production(self):
self.ensure_one()
return self.analytic_account_id.action_view_mrp_production()
def action_view_mrp_bom(self):
self.ensure_one()
return self.analytic_account_id.action_view_mrp_bom()
def action_view_workorder(self):
self.ensure_one()
return self.analytic_account_id.action_view_workorder()