mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
opt superbar
This commit is contained in:
@@ -34,8 +34,8 @@ class MrpProduction(models.Model):
|
||||
def create(self, values):
|
||||
# 配置层级关系
|
||||
if 'origin' in values and values['origin']:
|
||||
mo = self.env['mrp.production'].search([('name', '=', values['origin'])])
|
||||
mo = self.env['mrp.production'].search([('name', '=', values['origin'])], limit=1, order='id desc')
|
||||
if len(mo) == 1:
|
||||
values['parent_id'] = mo.id
|
||||
values['parent_id'] = mo[0].id
|
||||
res = super(MrpProduction, self).create(values)
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user