How to apply an action available on the form view to the list view (multiple records) |
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
If you want to use an action available on the form view in the tree view for the selected records:
1) Go to the form view and check the name of the action you want to use (by leaving your mouse on the button in debug mode) - see attachment
2) Go to Configuration / Technical / Server Action and create a server action using this code
context = dict(env.context)
invoice = env['account.invoice']
for rec in invoice.browse(context.get('active_ids')):
rec.action_open_invoice()
Comments:
- "invoice" is a variable name you can change
- you can change the env you want to use (account_invoice = model name of invoices)
- change the action name and add "()" at the end
3) Create a contextual action for your server action (green button on the server action)
//!!\\ In V10 you should replace rec by object:
context = dict(env.context)
invoice = env['account.invoice']
for object in invoice.browse(context.get('active_ids')):
object.action_open_invoice()
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 | |
---|---|---|---|---|
|
1
Oct 21
|
3370 | ||
|
5
Oct 24
|
9755 | ||
|
3
Nov 24
|
15460 | ||
|
2
Mar 24
|
2943 | ||
|
1
Oct 22
|
83 |