Implement task 663

This commit is contained in:
Sergio Morillo 2015-05-21 10:03:12 +02:00
parent c57f44c6b4
commit 6847fddd64
1 changed files with 5 additions and 5 deletions

View File

@ -120,15 +120,15 @@ class Location:
self.space_unit = Uom(self.on_change_with_space_unit())
@fields.depends('space_measure')
def on_change_with_space_unit(self, name=None):
def on_change_with_space_unit(self, name=None, value=None):
pool = Pool()
Modeldata = pool.get('ir.model.data')
if not getattr(self, 'space_measure', None):
return None
if self.space_measure == 'length':
if not value:
value = self.space_measure
if value == 'length':
return Modeldata.get_id('product', 'uom_meter')
if self.space_measure == 'surface':
if value == 'surface':
return Modeldata.get_id('product', 'uom_square_meter')
return None