Hello, I just created an automatic action that should return a dynamic domain for a field but it is returning this error, I did it from the odoo interface
and it is returning this error
SyntaxError : 'return' outside function at line 5
None
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello, I just created an automatic action that should return a dynamic domain for a field but it is returning this error, I did it from the odoo interface
and it is returning this error
SyntaxError : 'return' outside function at line 5
None
Hi,
The error 'return' outside a function occurs because return statements should be inside a function in Python. In Odoo'so automated actions, you don't need to use return to return a value. Instead, you should set the result directly. Here's how you can fix your code:
for record in self:
limited_records = self.env['x_reg_aprobaciones'].search([], limit=1,order='name')
if limited_records:
a = {'domain': {'x_aprobacion': [('x_aprobacion.id', 'in', limited_records.ids)]}}
Hope it helps
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
ส.ค. 20
|
15795 | ||
|
1
ต.ค. 20
|
11731 | ||
|
1
ธ.ค. 24
|
2305 | ||
|
3
ก.พ. 25
|
3475 | ||
|
0
พ.ค. 24
|
46 |