This question has been flagged
2 Replies
2965 Views

In account/partner_view.xml is looks like this:

<button type="action" class="oe_stat_button" name="%(account.action_account_moves_all_tree)d" groups="account.group_account_user" icon="fa-list">
  <field string="Journal Items" name="journal_item_count" widget="statinfo"/>                        
</button>

If I try to hide the button via:

<button name="%(account.action_account_moves_all_tree)d" invisible="1"></button>

It complains it cannot be located however I can hide the inside field via:

<field name="journal_item_count" position="attributes">
  <attribute name="attrs">{'invisible':1}</attribute>
</field>

How can I hide the whole button?

Avatar
Discard
Best Answer

Use Xpath and set the position as "replace"... that way also you can hide it too..

Avatar
Discard
Author Best Answer

I resorted to walking up the tree after failing to target the button with xpath and ended up with:

<xpath expr="//*[@name='journal_item_count']/.." position="attributes">
  <attribute name="attrs">{'invisible':1}</attribute>
</xpath>

Still not ideal.

Avatar
Discard