跳至内容
菜单
此问题已终结
1 回复
13162 查看

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
4772
2
5月 20
9783
3
11月 17
3400
0
1月 16
3207
0
12月 15
3198