CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
In Sales Module, when we want to create a new sales order , its required to choose products. Normally we do it by selecting product names among available products. I need to change that. I must choose according to product codes. So I created a new field called x_product_code of char type in product.template object. I checked the sale.order.line model. My new field appears there. Then in the view of sale order creation (sale.order.form), i tried to add my own x_product_code field. But i could not understand how i should relate it with the other elements. especially, on_change part . How must i fill in that? When i choose product code, the other elements such as product name in slae order line must be filled automatically. Could you help me with that, please?
In sale.order.line class by default there will be an on change function created for product selectiion as "onchange_product_id" which will be used to return the default order line fields. So we have to override this method and manage your code aswell to return the data for new fields.
About This Community
Odoo Training Center
|Asked: 12/3/14, 12:24 AM|
|Seen: 1437 times|
|Last updated: 3/16/15, 8:10 AM|