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

        The continental accounting requires a cost for such moves.

        issue11654
        review439401003
diffstat:

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

diffs (26 lines):

diff -r cf8768ee7f62 -r c2158d1ef10a move.py
--- a/move.py   Mon Aug 22 14:12:05 2022 +0200
+++ b/move.py   Fri Aug 26 17:48:38 2022 +0200
@@ -446,9 +446,9 @@
             return True
         if from_type in {'storage', 'drop', 'view'} and to_type == 'customer':
             return True
-        if from_type in {'storage', 'view'} and to_type == 'supplier':
+        if from_type in {'storage', 'drop', 'view'} and to_type == 'supplier':
             return True
-        if from_type == 'customer' and to_type == {'storage', 'view'}:
+        if from_type == 'customer' and to_type == {'storage', 'drop', 'view'}:
             return True
         return False
 
@@ -457,7 +457,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