【发布时间】:2016-10-21 11:11:29
【问题描述】:
我有这个代码。单击保存按钮时出现此错误。请帮助解决此问题。
TypeError: write() 为关键字参数 'context' 获取了多个值
class crm_case_stage(osv.osv):
_inherit="crm.case.stage"
_columns = {
'name':fields.char('Stage Name'),
'email_template_ids':fields.many2many('email.template','email_tempate_rel','template_id'), #Integrate email templates with stage ids
'template_count' : fields.integer('Mail Template Count'),
}
def write(self, cr, uid, ids, context=None):
cur_obj=self.browse(cr, uid, ids, context=context)
self.write(cr, uid, ids,{'template_count':len(cur_obj.email_template_ids.ids)},context=context)
【问题讨论】: