Force effective_date only if not defined

This commit is contained in:
Cédric Krier
2011-04-13 11:19:05 +02:00
parent d64f10ef54
commit 0dcc364508
+4 -2
View File
@@ -545,11 +545,13 @@ class Move(ModelSQL, ModelView):
elif vals['state'] == 'assigned':
if move.state in ('cancel', 'done'):
self.raise_user_error('set_state_assigned')
vals['effective_date'] = date_obj.today()
if not vals.get('effective_date'):
vals['effective_date'] = date_obj.today()
elif vals['state'] == 'done':
if move.state in ('cancel'):
self.raise_user_error('set_state_done')
vals['effective_date'] = date_obj.today()
if not vals.get('effective_date'):
vals['effective_date'] = date_obj.today()
if move.from_location.type == 'supplier' \
and move.state != 'done' \