After some researchs, I found that "action_res_users_my" opens the form of current user. But I don't understand why it opens a form for current user instead of a new form. I'd like to make another act_window that will open a form view for a user's attribute. If I link an act_window to a form view only, it opens a new form, so I need a tree view and a useless click to go on the correct form view. I don't know how to give a record id in the link between act_window and its form view. There is a "res_id" field but it doesn't seem dynamic (depending of current user).
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
1
Antworten
4962
Ansichten
you just need to pass the record id in the context of the action under the name of 'active_id', like this:
return {
'name': _('Supplier Invoices'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.invoice',
'view_id': False,
'context': {
'active_model': self._name,
'active_id': inv_id,
'active_ids': [inv_id],
},
'type': 'ir.actions.act_window',
'res_id': inv_id,
}
can you please elaborate a little further in your proposed answer, thanks :)
Check again the answer for an example, Hope that helps
solved?
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
RegistrierenVerknüpfte Beiträge | Antworten | Ansichten | Aktivität | |
---|---|---|---|---|
V17 Tree, Form view
Gelöst
|
|
1
März 25
|
1439 | |
|
3
Feb. 21
|
26959 | ||
|
2
Sept. 17
|
8385 | ||
|
0
Sept. 15
|
4521 | ||
|
2
Sept. 15
|
11159 |