From 0dcc364508cda4252608453d9bf4e411f37838bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 13 Apr 2011 11:19:05 +0200 Subject: [PATCH] Force effective_date only if not defined --- move.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/move.py b/move.py index 2bbdefc4a7..0640ee8f68 100644 --- a/move.py +++ b/move.py @@ -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' \