Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
12596 Lượt xem

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
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 20
4267
2
thg 5 20
9123
3
thg 11 17
2884
0
thg 1 16
2914
0
thg 12 15
2846