Default focus does not work in forms

Bug #944080 reported by jj-beol
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Web Team

Bug Description

1) Steps to reproduce the issue you have observed

- as a user with administration rights, go to Settings -> Customization -> User Interface -> Views
- select the sale.order.form view and modify it
- give the default focus to a field in the sale order view by changing the last line of the following:
====
                      <notebook colspan="5">
                        <page string="Sales Order">
                            <field name="partner_id" options="{&quot;quick_create&quot;: false}" on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" required="1"/>
====
and adding default_focus="1":
====
                            <field name="partner_id" options="{&quot;quick_create&quot;: false}" on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" required="1" default_focus="1"/>
====
- do the same for a field in the sale order line form by changing the last line of the following:
====
                                      <page string="Order Line">
                                        <group colspan="4" col="5">
                                            <field colspan="3" context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, context)"/>
====
and adding default-focus="1":
====
                                            <field colspan="3" context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, context)" default_focus="1"/>
====
- save the modifications
- create a sale order (Sales -> Sales -> Sales order -> Create) and notice that the default focus is given to the customer field
- create a sale order line and notice that there is no focus

2) The result you observed
No focus is given to the "product" field when creating a sale order line.

3) The result you expected
The initial focus should be given to that field, as specified in the XML description of the view.

4) The platform your are using
OpenERP Server: Linux
OpenERP Webclient: Used under Windows

5) The OpenERP version you are using
OpenERP 6.1

I did not try if this issue is the same for other forms, but I guess so.

Thanks in advance !

affects: openobject-addons → openerp-web
Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello,
I have also checked with change in xml file, After changing it the behavior of gtk is expected but not in web.

Thank.

Changed in openerp-web:
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Fabien Meghazi (OpenERP) (fme) wrote :

Fixed in Revision:
2252 revid:<email address hidden>

Changed in openerp-web:
status: Confirmed → Fix Released
Revision history for this message
jj-beol (jj-beol) wrote :

It works fine, thanks a lot !
Simon E.B. THIERRY
CTO, Hodoo SAS

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

Other bug subscribers

Remote bug watches

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