This commit is contained in:
胡尧
2025-07-07 11:59:14 +08:00
parent c6c4331c0b
commit 8b3eef1256
118 changed files with 140103 additions and 0 deletions

15
mrp_plm/models/product.py Normal file
View File

@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class ProductTemplate(models.Model):
_inherit = 'product.template'
version = fields.Integer('Version', default=1, readonly=True, copy=False, help="The current version of the product.")
eco_count = fields.Integer('# ECOs',compute='_compute_eco_count')
eco_ids = fields.One2many('mrp.eco', 'product_tmpl_id', 'ECOs')
def _compute_eco_count(self):
for p in self:
p.eco_count = len(p.eco_ids)