As Xavier explained, this is by design, and on_change triggers are meant
for editable views (form views or editable list/tree views), but have no
sense in other cases.

An on_change relies on the current value of some fields of a record, and
helps to validate them or provide suggestions for other fields. There is
no sense to do that on a search view, which never represents a record.

Depending on what you want to accomplish in the search view, you may be
able to use the `filter_domain` attribute that lets you filter on
multiple criterions based on the input in a single field, or the
`context` attribute that lets you alter the search context, and give
different search/read results based on it (look for examples of both in
existing addons).

I'm closing this bug now, to clearly show that this is by design and we
don't plan to change the scope of on_change triggers.

Thanks for your understanding.

** Changed in: openerp-web
   Importance: Wishlist => Undecided

** Changed in: openerp-web
       Status: Opinion => Won't Fix

** Changed in: openobject-client
   Importance: Wishlist => Undecided

** Changed in: openobject-client
       Status: Opinion => Won't Fix

** Changed in: openobject-client
     Assignee: OpenERP sa GTK client R&D (openerp-dev-gtk) => (unassigned)

** Changed in: openerp-web
     Assignee: OpenERP R&D Web Team (openerp-dev-web) => (unassigned)

-- 
You received this bug notification because you are a member of OpenERP
sa GTK client R&D, which is a bug assignee.
https://bugs.launchpad.net/bugs/892804

Title:
  on_change should be supported on search view fields

Status in OpenERP Web:
  Won't Fix
Status in OpenERP GTK Client:
  Won't Fix

Bug description:
  the code for the view:

           <record id="view_employee_filter" model="ir.ui.view">
              <field name="name">Employees</field>
              <field name="model">hr.employee</field>
              <field name="type">search</field>
              <field name="inherit_id" ref="hr.view_employee_filter"/>
              <field name="arch" type="xml">
              <field name="name" position="before">        
                 <field name="id_search" 
on_change="search_id_change(id_search)"/>
              </field>
              <field name="parent_id" position="after">
                   <button name="attendance_action_change" states="present" 
string="Sign Out" type="object" icon="gtk-go-forward" 
context="{'type':'sign_out'}" groups="base.group_hr_user"/>
                   <button name="attendance_action_change" states="absent" 
string="Sign In" type="object" icon="gtk-go-back" context="{'type':'sign_in'}" 
groups="base.group_hr_user"/>
                   <field name="state"/>
              </field>              
              </field>
           </record>

  and the code for the controller:

      def search_id_change(self, cr, uid, ids, idsearch, context=None):
          print idsearch
          result = {}
          return result
   

  the on_change is never called.

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/openerp-web/+bug/892804/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to