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

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 20
4705
2
พ.ค. 20
9720
3
พ.ย. 17
3368
0
ม.ค. 16
3192
0
ธ.ค. 15
3183