Add patch for issue9902.
This commit is contained in:
parent
91e1a8e791
commit
7a990ae2fa
|
@ -0,0 +1,34 @@
|
|||
index 7995ab4..fae4268 100644
|
||||
--- a/trytond/trytond/modules/stock/move.py
|
||||
+++ b/trytond/trytond/modules/stock/move.py
|
||||
@@ -841,6 +841,8 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
child_locations = {}
|
||||
to_write = []
|
||||
to_assign = []
|
||||
+ to_copy_moves = []
|
||||
+ to_copy_values = []
|
||||
success = True
|
||||
for move in moves:
|
||||
if move.state != 'draft':
|
||||
@@ -900,14 +902,19 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
to_assign.append(move)
|
||||
first = False
|
||||
else:
|
||||
- with Transaction().set_context(_stock_move_split=True):
|
||||
- to_assign.extend(cls.copy([move], default=values))
|
||||
+ to_copy_moves.append(move)
|
||||
+ to_copy_values.append(values)
|
||||
|
||||
qty_default_uom = Uom.compute_qty(move.uom, qty,
|
||||
move.product.default_uom, round=False)
|
||||
|
||||
from_key = get_key(move, from_location)
|
||||
pbl[from_key] = pbl.get(from_key, 0.0) - qty_default_uom
|
||||
+ if to_copy_moves:
|
||||
+ with Transaction().set_context(_stock_move_split=True):
|
||||
+ copied = cls.copy(to_copy_moves)
|
||||
+ for record, values in zip(copied, to_copy_values):
|
||||
+ to_write.extend([[record], values])
|
||||
if to_write:
|
||||
cls.write(*to_write)
|
||||
if to_assign:
|
2
series
2
series
|
@ -55,3 +55,5 @@ account_payment_search_payment_amount.diff # [account_payment] Optimize searcher
|
|||
purchase_line_rule.diff # [purchase] Add missing rule on purchase_line
|
||||
|
||||
issue9797.diff # [account_payment_sepa] Slowness processing sepa
|
||||
|
||||
issue9802.diff # [stock] Improve performance when partially assigning moves
|
||||
|
|
Loading…
Reference in New Issue