company_id: base.main_company
location_id: stock.stock_location_stock
logic: max
- name: OP/00002
product_id: product_product_wood0
product_max_qty: 15.0
product_min_qty: 10.0
-
Now I make a sale order for table.
-
- !record {model: sale.order, id: sale_order_so0}:
+ !record {model: sale.order, id: sale_order_so3}:
amount_total: 5.0
amount_untaxed: 5.0
date_order: '2010-04-30'
invoice_quantity: order
- name: SO006
order_line:
- company_id: base.main_company
delay: 7.0
-
I confirm the order.
-
- !workflow {model: sale.order, action: order_confirm, ref: sale_order_so0}
+ !workflow {model: sale.order, action: order_confirm, ref: sale_order_so3}
-
I check that one procurement is generated.
-
def create_forecast(self,cr, uid, ids, context={}):
product_obj = self.pool.get('product.product')
forecast_obj=self.pool.get('stock.sale.forecast')
+ mod_obj =self.pool.get('ir.model.data')
for f in self.browse(cr, uid, ids, context):
prod_categ_obj=self.pool.get('product.category')
template_obj=self.pool.get('product.template')
'product_uom_categ' : p.uom_id.category_id.id,
'product_uos_categ' : prod_uos_categ,
})
+ result = mod_obj._get_id(cr, uid, 'stock_planning', 'view_stock_sale_forecast_filter')
+ id = mod_obj.read(cr, uid, result, ['res_id'], context=context)
return {
'view_type': 'form',
"view_mode": 'tree',
'res_model': 'stock.sale.forecast',
- 'type': 'ir.actions.act_window',
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': id['res_id'],
}
stock_sale_forecast_createlines()
def create_planning(self,cr, uid, ids, context={}):
product_obj = self.pool.get('product.product')
planning_obj=self.pool.get('stock.planning')
-
+ mod_obj =self.pool.get('ir.model.data')
for f in self.browse(cr, uid, ids, context=context):
if f.forecasted_products:
cr.execute("SELECT product_id \
'stock_supply_location': stock_supply_location,
})
+ result = mod_obj._get_id(cr, uid, 'stock_planning', 'view_stock_planning_filter')
+ id = mod_obj.read(cr, uid, result, ['res_id'], context=context)
return {
'view_type': 'form',
"view_mode": 'tree',
'res_model': 'stock.planning',
- 'type': 'ir.actions.act_window',
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': id['res_id'],
}
stock_planning_createlines()