I have a wizard which, after a process, returns a list of one2many objects. I would like to identify when the user clicks into one of the items in the list and trigger a method in the class to identify which item the user has selected.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
You can use onchange event. Define onchange function in object(like in account):
def onchange_journal_id(self, cr, uid, ids, journal_id, context=None): company_id = False if journal_id: journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context) if journal.company_id.id: company_id = journal.company_id.id return {'value': {'company_id': company_id}}
And define call of function in form view XML definition:
<field name="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" widget="selection"/>
I assume you are searching about which action is launched.
A button is defined in xml like this:
<button name="reconcile" string="Reconcile" type="object" class="oe_highlight"/>
The name
specifies which action will be triggered.
In that exemple from account_automatic_reconcile
wizard it will trigger the wizard account_automatic_reconcile.reconcile()
method.
You could wrap this method call by adding a counter in python.
Otherwise, you can perhaps use some javascript.
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
1
cze 24
|
442 | ||
|
1
lut 16
|
4844 | ||
Need to know wizard closed
Rozwiązane
|
|
1
kwi 24
|
581 | |
|
1
wrz 23
|
2181 | ||
Insert One2many in wizard, TransientModel
Rozwiązane
|
|
2
wrz 24
|
13283 |