代码之家  ›  专栏  ›  技术社区  ›  Chaban33

未使用不同类型触发更改时

  •  0
  • Chaban33  · 技术社区  · 7 年前

    我重写了onchange\u partner\u id,如果我创建了类型为“contact”的联系人,它会非常有效,但是如果我选择了类型“delivery address”,onchange不会被触发。。为什么会这样?我该怎么解决?

    def onchange_parent_id(self, cr, uid, ids, parent_id, context=None):
            res = super(ResPartner, self).onchange_parent_id(cr, uid, ids, parent_id, context=context)
            new_contact_obj = self.browse(cr,uid,ids,context=context)
            parent_obj = self.browse(cr,uid, parent_id,context=context)
            if not new_contact_obj.multiply_pricelists_ids:
                new_contact_obj.multiply_pricelists_ids = parent_obj.multiply_pricelists_ids
            return res
    
    1 回复  |  直到 7 年前