[MERGE] bug fix lp:691640

bzr revid: sbh@tinyerp.com-20101221045232-ne1ap61dev96o2rp
This commit is contained in:
Sbh (OpenERP) 2010-12-21 10:22:32 +05:30
commit c516bede92
1 changed files with 11 additions and 0 deletions

View File

@ -220,4 +220,15 @@ class task(osv.osv):
return super(task,self).write(cr, uid, ids, vals, context)
task()
class res_partner(osv.osv):
_inherit = 'res.partner'
def unlink(self, cursor, user, ids, context=None):
parnter_id=self.pool.get('project.project').search(cursor, user, [('partner_id', 'in', ids)])
if parnter_id:
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Partner which is Assigned to project !'))
return super(res_partner,self).unlink(cursor, user, ids,
context=context)
res_partner()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: