after changing the field to widget=selection,

Asked by Bushair

Hi,
I modifed the following lines in the pos_view.xml file

<tree string="Order lines" editable="bottom">
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" width="275" />

to

<tree string="Order lines" editable="bottom">
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" width="275" widget="selection" />

ie added the widget="selection" .

I selected a product from the selection widget, [PC1] Basic PC is the product i selected and then tried to add another product by pressing enter.
The added product is displaying as

[Edit] 1.00 0.00 450.00 450.00.

But the product name is missing .

The product name should come as shown below

[Edit] [PC1] Basic PC 1.00 0.00 450.00 450.00.

The product name is missing after i have done the above modification..
What should i do to get the product name also ?

thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#1

Hello Bushair ,

In product_id is many2one relation and by default it will show you code with name because in name_get method code and name will be merged together so if want only name then override the name_get method of 'product.product' model and change the code accordingly.

Hope this will help you.

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Bushair for more information if necessary.

To post a message you must log in.