İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
890 Görünümler

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.

Avatar
Vazgeç
En İyi Yanı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

Avatar
Vazgeç
Üretici En İyi Yanıt

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

Avatar
Vazgeç