Commit 7ac7652 1 parent c3d2112 commit 7ac7652 Copy full SHA for 7ac7652
File tree 1 file changed +10
-4
lines changed
stock_quant_history/models
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,10 @@ def _generate_stock_quant_history(self):
114
114
115
115
self .previous_snapshot_id = previous_quant_snapshot
116
116
if previous_quant_snapshot .stock_quant_history_ids .exists ():
117
- _logger .info ("Duplicate previous stock.quant.history..." )
117
+ _logger .info (
118
+ "Duplicate %s previous stock.quant.history..." ,
119
+ len (previous_quant_snapshot .stock_quant_history_ids ),
120
+ )
118
121
for stock_quant_history in previous_quant_snapshot .stock_quant_history_ids :
119
122
# copy is around 3x slower than create !
120
123
quant_copy = quant_history [
@@ -126,14 +129,17 @@ def _generate_stock_quant_history(self):
126
129
]
127
130
quant_copy .quantity = stock_quant_history .quantity
128
131
129
- _logger .info ("Apply stock.move.line since previous snapshot" )
130
- for move_line in (
132
+ stock_move_lines = (
131
133
self .env ["stock.move.line" ]
132
134
.sudo ()
133
135
.search (
134
136
self ._prepare_stock_move_line_filter (previous_quant_snapshot ),
135
137
)
136
- ):
138
+ )
139
+ _logger .info (
140
+ "Apply %s stock.move.line since previous snapshot" , len (stock_move_lines )
141
+ )
142
+ for move_line in stock_move_lines :
137
143
quant_history [
138
144
(move_line .product_id , move_line .lot_id , move_line .location_id )
139
145
].quantity -= move_line .qty_done
You can’t perform that action at this time.
0 commit comments