i am created new field brand in product,how can i display the brand name when selecting a product in sales order form
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
1
Reply
6246
Views
Hi,
You can achieve this by overwriting name_get method of product.
You just need to inherit the Product class and add below method.
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
res = []
product_read = self.read(cr, uid, ids, ['name', 'default_code' ,'brand'], context=context)
for product in product_read:
name = ''
if product.get('default_code',False):
name='['+product.get('default_code')+'] '
if product.get('brand',False):
name+='['+product.get('brand')+'] '
name+=product.get('name',False)
res.append((product['id'], name))
return res
Above is just an example, you can customize and add values based on requirements.
Thanks,
www.acespritech.com
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
|
0
Mar 15
|
4448 | ||
|
|
0
Mar 15
|
4197 | ||
|
|
1
Dec 23
|
2955 | ||
|
|
4
Jun 23
|
7418 | ||
|
|
0
Dec 20
|
2343 |