Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
880 Lượt xem

How can I stop Odoo from auto-populating attribute values after I add an attribute to a product?

I am using a Manufacturer and a Brand attribute so that my customers can use this as a filter in the shop and also see the information on the product page. Display type is "Select", Variant Creation is "Never", and Filter Visibility is "Visible". All is good on the front end.

When I create a new product and add the Manufacturer attribute, all 200 possible values are auto-populated. I need to delete 199 of them... I would like the attribute value to be blank and select one option.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Jean-Sebastien


Solution would be Automation action on product.template.attribute.line model, to reset value of attribute value on selection of attribute. 


1) Activate Developer mode from setting --> Click on Activate Developer Mode.

2) Go to Settings --> Technical --> Autotmation Rules

3) Create new automation rules as following


Model -> Product Template Attribute Line

Trigger -> On UI Change

When updating --> Attribute

Add An action --> python code



record['value_ids'] = False


Thanks & Regards,

CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209

Email: info@candidroot.com

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I tried and it works like a charm. Much appreciated!

Ảnh đại diện
Huỷ bỏ