attrs={'invisible'} on field tags does not work

Bug #531814 reported by amined_soul
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Status tracked in Trunk
5.0
Invalid
Wishlist
Husen Daudi
Trunk
Fix Released
Wishlist
OpenERP sa GTK client R&D

Bug Description

Hi,
Theres is a bug in the OpenObject Gtk-Client.
<field name="prenom" attrs="{'invisible': [('nom', '=', 'amine') ] }" /> work only in the WebClient, it works on GTK-client only wrapped in a group tag. Also, Invisible attribute don't work on treeview.

See : http://www.openerp.com/forum/topic15461.html?sid=5b67141aeea71efe3c702f6d84e17cd7 for more informations.

Changed in openobject-client:
status: New → Confirmed
amined_soul (amine)
description: updated
summary: - invisible
+ attrs={'invisible'} on field tags does not work
Revision history for this message
Almanar (moudarir-yahoo) wrote :

invisible attribute doesn't work especialy in Tree View in the GTK Client

Revision history for this message
Parthiv Patel (parthiv-patel-deactivatedaccount) wrote : Re: [Bug 531814] Re: attrs={'invisible'} on field tags does not work

Hi,

You can use Invisible tag with group tag...

somethig like this :

< group attrs="{'invisible': [('nom', '=', 'amine') ] }" >
<field name="prenom">
</group>

Regards,
Parthiv

On Sat, Mar 20, 2010 at 8:21 PM, Almanar <email address hidden> wrote:

> invisible attribute doesn't work especialy in Tree View in the GTK
> Client
>
> --
> attrs={'invisible'} on field tags does not work
> https://bugs.launchpad.net/bugs/531814
> You received this bug notification because you are subscribed to
> OpenObject GTK Client.
>
> Status in OpenObject GTK Client: Confirmed
> Status in OpenObject GTK Client 5.0 series: Confirmed
> Status in OpenObject GTK Client trunk series: Confirmed
>
> Bug description:
> Hi,
> Theres is a bug in the OpenObject Gtk-Client.
> <field name="prenom" attrs="{'invisible': [('nom', '=', 'amine') ] }" />
> work only in the WebClient, it works on GTK-client only wrapped in a group
> tag. Also, Invisible attribute don't work on treeview.
>
> See :
> http://www.openerp.com/forum/topic15461.html?sid=5b67141aeea71efe3c702f6d84e17cd7for more informations.
>
>
>
>
>

--
Thanks & Regards,
Parthiv Patel

Revision history for this message
Almanar (moudarir-yahoo) wrote :

Thank you for information
Yes it work in Form View
But in TREE View, it doesnt' work
That's what we want
And group tag does't mean anything in Tree View !!!

--- On Sat, 3/20/10, ppr (axelor) <email address hidden> wrote:

> From: ppr (axelor) <email address hidden>
> Subject: Re: [Bug 531814] Re: attrs={'invisible'} on field tags does not work
> To: <email address hidden>
> Date: Saturday, March 20, 2010, 3:27 PM
> Hi,
>
> You can use Invisible tag with group tag...
>
> somethig like this :
>
> < group attrs="{'invisible': [('nom', '=', 'amine') ] }"
> >
> <field name="prenom">
> </group>
>
> Regards,
> Parthiv
>
> On Sat, Mar 20, 2010 at 8:21 PM, Almanar <email address hidden>
> wrote:
>
> > invisible attribute doesn't work especialy in Tree
> View in the GTK
> > Client
> >
> > --
> > attrs={'invisible'} on field tags does not work
> > https://bugs.launchpad.net/bugs/531814
> > You received this bug notification because you are
> subscribed to
> > OpenObject GTK Client.
> >
> > Status in OpenObject GTK Client: Confirmed
> > Status in OpenObject GTK Client 5.0 series: Confirmed
> > Status in OpenObject GTK Client trunk series:
> Confirmed
> >
> > Bug description:
> > Hi,
> > Theres is a bug in the OpenObject Gtk-Client.
> > <field name="prenom" attrs="{'invisible': [('nom',
> '=', 'amine') ] }" />
> > work only in the WebClient, it works on GTK-client
> only wrapped in a group
> > tag. Also, Invisible attribute don't work on
> treeview.
> >
> > See :
> > http://www.openerp.com/forum/topic15461.html?sid=5b67141aeea71efe3c702f6d84e17cd7for
> more informations.
> >
> >
> >
> >
> >
>
>
> --
> Thanks & Regards,
> Parthiv Patel
>
> --
> attrs={'invisible'} on field tags does not work
> https://bugs.launchpad.net/bugs/531814
> You received this bug notification because you are a direct
> subscriber
> of the bug.
>
> Status in OpenObject GTK Client: Confirmed
> Status in OpenObject GTK Client 5.0 series: Confirmed
> Status in OpenObject GTK Client trunk series: Confirmed
>
> Bug description:
> Hi,
> Theres is a bug in the OpenObject Gtk-Client.
> <field name="prenom" attrs="{'invisible': [('nom', '=',
> 'amine') ] }" /> work only in the WebClient, it works on
> GTK-client only wrapped in a group tag. Also, Invisible
> attribute don't work on treeview.
>
> See : http://www.openerp.com/forum/topic15461.html?sid=5b67141aeea71efe3c702f6d84e17cd7
> for more informations.
>
>
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/openobject-client/+bug/531814/+subscribe
>

Revision history for this message
amined_soul (amine) wrote :

> You can use Invisible tag with group tag...
>
>
somethig like this :
>
> < group attrs="{'invisible':
[('nom', '=', 'amine') ] }" >
> <field name="prenom">
>
 </group>
that's exactly what we said:

> > <field name="prenom" attrs="{'invisible': [('nom', '=',
'amine') ] }" />
> > work only in the WebClient, it works on
 GTK-client only wrapped in a group
> > tag. Also, Invisible
attribute don't work on treeview.

> Date: Sat, 20 Mar 2010 15:27:53 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: Re: [Bug 531814] Re: attrs={'invisible'} on field tags does not work
>
> Hi,
>
> You can use Invisible tag with group tag...
>
> somethig like this :
>
> < group attrs="{'invisible': [('nom', '=', 'amine') ] }" >
> <field name="prenom">
> </group>
>
> Regards,
> Parthiv
>
> On Sat, Mar 20, 2010 at 8:21 PM, Almanar <email address hidden> wrote:
>
> > invisible attribute doesn't work especialy in Tree View in the GTK
> > Client
> >
> > --
> > attrs={'invisible'} on field tags does not work
> > https://bugs.launchpad.net/bugs/531814
> > You received this bug notification because you are subscribed to
> > OpenObject GTK Client.
> >
> > Status in OpenObject GTK Client: Confirmed
> > Status in OpenObject GTK Client 5.0 series: Confirmed
> > Status in OpenObject GTK Client trunk series: Confirmed
> >
> > Bug description:
> > Hi,
> > Theres is a bug in the OpenObject Gtk-Client.
> > <field name="prenom" attrs="{'invisible': [('nom', '=', 'amine') ] }" />
> > work only in the WebClient, it works on GTK-client only wrapped in a group
> > tag. Also, Invisible attribute don't work on treeview.
> >
> > See :
> > http://www.openerp.com/forum/topic15461.html?sid=5b67141aeea71efe3c702f6d84e17cd7for more informations.
> >
> >
> >
> >
> >
>
>
> --
> Thanks & Regards,
> Parthiv Patel
>
> --
> attrs={'invisible'} on field tags does not work
> https://bugs.launchpad.net/bugs/531814
> You received this bug notification because you are a direct subscriber
> of the bug.

_________________________________________________________________
Hotmail : une messagerie performante et gratuite avec une sécurité signée Microsoft
https://signup.live.com/signup.aspx?id=60969

Revision history for this message
Parthiv Patel (parthiv-patel-deactivatedaccount) wrote :

Can any one try this :

<?xml version="1.0"?>
<tree string="Partners">
<group attrs="{'invisible': [('id','>',0)]}" >
                    <field name="name"/>
</group>
                    <field name="title"/>
                    <field name="ref"/>
                    <field name="city" select="2"/>
                    <field name="country" select="2"/>
                    <field name="lang"/>
                </tree>

it seems to be working on my side.. ATTRS on tree view...

but seems like attrs evolution is buggy with Tree view...can any one confirm ??

Revision history for this message
amined_soul (amine) wrote :

Hi,
In Gtk-client, the "group" tag in form view is perfectly working.

 in tree view, consider that xml:

 <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="students">
                <field name="student_name" select="1" string="nom etudiant tree"/>
                <field name="student_surname" select="2" string="prenom etudiant tree" />
                <field name="room_id" string="classe tree" />
                <field name="name" select="2" string="name student tree"/>
    <group string="group strudent tree" >
                <field name="field to hide" string="field to hide in tree view" />
                </group>
            </tree>
</field>

Note that de "group" tag is free from invisible attribute, but is always invisible in tree view: so, the "group" tag in not compatible with tree view!

Using attrs="{'invisible': [('id','>',0)]}" is useless in tree view, since it will be always invisible :-)

Regards, Amine.

> Date: Tue, 23 Mar 2010 06:29:37 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 531814] Re: attrs={'invisible'} on field tags does not work
>
> Can any one try this :
>
> <?xml version="1.0"?>
> <tree string="Partners">
> <group attrs="{'invisible': [('id','>',0)]}" >
> <field name="name"/>
> </group>
> <field name="title"/>
> <field name="ref"/>
> <field name="city" select="2"/>
> <field name="country" select="2"/>
> <field name="lang"/>
> </tree>
>
>
> it seems to be working on my side.. ATTRS on tree view...
>
> but seems like attrs evolution is buggy with Tree view...can any one
> confirm ??
>
> --
> attrs={'invisible'} on field tags does not work
> https://bugs.launchpad.net/bugs/531814
> You received this bug notification because you are a direct subscriber
> of the bug.

_________________________________________________________________
Hotmail : un service de messagerie gratuit, fiable et complet
https://signup.live.com/signup.aspx?id=60969

Revision history for this message
Almanar (moudarir-yahoo) wrote :
Download full text (3.6 KiB)

Hello,
Yes I have the same result
<group> have no sens in Tree View

And when we use it the <field> is always invisible whenever we use attrs !!!

--- On Tue, 3/23/10, amined_soul <email address hidden> wrote:

> From: amined_soul <email address hidden>
> Subject: RE: [Bug 531814] Re: attrs={'invisible'} on field tags does not work
> To: <email address hidden>
> Date: Tuesday, March 23, 2010, 1:41 PM
>
> Hi,
> In Gtk-client, the "group" tag in form view is perfectly
> working.
>
> in tree view, consider that xml:
>
> <field name="type">tree</field>
>         <field name="arch"
> type="xml">
>             <tree
> string="students">
>
> <field name="student_name" select="1" string="nom
> etudiant tree"/>
>
> <field name="student_surname" select="2" string="prenom
> etudiant tree" />
>
> <field name="room_id" string="classe  tree" />
>
> <field name="name" select="2" string="name student
> tree"/>
>     <group  string="group strudent tree"
> >
>
> <field name="field to hide" string="field to hide in tree
> view" />
>
> </group>
>             </tree>
> </field>
>
> Note that de "group" tag is free from invisible attribute,
> but is always
> invisible in tree view: so, the "group" tag in not
> compatible with tree
> view!
>
> Using  attrs="{'invisible': [('id','>',0)]}" is
> useless in tree view,
> since it will be always invisible :-)
>
> Regards, Amine.
>
> > Date: Tue, 23 Mar 2010 06:29:37 +0000
> > From: <email address hidden>
> > To: <email address hidden>
> > Subject: [Bug 531814] Re: attrs={'invisible'} on field
> tags does not work
> >
> > Can any one try this :
> >
> > <?xml version="1.0"?>
> > <tree string="Partners">
> > <group attrs="{'invisible': [('id','>',0)]}"
> >
> >
>      <field name="name"/>
> > </group>
> >
>      <field name="title"/>
> >
>      <field name="ref"/>
> >
>      <field name="city"
> select="2"/>
> >
>      <field name="country"
> select="2"/>
> >
>      <field name="lang"/>
> >
>    </tree>
> >
> >
> > it seems to be working on my side.. ATTRS on tree
> view...
> >
> > but seems like attrs evolution is buggy with Tree
> view...can any one
> > confirm ??
> >
> > --
> > attrs={'invisible'} on field tags does not work
> > https://bugs.launchpad.net/bugs/531814
> > You received this bug notification because you are a
> direct subscriber
> > of the bug.
>
>
>
>
> _________________________________________________________________
> Hotmail : un service de messagerie gratuit, fiable et
> complet
> https://signup.live.com/signup.aspx?id=60969
>
> --
> attrs={'invisible'} on field tags does not work
> https://bugs.launchpad.net/bugs/531814
> You received this bug notification because you are a direct
> subscriber
> of the bug.
>
> Status in OpenObject GTK Client: Confirmed
> Status in OpenObject GTK Client 5.0 series: Confirmed
> Status in OpenObject GTK Client trunk series: Confirmed
>
> Bug description:
> Hi,
> Theres is a bug in the OpenObject Gtk-Client.
> <field name="prenom...

Read more...

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

It will be committed on trunk soon.
For 5.0 , it can't be fixed.
Thanks.

Revision history for this message
amined_soul (amine) wrote :

Hi,

Thanks a lot!

Regards, Amine.

> Date: Thu, 25 Mar 2010 12:04:38 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 531814] Re: attrs={'invisible'} on field tags does not work
>
> It will be committed on trunk soon.
> For 5.0 , it can't be fixed.
> Thanks.
>
> ** Changed in: openobject-client/5.0
> Status: Confirmed => Won't Fix
>
> --
> attrs={'invisible'} on field tags does not work
> https://bugs.launchpad.net/bugs/531814
> You received this bug notification because you are a direct subscriber
> of the bug.

_________________________________________________________________
Hotmail : un service de messagerie gratuit, fiable et complet
https://signup.live.com/signup.aspx?id=60969

Revision history for this message
Almanar (moudarir-yahoo) wrote :

Hello,
why you can not fix this bug !
is there any technical problem related to GTK or openerp architecture ?
Or is there any other solution to shortcut(court-circuiter) this issue ?
Thank you.

Revision history for this message
Numérigraphe (numerigraphe) wrote :

The rule for stable releases is to not add new features or implement wishlist items - so I'll mark this "invalid" for 5.0 (but "won't fix" would be better).
Hopefully it will be fixed in the next version. You can always port the fix back from the trunk to your own systems if you need.

Revision history for this message
amined_soul (amine) wrote :

Hi,

Yes, we can patch our own openerp clients/servers to have that feature. Is the bug fixed in the trunk? where?

Tanks a lot

> Date: Tue, 6 Apr 2010 17:20:46 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 531814] Re: attrs={'invisible'} on field tags does not work
>
> Hello,
> why you can not fix this bug !
> is there any technical problem related to GTK or openerp architecture ?
> Or is there any other solution to shortcut(court-circuiter) this issue ?
> Thank you.
>
> --
> attrs={'invisible'} on field tags does not work
> https://bugs.launchpad.net/bugs/531814
> You received this bug notification because you are a direct subscriber
> of the bug.

_________________________________________________________________
Votre messagerie et bien plus où que vous soyez. Passez à Windows Live Hotmail, c'est gratuit !
https://signup.live.com/signup.aspx?id=60969

Revision history for this message
beroz (abeer) wrote :

How could I get that fix? I need to hide a column in the tree view? any news?

Revision history for this message
amined_soul (amine) wrote :

Hi,
i'm using fields_view_get() and fields_get() to generate custom views to remedy (a little) to that bug, still not perfect. Hope that bug fixed, many people are waiting.

Regards.

Revision history for this message
Richard (John) Nopkins@Servosoft (richard-nopkins) wrote :

I guess it is done on trunk.
anyone confirms?

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello All,

For the case in form view with attrs invisible:

It does work when applied on field / group tag. in gtk trunk client.

Now for the case of tree view:
Suppose we have attrs on sale order tree on name(or any other field) as attrs={'invisible':[('state','=','manual')]}.
Say there are 10 sale orders out of which 2 SO has state "manual" SO the condition is true for those 2 SO's but what about others?
So We do not support attrs on treeview where multiple records exists.

Workaround for 'invisible' on field in treeview:

use context to achieve this but note it will be applied for all records.
For example reference project_gtd module.

Correct me If I am wrong or put your views too.
Thanks

Revision history for this message
Almanar (moudarir-yahoo) wrote :

I don't agree
the need for this to work in tree view is only to HIDE some fields.
those field which satisfy some conditions.
nch : you don't understand till now the philosophie of this function.
We don't take care about the VALUE of the fields, but we have interested about NAME of fields .
ok ?

Take an exemple :
A class or relation with those field {name, age, function, address, compagny}
I would like to generat a XML on the fly (dynamiquely) to view the records (obejct) of this relation or class, so withing script python code, I can say IF the NAME of field for the new generated XML is in {age, compagny} SO we HIDE those fields.

Finaly, I get an XML tree or form with only {name, function, address}

So I can have many records in this tree because : I DON'T CARE ABOUT THE VALUE OF FIELDS

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello almanar,

Yes, I understood what you are aiming at.

Suppose the thing what you want is available in OpenERP.
could you provide an openerp treeview that you will define to achieve this ?

for dynamic view did you check project_gtd ?

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

hello almanar,

and yes attrs={invisible / required / readonly: [domains] }.where doamins is a list of tuples which has ('field','operator', 'value')

So what I understand is if the domain is satisfied the key which is present for attrs dict will be evaluted.
and for the domain it will be evaluated as field should match the value with the given operator.

Am I wrong here ?

Revision history for this message
Richard (John) Nopkins@Servosoft (richard-nopkins) wrote :

is this feature available in trunk?

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

This is supported in trunk now, but those attrs values have never been meant to depend on the presence of other columns.
If you want to hide or show columns based on the presence of other columns you should do so when you are creating the definition of the view, and simply put only the columns you need!
You could even use <field name="XXX" invisible="1"/> if you want to include it in the view but hide it.

The attrs attribute is meant only for dynamic behavior according to dynamic values, like hiding a button depending on the state of the record, etc.

Thanks,

Revision history for this message
Sengottuvel(India) (sengottuvl) wrote :

Hi Team,

I want to invisible a field from form view based on some field type. Is it possible invisible and required in a single attrs function ?

Eg: <field name = "expiry_date" attrs="{'invisible': [('expiry_flag','=',False)]}"/> . If the expiry_flag = True the field will be visible, this is working. But while visible the field i want to set required = True.

How can i achieve this ?.. Kindly help me..Thanks in advance

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.