Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3249 มุมมอง

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 ? 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
เม.ย. 16
7849
Odoo8 trigger compute methods แก้ไขแล้ว
3
ส.ค. 15
4914
1
ม.ค. 24
6309
1
พ.ค. 25
610
0
ม.ค. 24
1369