我试图向员工发送通知,我创建了一个计算的many2many字段来获取合作伙伴ID并将它们传递给mail.wizard.invite模型的partner_ids字段。
这是我继承的课程:
from openerp import models, fields, api
class CustMailInvite(models.Model):
_inherit = 'mail.wizard.invite'
employee_ids=fields.Many2many('hr.employee','employees')
@api.one
@api.depends('employee_ids.user_id.partner_id')
def compute_partner_ids(self):
for a in self.employee_ids:
if a.user_id:
if a.user_id.partner_id:
self.partner_ids += a.user_id.partner_id.id
partner_ids=fields.Many2many('res.partner',compute='compute_partner_ids')
我收到此错误:
ValueError异常
混合苹果和橘子:res.partner()+ 5
答案 0 :(得分:1)
function draw(data) {
$.each(data, function(idx, obj) {
$('#bid').append('<div class="row"><div class="col-md-2"><h5>'+obj.price+'</h5></div></div>');
});
};
问题出在这行self.partner_ids + = a.user_id.partner_id.id,我改为self.partner_ids + = a.user_id.partner_id