Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
8636 Tampilan

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

Avatar
Buang
Jawaban Terbai

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

Avatar
Buang