odoo/addons/purchase/purchase_stock_demo.yml

13 lines
424 B
YAML
Raw Normal View History

-
!python {model: stock.warehouse}: |
pull_obj = self.pool.get('procurement.rule')
wh_to_assign = ['stock_warehouse_shop0','stock_warehouse_shop1','warehouse_icecream']
for wh_ref in wh_to_assign:
warehouse = self.browse(cr, uid, ref('stock.' + wh_ref), context=context)
#Force the rewriting of route and rule
self.write(cr,uid,warehouse.id,{'can_buy_for_resupply':True},context=context)