Odoo Help

Welcome!

This community 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.

0

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

By
Maniganda
on 9/23/13, 5:05 AM 7,107 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

--Vasiliy Birukov--
3446
| 6 6 8
Russian Federation
--Vasiliy Birukov--

Help develop and implement any project on base Odoo.

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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