From 385b454b32af1f762fe9c369c178bf56c8123782 Mon Sep 17 00:00:00 2001 From: ?ngel ?lvarez Date: Thu, 8 Nov 2018 08:48:28 +0100 Subject: [PATCH] add lock_stock_move funtion to overwrite --- lock_stock_move.diff | 24 ++++++++++++++++++++++++ series | 1 + 2 files changed, 25 insertions(+) create mode 100644 lock_stock_move.diff diff --git a/lock_stock_move.diff b/lock_stock_move.diff new file mode 100644 index 0000000..2d67676 --- /dev/null +++ b/lock_stock_move.diff @@ -0,0 +1,24 @@ +diff -r c1860f118efd move.py +--- a/trytond/trytond/modules/stock/move.py Wed Nov 07 12:14:26 2018 +0100 ++++ b/trytond/trytond/modules/stock/move.py Wed Nov 07 12:18:14 2018 +0100 +@@ -823,6 +823,10 @@ + return to_pick + return to_pick + ++ @staticmethod ++ def lock_stock_move(): ++ return True ++ + @classmethod + def assign_try(cls, moves, with_childs=True, grouping=('product',)): + ''' +@@ -878,7 +882,8 @@ + with connection.cursor() as cursor: + cursor.execute(*query) + else: +- database.lock(connection, cls._table) ++ if cls.lock_stock_move(): ++ database.lock(connection, cls._table) + + with Transaction().set_context( + stock_date_end=stock_date_end, diff --git a/series b/series index b9ef240..9fd5528 100644 --- a/series +++ b/series @@ -21,3 +21,4 @@ issue240_631.diff # [stock_lot] stock_by_locations get all locations with that l issue10467.diff # stock_lot: add lot to grouping if lot it's required on product issue53451002_1_10001.diff #stock: Allow configuring which quantity is grouped in compute_quantities_query() needed by stock_number_of_packages issue7826.diff # [stock_package] Total packages moves are all +lock_stock_move.diff #[stock] Function to overwrite if lock table or not