Domain does not works with widget= "selection"

Bug #778016 reported by Cristian Salamea
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Incomplete
Undecided
Unassigned

Bug Description

if widget= "selection" domain not working in openerp 6.0.2
example
<field name="caste_id" widget="selection"/>
    <field name="caste_sub_id" domain="[('caste','=',caste_id)]"/>

Is it possible give me a solution

Changed in openobject-client:
status: New → Confirmed
assignee: nobody → OpenERP sa GTK client R&D (openerp-dev-gtk)
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

Hello,

I think we should deprecate this request as the new many2one widgets becomes smart selection box in v6.1.
So we don't need anymore to do widget="selection" on many2one fields. planned for v6.1, should be finnished next week in trunk.

V61 is based on this http://jqueryui.com/demos/autocomplete/#combobox and add some features like quickcreate, full search, etc.

Changed in openobject-client:
importance: Undecided → Wishlist
Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Hello Fabien, looks great for web client i'll test the trunk in the time but i report it in Gtk Client IMHO is necessary too.

Regards,

Revision history for this message
KAKA1.2 (satheesh) wrote :

Thank you for your valuable information, We are waiting for the changes

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

I know about changes in 6.1 but in 6.0 this must be solved widget with selection value must works too.

Regards,

Revision history for this message
Thibaut DIRLIK (Logica) (thibaut-dirlik) wrote :

If GTK client is not going to be deprecated, I also think this should be implemented in GTK. I'm afraid that a lot of things will be available in 6.1 web and not in GTK :/

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Totally agree, it *must* be implemented in gtk client i did not test it yet to know if is already implemented.

Regards,

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Cristian, based on the example you give in the description, it seems you're trying to use the value of a selection widget (caste_id) as a dynamic value in the domain of another field that is *not* a selection widget (caste_sub_id).

First, keep in mind that dynamic domains are not supported on selection widgets because the values are static and determined when the view is loaded. So in your example, 'caste_sub_id' could not be a selection field.

Now, coming back to your example, everything seems to be working as expected, I've just tested this on trunk, 6.0.3 and 6.0.2 and it works everywhere with on a trivial case: the sale order form. I changed the Customer field to be a selection. It's very simple, just add widget="selection" to the partner_id field in the sale order form view.
It works as expected, when you click on the search icon next to any of the address fields you can only choose addresses from the selected partner. See the attached screenshot taken on 6.0.2 where you can see the domain being passed correctly in the XML-RPC request too.

If this is not the same bug as what you are describing, please give complete steps to reproduce, and please give a full example using one of the standard OpenERP addons if possible, as I did with the sale.order form. In the mean time, I'm setting this bug to Incomplete.

PS: Please do not confirm or assign your own bugs, otherwise you're bypassing the qualification process, and preventing our teams to provide more info to reproduce it. OpenERP Drivers may help to qualify others' bug reports, but should not abuse this privilege to confirm and assign their own bug reports.

Changed in openobject-client:
assignee: OpenERP sa GTK client R&D (openerp-dev-gtk) → nobody
importance: Wishlist → Undecided
status: Confirmed → Incomplete
Revision history for this message
Cristian Salamea (ovnicraft) wrote :

I will make a video for this, about process assign OpenERP Drivers must assign the bug to the correct team and team must decide importance (here there is an exception "my own bugs").

Regards,

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

A good example is in invoice:

You get fields:
partner_id
address_invoice_id

by default you get a domain in address_invoice_id: [('partner_id','=',partner_id)]

In view for address_invoice_id field add widget="selection" and look if you get in combo list only address for partner selected.

Regards,

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Cristian,

Yes, a video would be very helpful, and if possible please include the output of the server with log level set to 'debug_rpc_answer'.
As for your example, it's almost the same as the one I gave with sale.order. I've just tried with invoice on 6.0.2 and it works just the same, no problem.

Thanks!

PS: the bug management process is described in the doc[1] (Bug Processing>Bug Qualification section) with a nice picture ;-) Drivers must ensure there are clear steps to reproduce, assign importance, confirm, and assign team. And Drivers from the community should not do it for their own bugs, that would not be fair for others.

[1] http://doc.openerp.com/v6.0/contribute/11_bug_tracker.html#bug-processing

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Hello as you see i report this before, domain with widget selection does not works https://bugs.launchpad.net/openobject-server/+bug/695089

in my OPW tell me the same thing can't be fixed.

Regards,

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [Bug 778016] Re: Domain does not works with widget= "selection"

On 12/19/2011 12:11 AM, Cristian Salamea (Gnuthink) wrote:
> Hello as you see i report this before, domain with widget selection does
> not works https://bugs.launchpad.net/openobject-server/+bug/695089

Thanks for the reference to the previous bug report. As you confirm
yourself this is the same bug, let's mark this one as a duplicate.

> in my OPW tell me the same thing can't be fixed.

That's correct, it can't be fixed because it's not a bug. It's a problem
of understanding how to correctly use selection widgets with domains. I
have a added an explanation on the original bug 695089, including some
examples.
Please read it carefully to understand the limitations of selection
widgets and domains, and how to properly use them.

BTW I think you'll appreciate the new m2o fields in 6.1 web because
they'll give you the best of both worlds: they act as auto-completed
selection fields, and they allow both static and dynamic domains,
because everything is done client-side.
Using widget=selection for m2o fields should become a thing of the past :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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