콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
1614 화면


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

아바타
취소
베스트 답변

You can follow this: https://youtu.be/XGqXEL2qQmE

Hope it helps,

Thanks

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
1
8월 20
15785
1
10월 20
11723
1
12월 24
2294
3
2월 25
3450
0
5월 24
46