Fix on_change_* methods

This commit is contained in:
Jes?s Mart?n Jim?nez 2016-07-05 13:24:17 +02:00
parent 47608418d0
commit 82de887b04
2 changed files with 4 additions and 10 deletions

View File

@ -35,11 +35,9 @@ class ProductBom:
@fields.depends('process', 'bom', 'route')
def on_change_process(self):
res = {}
if self.process:
res['bom'] = self.process.bom.id
res['route'] = self.process.route.id
return res
self.bom = self.process.bom
self.route = self.process.route
@classmethod
def create(cls, vlist):

View File

@ -369,15 +369,11 @@ class Production:
@fields.depends(*(BOM_CHANGES + ['process', 'route', 'operations']))
def on_change_process(self):
res = {}
if self.process:
self.bom = self.process.bom
res['bom'] = self.bom.id
self.route = self.process.route
res['route'] = self.route.id
res.update(self.update_operations())
res.update(self.explode_bom())
return res
self.on_change_route()
self.explode_bom()
@classmethod
def compute_request(cls, product, warehouse, quantity, date, company):