Hi Friends
I want to have a product code component in addition to default components on the interface of product creation view. For this purpose, first i created a field `x_product_code` both in product.template and in product.product. Then i tried to add this field to the view `product.template.common.form`. But I did not achieve my goal. I also want this `product code` option to appear in sales order creation view.
Could you help me with this please?
It would help if you can clarify what do you mean by "But I did not achieve my goal." How does it now achieve your goal, are there any error? Also, I doubt that "product.template.common.form" view is used anywhere. Also, you need to clarify where you want "this `product code` option to appear in sales order creation view". Assuming that you want it to appear in the sale.order.line (which is the only option I can think of), you need to define a related field in the sale.order.line, change related the view to display that field, implement on_change mechanism on product_id field of sale.order.line if you want the field to change value as product_id is changed. If you don't implement the on_change mechanism, the value will be correct after it is saved.
Well, Mr.Doe. You are right about making it clear. I want to have another field when i want to create a product. I mean, when i go to products page in sales module and click "create" on that page, there comes a product creation interface. Normally there we can find product name, can be sold, can be expensed, etc options. I want to add a new component to that interface. It will be used to enter product code information. When i go to devrloper mode and when i click the manage views i see several views related to that interface. I discovered product.template.common.form contains the default components. Then first by creating a product code field, i wanted to add that field to that view. But i could not manage to add it to the interface the way i wanted. Maybe it would be better to put it just below the product name component. Also, i want to see this new product code field to be appeared in sale.order.line just the way you mentioned. So i can add a product by its product code . Thanks
Well, Mr.Doe. You are right about making it clear. I want to have another field when i want to create a product. I mean, when i go to products page in sales module and click "create" on that page, there comes a product creation interface. Normally there we can find product name, can be sold, can be expensed, etc options. I want to add a new component to that interface. It will be used to enter product code information. When i go to devrloper mode and when i click the manage views i see several views related to that interface. I discovered product.template.common.form contains the default components. Then first by creating a product code field, i wanted to add that field to that view. But i could not manage to add it to the interface the way i wanted. Maybe it would be better to put it just below the product name component. Also, i want to see this new product code field to be appeared in sale.order.line just the way you mentioned. So i can add a product by its product code . Thanks
Well, Mr.Doe. You are right about making it clear. I want to have another field when i want to create a product. I mean, when i go to products page in sales module and click "create" on that page, there comes a product creation interface. Normally there we can find product name, can be sold, can be expensed, etc options. I want to add a new component to that interface. It will be used to enter product code information. When i go to devrloper mode and when i click the manage views i see several views related to that interface. I discovered product.template.common.form contains the default components. Then first by creating a product code field, i wanted to add that field to that view. But i could not manage to add it to the interface the way i wanted. Maybe it would be better to put it just below the product name component. Also, i want to see this new product code field to be appeared in sale.order.line just the way you mentioned. So i can add a product by its product code . Thanks
If you go to Sales >> Products >> Products menu and open one of the product in form view, activate developer mode, and select Edit Form View from the developer mode's drop down, you'll see that the form used is product.product_normal_form_view. Maybe you can try inheriting that form first?