[FIX] mrp_production_hierarchy: do not display canceled production orders

This commit is contained in:
sebalix
2018-08-07 11:05:53 +02:00
parent 03f716e9ae
commit d19c9f1c2b

View File

@@ -18,7 +18,8 @@ class MrpProduction(models.Model):
'mrp.production', u"Parent order",
index=True, ondelete='restrict', readonly=True)
child_ids = fields.One2many(
'mrp.production', 'parent_id', u"Child orders")
'mrp.production', 'parent_id', u"Child orders",
domain=[('state', '!=', 'cancel')])
parent_left = fields.Integer('Left Parent', index=True)
parent_right = fields.Integer('Right Parent', index=True)
@@ -42,8 +43,7 @@ class MrpProduction(models.Model):
self.ensure_one()
if self.child_ids:
return {
'domain': "[('id', '=', %s), ('state', '!=', 'cancel')]" % (
self.id),
'domain': "[('id', '=', %s)]" % self.id,
'name': _(u"Hierarchy"),
'view_type': 'tree',
'view_mode': 'tree',