Odoo Help


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

Viorica Ibasfalean
on 3/12/13, 6:26 AM 2,076 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!!!

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

Mustufa Rangwala (mra)

--Mustufa Rangwala (mra)--
| 2 1 4
Ahmedabad, India
--Mustufa Rangwala (mra)--

- Around 7+ years of strong experience in Odoo (Formerly OpenERP) which is world's largest Open Source Business Applications driven by CEO Fabien Pinckaers. - Played key role in developing and maintaining various Odoo Product modules and integrating them on Open Source ERP Environment. - Experience on Scrum methodology for project management - Experience in Team Building - Quick Start Implementations. - Worked on almost all versions (4.0, 5.0, 6.0, 6.1, 7.0, SAAS, Trunk(8.0)...) of Odoo (Formerly OpenERP) . Specialities: Odoo Business Process And OpenERP Implementation. Odoo Application Support and Maintenance. Odoo Technical & Functional Training. Business Process Mapping & Gap Analysis (Functional and Technical Analysis)

Mustufa Rangwala (mra)
On 3/26/13, 6:49 AM

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.


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)


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