Odoo Help

0

How to use widget='selection' and domain in many2one field

By
Maniganda
on 9/23/13, 5:05 AM 8,875 views

I have many 2one field like this <field name="contract_id" widget="selection" domain="[('partner_id','=',partner_id),('state','=','draft')]" required="1"/>

i am getting invalid architecture problem how to solve the issue

3
Vasiliy Birukov
On 3/10/14, 8:08 AM

Unfortunately widget="selection" don't support dinamic domain.

If you need widget selection then remove from domain non static value like partner_id:

<field name="contract_id" widget="selection" domain="[('state','=','draft')]" required="1"/>

If you need domain with dinamic value you have to remove widget="selection":

<field name="contract_id" domain="[('partner_id','=',partner_id),('state','=','draft')]" required="1"/>
0
faizan
On 9/23/13, 9:43 AM

u dont have to use widget="selection" just romove it and in py file u have to declare yr colum as 'contract_id': fields.selection()

how to use many2one to fields.selection ?

Maniganda
on 9/24/13, 10:53 AM

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

0 follower(s)

Stats

Asked: 9/23/13, 5:05 AM
Seen: 8875 times
Last updated: 3/16/15, 8:10 AM