12345678910111213141516171819202122 |
- # -*- coding: utf-8 -*-
- from openerp.http import request as r
- def get_warehouses():
- return [
- {
- 'id': w.id,
- 'name': w.display_name,
- 'locationStock': {
- 'id': w.lot_stock_id.id,
- 'name': w.lot_stock_id.display_name
- }
- } for w in r.env.user.store_id.warehouse_ids
- ]
- def get_location_id(warehouse_id):
- if not warehouse_id:
- return None
- return r.env.user.store_id.warehouse_ids.filtered(lambda x: x.id == warehouse_id).lot_stock_id.id
|