It is currently Mon May 21, 2012 6:34 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Optional hiding of form sidebar button
PostPosted: Mon May 16, 2011 10:48 am 
Offline

Joined: Mon Oct 04, 2010 12:06 pm
Posts: 17
Hi all,
I am trying to show custom report visible only on cash statement.
Other views using 'account.bank.statement' should not allow access to this button.
I have defined both report and sidebar button action in xml. Here is button action definition:

Code:
<record id="test_cash_statement_report_value_id" model="ir.values">
   <field name="name">test_account_cash_statement_report</field>
   <field name="key2">client_print_multi</field>
   <field eval="1" name="object"/>
   <field name="value" val="'ir.actions.report.xml,'+str(test_cash_statement_report_id)"/>
   <field name="key">action</field>
   <field name="model">account.bank.statement</field>
</record>

So, does anyone know what should I do to make this button show only on cash statement form?
I was thinking about something like
Code:
<field name="attrs">"{'invisible':[('journal_id.type','!=','cash')]}"</field>

but couldn't find any reference...


Top
 Profile  
 
 Post subject: Re: Optional hiding of form sidebar button
PostPosted: Fri May 20, 2011 2:21 pm 
Offline

Joined: Sat Feb 05, 2011 9:05 pm
Posts: 28
You can add button that calls report to your form view and just restrict it's visibility as usual


Top
 Profile  
 
 Post subject: Re: Optional hiding of form sidebar button
PostPosted: Fri May 20, 2011 3:31 pm 
Offline

Joined: Mon Oct 04, 2010 12:06 pm
Posts: 17
Thanks for your reply tool,
I was aware of that possibility, I just really, really wanted to use the sidebar :D.
By now I have 2 reports for cash statement, therefore - 2 buttons on the form.
Any more reports means adding as many buttons.
Anyway, having possibility to change attributes like visibility on sidebar based on condition would be very welcome, especially because you could set different sidebar buttons based on e.g. selected journal for that record, selected type of partner, etc.
Unfortunatelly, I will for now have to put this on form, as you suggested :(


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP