Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi Usman,
Please find below the code
exist_attr = attr_line_obj.search([('product_tmpl_id', '=', template_id.id), ('attribute_id', '=', att_id.id)], limit=1)
if exist_attr:
variant_Vals.append((1, exist_attr.id, {'value_ids': [(4, a_v_id)]}))
else:
variant_Vals.append((0, 0, {'attribute_id': att_id.id, 'value_ids': [(4, a_v_id)]}))
Hope it is work.
you are just amazing love it thank you sooo much for solving my prlbm ......
When I make a custom app, I use the custom view to update a record's value. So whenever I wanted to edit an existing record, I just click Edit Button in the top left page to edit it. So sorry if this isn't the answer you need.
Hi Usman,
Here is an example of code for updating product template attributes.
Check this and try to fix your problem, while considering this
@api.multi |
Thanks & Regards
Avinash N K
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 8 23
|
2628 | ||
|
1
thg 7 23
|
2799 | ||
|
0
thg 7 23
|
2352 | ||
|
0
thg 7 23
|
2271 | ||
|
0
thg 1 21
|
3244 |
What is the value inside the template_id variable?
If it is the product record, tell me what is the problem you are facing.
If it is not a product record, try to take the product record in that variable.
Like this: self.env[product.template].browse(id_of_record).write(values)
yes template_id is product.template
but write method is not working
You can show me the full function?
for better understanding please update your code