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

Hello.

I am trying to create an automated action that will prevent the creation of the Sales order if there is no contact selected as Customer.

Example:

Company Ltd. --> Not allowed

Company Ltd., Name Username --> Allowed

I tried with an Automated action on creation and a Python code:

x = env['sale.order'].partner_id.parent_id
 if x == false:
    raise Warning("CONTACT IS MISSING")

But it doesn't work, x is always "false". Any suggestions?


Thank you so much!

Nejc

아바타
취소
베스트 답변
if not record.partner_id.parent_id:
  Warning('CONTACT IS MISSING')


아바타
취소
베스트 답변

Hi,

Try this code and see,

x = rec.partner_id.parent_id
if not x:
    raise Warning("CONTACT IS MISSING")


Thanks

아바타
취소
관련 게시물 답글 화면 활동
1
11월 22
6631
0
1월 21
2405
1
11월 22
3811
3
2월 25
2098
1
12월 24
2169