Hi,
Thanks to
I needed this trick in odoo v8, so here is my version :
class ProductProduct(models.Model):
_inherit = 'product.product'
@api.model
def create(self, data, context=None):
""" add a default orderpoint line to every new product """
product = super(ProductProduct, self).create(data, context=context)
# apply same domain rule as the one of button "Règles de réassort" of the odoo-web interface
if product.product_tmpl_id.type != 'service':
# add automatically the orderpoint (règle d'approvisionnement)
vals = {
'product_id': product.id,
'product_min_qty': 0,
'product_max_qty': 0,
'qty_multiple': 1,
}
# desperatly a call with old api way but I didn't succeded to do this with the new api way
self.pool.get('stock.warehouse.orderpoint').create(self._cr, self._uid, vals, context=context)
return product
Now, I'd like to add a rule to check if the sub-record stock.warehouse.orderpoint is still there when there is an update (otherwize, the integrity is not fully checked)
ok I've deleted both answers since they are not related to your question
Where is "minimum order quantity field"?
sorry it is "minimum stock rules" since I am using openerp in my native such errors occurs. I just corrected the question.
Just tried editing the default value directly in the database "stock_warehouse_orderpoint" but had no affect - Sorry - i'll bump the question
Maybe by creating an automatic action to be triggered when creating new products? I've seen that this is possible in administrator settings