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

Hello every one

I need to use elif or some thing to force control 2 state to get 2 action for each one in second part of code and i have this below code but it doesn't work and when i remove elif it start working but in one mode, any body know how to write second condition in odoo v8?

def default_recipient(self):
move_type = self.env.context.get('move', False)
if move_type == 'in':
return self.env.user.company_id.partner_id

@property
def default_sender(self):
move_type = self.env.context.get('move', False)
if move_type == 'out':
return self.env.user.company_id.partner_id
elif move_type == 'int':
return self.env.user.partner_id
아바타
취소
베스트 답변

Hello Berctain,

You have done well, may be the problem with  move_type value,
Print or debug and check what is the move_type value is coming from context

아바타
취소
관련 게시물 답글 화면 활동
1
11월 20
4786
2
5월 20
9837
3
11월 17
3427
0
1월 16
3215
0
12월 15
3233