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.
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
2
Replies
4170
Views
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
Hello Niyas sir,
Your code very help full me.
1+
Thank you
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Nov 24
|
273 | ||
|
1
Oct 24
|
335 | ||
|
4
Oct 24
|
327 | ||
Connect Odoo with unopim
Solved
|
|
2
Oct 24
|
363 | |
|
2
Dec 24
|
679 |