With the old api we could return a domain in the on change function, is this possible with the new api?
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
ok, its possible, but if the function has the decorator @api.one not works.
my error:
@api.one
@api.onchange('field_id')
def onchange_field_id(self):
relation_ids = [x.id for x in self.field_id.relation_ids]
return {'domain':{'relation_id': [('id', 'in', relation_ids)]}}
but without @api.one works perfectly
@api.onchange('field_id')
def onchange_field_id(self):
relation_ids = [x.id for x in self.field_id.relation_ids]
return {'domain':{'relation_id': [('id', 'in', relation_ids)]}}
Short update that it still works for V14/V15. Simply remove the @api.one there as this has been deprecated :-)
@Yenthe onchange that returns a domain is deprecated..
Yes, Its possible an onchange method can return three items (warning, domain, value)
You can also use @api.multi
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
sty 17
|
6640 | ||
|
1
sie 25
|
313 | ||
Change position chatter
Rozwiązane
|
|
1
sie 25
|
337 | |
|
4
lip 25
|
1683 | ||
|
1
lip 25
|
958 |