Can't use attrs{invisible} and states on the same button

Bug #941901 reported by Numérigraphe
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Confirmed
Low
OpenERP sa GTK client R&D
Odoo Server (MOVED TO GITHUB)
Invalid
Medium
OpenERP's Framework R&D

Bug Description

In the current trunk, states are ignored when you define a button like this :
                                    <button name="action_xyz" string="Button"
                                        type="object" icon="gtk-media-play"
                                        attrs="{'invisible': [('field_xyz', '=', 'blah')]}"
                                        states="assigned"/>
When state is not 'assigned', the button should be hidden but it remains visible and active.
This bug affects:
* form views in gtk client (not tree views)
* tree views and form views in new web client
Lionel Sausin.

description: updated
summary: - Can't use attrs{invisible} and states on the same button in form view
+ Can't use attrs{invisible} and states on the same button
description: updated
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Numérigraphe,

I have checked this issue with GTK as well as web in trunk.
Gtk is working fine when attrs , state both are given.
but problem persist with only new web client.So currently
I close this issue for Gtk client,For new web I am confirming this
issue.

I have attached a video for your more reference.

Thank you!

Changed in openobject-client:
status: New → Invalid
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
Numérigraphe (numerigraphe) wrote :

Dear Jignesh Rathod,
Thanks for checking this issue.
I would like you to do one more check please on the GTK client: in your video you don't change the state of the Order. If you do, you should notice that the button remains visible even in the wrong states.
Would you please confirm this again?
I'm marking 'new' again in the meantime.
Lionel.

Changed in openobject-client:
status: Invalid → New
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Numérigraphe ,

Thanks for your reply.
I have checked again as per your comment #3 and I have face the
problem button still remains visible even in the wrong states.

Thank you!

Changed in openobject-client:
assignee: nobody → OpenERP sa GTK client R&D (openerp-dev-gtk)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Fabien Meghazi (OpenERP) (fme) wrote :

The web client doesn't checks @attrs neither @states. Those are aggregated to @modifiers by the server.

affects: openerp-web → openobject-server
Changed in openobject-server:
assignee: OpenERP R&D Web Team (openerp-dev-web) → nobody
Amit Parik (amit-parik)
Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
Changed in openobject-server:
importance: Low → Medium
Revision history for this message
ajay javiya (OpenERP) (aja-openerp) wrote :

Hello Numérigraphe,

I have check this issue, an ORM is design to work like that because when you apply attrs="{'invisible': [('field_xyz', '=', 'blah')]}"
and states="assigned" , ORM convert them to Modifier like {'invisible':[['field_xyz','=', 'blah'],['state','not in' ,['assigned']]] , so your button only invisible if both condition are satisfied , if you wish to make button invisible if either of one condition is satisfied then you can use like attrs="{'invisible':['|',('field_xyz','=', 'blah'),('state','not in' ,['assigned'])] }".

So i close this issue.

Thank You.

Changed in openobject-server:
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

Remote bug watches

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