add move.do function write in batch

This commit is contained in:
??ngel ??lvarez 2016-02-07 12:18:40 +01:00
parent 8f0a7b5f8d
commit ac916015de
2 changed files with 23 additions and 1 deletions

21
move_do_batch_write.diff Normal file
View File

@ -0,0 +1,21 @@
diff -r f5ce0a0d7852 move.py
--- a/trytond/trytond/modules/stock/move.py Sun Feb 07 11:51:19 2016 +0100
+++ b/trytond/trytond/modules/stock/move.py Sun Feb 07 12:12:24 2016 +0100
@@ -623,11 +623,15 @@
@Workflow.transition('done')
def do(cls, moves):
cls.check_origin(moves)
+ to_write = []
for move in moves:
move.set_effective_date()
move._do()
- move.state = 'done'
- move.save()
+ to_write.extend(([move], move._save_values))
+
+ if to_write:
+ cls.write(*to_write)
+
def _do(self):
if (self.from_location.type in ('supplier', 'production')

3
series
View File

@ -89,6 +89,7 @@ improve_stock_by_locations_performance.diff
#stock_lot_fix_pick_product_without_outgoing_moves.diff
#purchase_fix_get_move_done_rounding.diff
#multicompany_cron.diff
#025476_5154_5155_5456_optimize_move_write_assign.diff
025476_5154_5155_5456_optimize_move_write_assign.diff
#do_not_lock_on_assign_try.diff
#limit_invoices_in_creit_note_action_by_domain.diff
move_do_batch_write.diff