changeset 397598d3f20d in modules/stock:6.2
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=397598d3f20d
description:
        Require cost price for drop move

        The continental accounting requires a cost for such moves.

        issue11654
        review439401003
        (grafted from c2158d1ef10a4b87f09a353d5db6ba07dc87a95d)
diffstat:

 move.py |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 10effeee3a6c -r 397598d3f20d move.py
--- a/move.py   Fri Jul 01 23:17:21 2022 +0200
+++ b/move.py   Fri Aug 26 17:48:38 2022 +0200
@@ -458,9 +458,9 @@
             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
 
@@ -469,7 +469,9 @@
         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):

Reply via email to