Domain restriction doesn't work with selection widget

Bug #489308 reported by R. Messier

This bug report was converted into a question: question #135048: Domain restriction doesn't work with selection widget.

40
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Invalid
Wishlist
OpenERP sa GTK client R&D

Bug Description

As of v5.0.6 on Ubuntu 8.10

When defining a selection widget with values from a table, domain restrictions doesn't work.

summary: - 'invisible' field attribute doesn't work in GTK client
+ Domain restrictions doesn't work with selection widget
description: updated
summary: - Domain restrictions doesn't work with selection widget
+ Domain restriction doesn't work with selection widget
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Would you please provide us information what do you do exactly?

Does Selection widget have any method ?
Or
Its manyone with widget="selection" ?

Thank you.

Changed in openobject-client:
status: New → Incomplete
Revision history for this message
R. Messier (raphaelmessier) wrote : Re: [Bug 489308] Re: Domain restriction doesn't work with selection widget

Hi Jay,

I use a many2one field with a 'widget="selection" attribute in the XML view
definition. Then any domain restriction won't be applied in neither of the two
following cases:

CASE 1

PY model definition:
'country_id': field.many2one('res.country', 'Country'),
'state_id': field.many2one('res.country.state', 'State',
domain="[('country_id','=',country_id)]"),

XML view definition:
<field name="country_id" widget="selection" />
<field name="state_id" widget="selection" />

CASE 2

PY model definition:
'country_id': field.many2one('res.country', 'Country'),
'state_id': field.many2one('res.country.state', 'State'),

XML view definition:
<field name="country_id" widget="selection" />
<field name="state_id" widget="selection"
domain="[('country_id','=',country_id)]" />

In both cases, everything works fine if I remove 'widget="selection"' from
<field name="state_id" .../> (but it doesn't have the final look that I want).

Tell me if you need more information.

Regards,
Raphaël

Quoting "Jay \\(Open ERP\\)" <email address hidden>:

> Would you please provide us information what do you do exactly?
>
> Does Selection widget have any method ?
> Or
> Its manyone with widget="selection" ?
>
> Thank you.
>
> ** Changed in: openobject-client
> Status: New => Incomplete
>
> --
> Domain restriction doesn't work with selection widget
> https://bugs.launchpad.net/bugs/489308
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in OpenObject Application Client - GTK: Incomplete
>
> Bug description:
> As of v5.0.6 on Ubuntu 8.10
>
> When defining a selection widget with values from a table, domain
> restrictions doesn't work.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/openobject-client/+bug/489308/+subscribe
>

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : Re: [Bug 489308] Re: Domain restriction doesn't work with selection widget

Hello I confirm this bug, that's annoying because we had to use one2many
widget at several places where the select widget would have make much more
sense.
Nothing like an urgent regression, however, would be very nice to be able to
use the widget selection more often...

On Thu, Dec 10, 2009 at 4:17 PM, R. Messier <email address hidden> wrote:

> Hi Jay,
>
> I use a many2one field with a 'widget="selection" attribute in the XML view
> definition. Then any domain restriction won't be applied in neither of the
> two
> following cases:
>
> CASE 1
>
> PY model definition:
> 'country_id': field.many2one('res.country', 'Country'),
> 'state_id': field.many2one('res.country.state', 'State',
> domain="[('country_id','=',country_id)]"),
>
> XML view definition:
> <field name="country_id" widget="selection" />
> <field name="state_id" widget="selection" />
>
>
> CASE 2
>
> PY model definition:
> 'country_id': field.many2one('res.country', 'Country'),
> 'state_id': field.many2one('res.country.state', 'State'),
>
> XML view definition:
> <field name="country_id" widget="selection" />
> <field name="state_id" widget="selection"
> domain="[('country_id','=',country_id)]" />
>
> In both cases, everything works fine if I remove 'widget="selection"' from
> <field name="state_id" .../> (but it doesn't have the final look that I
> want).
>
> Tell me if you need more information.
>
> Regards,
> Raphaël
>
>
> Quoting "Jay \\(Open ERP\\)" <email address hidden>:
>
> > Would you please provide us information what do you do exactly?
> >
> > Does Selection widget have any method ?
> > Or
> > Its manyone with widget="selection" ?
> >
> > Thank you.
> >
> > ** Changed in: openobject-client
> > Status: New => Incomplete
> >
> > --
> > Domain restriction doesn't work with selection widget
> > https://bugs.launchpad.net/bugs/489308
> > You received this bug notification because you are a direct subscriber
> > of the bug.
> >
> > Status in OpenObject Application Client - GTK: Incomplete
> >
> > Bug description:
> > As of v5.0.6 on Ubuntu 8.10
> >
> > When defining a selection widget with values from a table, domain
> > restrictions doesn't work.
> >
> > To unsubscribe from this bug, go to:
> > https://bugs.launchpad.net/openobject-client/+bug/489308/+subscribe
> >
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> --
> Domain restriction doesn't work with selection widget
> https://bugs.launchpad.net/bugs/489308
> You received this bug notification because you are a member of OpenERP
> Drivers, which is subscribed to OpenObject Application Client.
>
> Status in OpenObject Application Client - GTK: Incomplete
>
> Bug description:
> As of v5.0.6 on Ubuntu 8.10
>
> When defining a selection widget with values from a table, domain
> restrictions doesn't work.
>
>
>

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Raphaël [Addressing both of you :)],

Its a problem of widget="selection" for many2one. I confirm the issue. That's why I asked whether field is selection or M2O.

Thank you.

Changed in openobject-client:
status: Incomplete → Confirmed
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

By the way, when I said "we had to use one2many widgets" I actually meant "we
had to use many2one widgets" of course, sorry for the confusion.

On Thu, Dec 17, 2009 at 5:17 AM, Jay (Open ERP) <email address hidden> wrote:

> Hello Raphaël [Addressing both of you :)],
>
> Its a problem of widget="selection" for many2one. I confirm the issue.
> That's why I asked whether field is selection or M2O.
>
> Thank you.
>
> ** Changed in: openobject-client
> Status: Incomplete => Confirmed
>
> --
> Domain restriction doesn't work with selection widget
> https://bugs.launchpad.net/bugs/489308
> You received this bug notification because you are a member of OpenERP
> Drivers, which is subscribed to OpenObject Application Client.
>
> Status in OpenObject Application Client - GTK: Confirmed
>
> Bug description:
> As of v5.0.6 on Ubuntu 8.10
>
> When defining a selection widget with values from a table, domain
> restrictions doesn't work.
>
>
>

Changed in openobject-client:
assignee: nobody → RGA(Open ERP) (rga-openerp)
Changed in openobject-client:
milestone: none → 6.0
Changed in openobject-client:
milestone: 6.0 → none
importance: Undecided → Wishlist
assignee: RGA(OpenERP) (rga-openerp) → OpenERP sa GTK client R&D (openerp-dev-gtk)
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hello Raphaël,

This is not a bug (but probably a undocumented feature), so I will convert it to a question, if Launchpad allows me... and then provide the answer to the question :-)

Changed in openobject-client:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.