flectra/addons/purchase/data/purchase_stock_demo.yml

12 lines
482 B
YAML
Raw Normal View History

-
!python {model: stock.warehouse, id: False}: |
pull_obj = self.env['procurement.rule']
wh_to_assign = ['stock_warehouse_shop0']
for wh_ref in wh_to_assign:
warehouse = self.browse(ref('stock.' + wh_ref))
#Force the rewriting of route and rule
warehouse.write({'buy_to_resupply': True})
2018-07-13 11:21:38 +02:00
partner_id = ref('stock.res_partner_company_1')
warehouse = self.search([('partner_id', '=', partner_id)])
warehouse.write({'buy_to_resupply': True})