Hi,
How can display a menu action button only in Invoices odoo13. It should not display in journal entries. Both are 'account.move' model, so now the action button is show in invoice and journals. How can i restrict it to not show in Journal entries.
Regards
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
7827
Views
Hi,
I think you can solve this by using fields_view_get
Use the following code by inheriting the model account.move
def fields_view_get(self, view_id=None, view_type='form', toolbar=False,
submenu=False):
res = super().fields_view_get(view_id=view_id, view_type=view_type,
toolbar=toolbar, submenu=submenu)
if toolbar:
for action in res['toolbar'].get('action'):
if action.get('xml_id'):
if action['xml_id'] == 'your xml of action' and self._context.get(
'default_type') == 'entry':
res['toolbar']['action'].remove(action)
return res
Regards
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up