batch script for location update
user_0223141589
python
2 years ago
379 B
13
Indexable
write_date = "2023-XX-XX 00:00:00"
users = []
locations = env['stock.location'].search([('active', '=', True),('write_date', '>=', write_date),('write_uid', 'in', users)])
total_count = len(locations)
BATCH_SIZE = 100
while locations:
to_works = locations[:BATCH_SIZE]
to_works.with_delay()._onchange_zip_location_type_id()
locations = locations[BATCH_SIZE:]Editor is loading...