创建 'LINE_NO' 当我更新的价值,它抛出了KeyError异常列:40field.function - KeyError异常:40
我的代码:
def _get_line_no(self, cr, uid, ids, line_no, arg, context=None):
res = {}
for record in self.browse(cr, uid, ids, context=context):
nextno =0
no = record.next_line_no
next_no = nextno + no
total =+ next_no
res={
'next_line_no':next_no,
'line_no': total
}
return res
_columns = {
'line_no':fields.function(_get_line_no,string='Line No',type='integer'),
'next_line_no':fields.integer(' Next Line No'),
}
_defaults = {
'next_line_no':1
}
抛出错误:KeyError异常:40
我该如何解决?
它的工作原理,更正代码总数+ = next_no – 3156938
@dhana真棒! :) –
@AtulArvind谢谢请给+1,所以它是有用的所有用户 – dhana