Odoo Help

0

Visibility of report in Accounting ->Cash and Bank->Cash Registers

By
Viorica Ibasfalean
on 3/12/13, 6:26 AM 1,968 views

A Cash register is opened, on line of a Cash Transactions I have a button that I need to hide for some companies (We use the version 6.1).

The button is on the object "account.bank.statement.line", if I use the next code , the button is hidden for a Cash transaction with field "Communication"=2.

<openerp> <data> <record id="view_cash_statement_tree_voucher" model="ir.ui.view"> <field name="name">account.cash.statement.voucher.tree.inherit</field> <field name="model">account.bank.statement</field> <field name="type">form</field> <field name="inherit_id" ref="account.view_bank_statement_form2"/> <field name="arch" type="xml"> <xpath expr="/form/notebook/page/field[@name='line_ids']/tree/field[@name='date']" position="before"> <button name="action_report" string="Report" type="object" icon="gtk-execute" attrs="{'invisible':[('name','=','2')]}"/> </xpath> </field> </record>

</data> </openerp>

If I use something like this attrs="{'invisible':[('company_id','=','5')]}", I have an error that tells me that the object "account.bank.statement.line"field has no field "company_id" . So, how can I use for this case a field which is not member the object "account.bank.statement.line" ? I need to use the field "company_id" from the object "account.bank.statement".

Thank you very, very much for your answers!!!

0
Viorica Ibasfalean
On 3/26/13, 6:54 AM

Thanks you very much Mustufa! I will try.

Unfortunately, I tried but is not working. May be with a new field.

Viorica Ibasfalean
on 3/27/13, 8:05 AM
0

You can try attrs="{'invisible':[('parent.company_id','=','5')]}" option but I think its not working, so you have to create one related field on bank statement lines which will inherit from bank statement.

Regards, Mustufa Rangwala

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 3/12/13, 6:26 AM
Seen: 1968 times
Last updated: 3/16/15, 8:10 AM