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.

1

XML : Widget = "selection" not working on many2one field openerpv7

By
Yassine TEIMI
on 12/12/14, 9:32 AM 1,490 views

I have a many2one field : 'Numeros_bl': fields.many2one('stock.picking', 'Numeros Bls', readonly=True),

On xml I made : 

<field name="Numeros_bl" widget="selection" domain="[('state','=','done'),('invoice_state','=','2binvoiced'),('partner_id','=',partner_id)]"/>

Invalid XML architecture as error. Nothing else in the traceback.

Why it's not accepting the widget ?

 

5

Dhinesh - Technical Consultant, Sodexis Inc

--Dhinesh - Technical Consultant, Sodexis Inc--
3577
| 5 4 9
Pondicherry, India
--Dhinesh - Technical Consultant, Sodexis Inc--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks. Did code in Java, PHP.

Contact me at: dvdhinesh.mail@gmail.com

Dhinesh - Technical Consultant, Sodexis Inc
On 12/18/14, 12:59 PM

Hi,
widget="selection" doesn't support dynamic domains. If you need dynamic domain you have to remove the widget.
But the static domain like <field name="Numeros_bl" widget="selection" domain="[('state','=','done')]"/> will work.
Selection widgets are pre-filtered server-side, and are not meant for dynamic domains, so this will not work and is not a bug.
This is a limitation of all OpenERP version so far (including 6.0), due to semantics of the fields.selection column type.

0
Devang Pipaliya
On 12/18/14, 7:30 AM

@Yassine Can you Show full error stack here please.

0
Juan Carlos
On 12/18/14, 10:13 AM

The field Many2one already is a selection box, delete " widget="selection" " and this is all.

@Juan many2one widget and selection widget serves different purpose. Selection widget is used if you want user to just select from the list, without capability to search more or even create/edit. Many2one provides those capabilities.

Ivan
on 12/18/14, 12:14 PM

Oh!, thanks for the clarification, I didn't know this.

Juan Carlos
on 12/18/14, 12:55 PM
0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 12/18/14, 10:05 AM

Selection widget cannot accept domain.

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

2 follower(s)

Stats

Asked: 12/12/14, 9:32 AM
Seen: 1490 times
Last updated: 7/30/15, 5:12 AM