Community mailing list archives

community@mail.odoo.com

Bug in sale order line create

by
OpenERP Master
- 09/07/2015 02:33:23
Hello,

I was doing some dev and noticed that the product_id_change method is always called even when creating a sales order via code/api instead of using the interface. This is called in method create on sale.order.line

https://github.com/odoo/odoo/blob/8.0/addons/sale/sale.py#L1083

It will call the onchange if regular fields are not preset, however it also requires field 'type' which is not a field in v8 stock. This means unless you pass an invalid field you will never be able to avoid calling onchange. Perhaps some module adds this field.