Improve set_at_warehouse script

This commit is contained in:
Sergio Morillo 2023-09-07 09:42:50 +02:00
parent 5be7fdc0bb
commit f099f10117
1 changed files with 9 additions and 0 deletions

View File

@ -61,6 +61,8 @@ if __name__ == '__main__':
wh = record.shipment.to_location.warehouse
elif key == 'receipt':
wh = record.goods_receipt_line.receipt.warehouse
elif key == 'warehouse':
wh = record.warehouse
elif not key:
wh = record.get_at_warehouse()
else:
@ -101,5 +103,12 @@ if __name__ == '__main__':
('goods_receipt_line.receipt.state', '=', 'done')
],
key='receipt')
# warehouse production
set_warehouse(
extra_domain=[
('shipment', '=', None),
('warehouse', '!=', None),
],
key='warehouse')
# others
set_warehouse()