Odoo Help

1

How can I make a field required if there are m2m relations?

By
Kit Sunde
on 11/3/14, 2:45 PM 5,322 views

I tried doing this:

<field name="allergy_verification" attrs="{'required': [('allergy_ids', '!=', [])]}" />

However if allergy_ids is blank, then allergy_verification is still marked as required. What am I doing wrong?

1
Jairo Llopis
On 12/11/14, 5:23 AM

See https://github.com/odoo/odoo/issues/674

<field name="allergy_verification" attrs="{'required': [('allergy_ids', '!=', [[6, False, []]])]}" />

Cool beans, thanks.

Kit Sunde
on 12/11/14, 5:28 AM
0

Prakash

--Prakash--
3218
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 11/15/14, 1:16 AM

Try the code:-

<field name="allergy_verification" attrs="{'required': [('allergy_ids', '!=', False)]}" />

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 11/3/14, 2:45 PM
Seen: 5322 times
Last updated: 3/16/15, 8:10 AM