Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3510 Widoki

Let's say a computed field depends on a relation, like this:

event_year = fields.Date(compute='_get_event_year', store=True)

fiscal_years = fields.One2many('account.fiscal.year')

@api.depends('fiscal_years')
def _get_event_year(self):
...

Is it ok to depend only on field fiscal_years, i.e. will the year will be changed anytime one dependent fiscal_year is updated or should we specify each field on the relation we wan't to listen to like for instance 'fiscal_years.year' ? If we would listen to several fields like ('fiscal_years.year', 'fiscal_years.month', ...) can we just keep 'fiscal_years' in the depends decorator or should we list all sub_fields ? 

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
kwi 16
8121
3
sie 15
5163
1
sty 24
6529
3
lip 25
8751
1
maj 25
1050