Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
4666 Näkymät

how can I hide the create button from the account.invoice_tree view, when I call the view from the accounting dashboard option, and show it when I call the view from the invoices menu option. Please I will appreciate your help and more detail. Thank you.

Avatar
Hylkää
Paras vastaus

Hi,

You can pass create = False inside the context.

See the sample,


context = dict(self.env.context or {})
context.update(create=False)
views = [
(tree_view_id, 'tree'),
(form_view_id, 'form'),
(graph_view_id, 'graph')
]
return {
'name': _('Product Margins'),
'context': context,
'view_type': 'form',
"view_mode": 'tree,form,graph',
'res_model': 'product.product',
'type': 'ir.actions.act_window',
'views': views,
'view_id': False,
'search_view_id': search_view_id,
}

Thanks

Avatar
Hylkää
Paras vastaus

Hello Niyas sir,

Your code very help full me.

1+

Thank you

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
elok. 25
2810
1
heinäk. 25
1135
1
elok. 25
1152
0
toukok. 25
1550
2
huhtik. 25
3751