From de533c36425ba7f575d4cbb3d78ea39b6e92d720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 26 Aug 2022 17:48:38 +0200 Subject: [PATCH] Require cost price for drop move The continental accounting requires a cost for such moves. issue11654 review439401003 (grafted from c2158d1ef10a4b87f09a353d5db6ba07dc87a95d) --HG-- branch : 6.0 --- move.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/move.py b/move.py index 526b4789db..6f9540ea54 100644 --- a/move.py +++ b/move.py @@ -471,9 +471,9 @@ class Move(Workflow, ModelSQL, ModelView): return True if from_type in {'storage', 'drop'} and to_type == 'customer': return True - if from_type == 'storage' and to_type == 'supplier': + if from_type in {'storage', 'drop'} and to_type == 'supplier': return True - if from_type == 'customer' and to_type == 'storage': + if from_type == 'customer' and to_type == {'storage', 'drop'}: return True return False @@ -482,7 +482,9 @@ class Move(Workflow, ModelSQL, ModelView): from_type = self.from_location.type if self.from_location else None to_type = self.to_location.type if self.to_location else None return ((from_type != 'storage' and to_type == 'storage') - or (from_type == 'storage' and to_type != 'storage')) + or (from_type == 'storage' and to_type != 'storage') + or (from_type != 'drop' and to_type == 'drop') + or (from_type == 'drop' and to_type != 'drop')) @fields.depends('from_location', 'quantity') def on_change_with_assignation_required(self, name=None):