How-to-get-rid-of-the-error.jpg
Blogger_636313953512117529.jpg
By: Jesni

How to get rid of the error A Partner Cannot Follow Twice The Same Object

Do you need our help ???

Have you ever faced the following Odoo Warning ???

http/blog/Uploads/BlogImage/How-to-get-rid-of-the-error-1.png

Do you want to fix it?

Don't worry we are here for you...


Follow these instructions:


class Uninstall(models.Model):


   _inherit = 'base.module.upgrade'

 

   def upgrade_module(self, cr, uid, ids, context=None):


res = super(UnInstall, self).upgrade_module(cr, uid, ids, context=context) ir_module  =



self.pool.get('ir.module.module')



followers  = self.pool.get('mail.followers')



followers_ids = followers.search(cr, uid, [('res_model', 'in', ['job.card'])]) ids = ir_module.search(cr,



uid, [('state', 'in', ['to remove'])])



for j in ir_module.browse(cr, uid, ids):



if j.name == 'vehicle_sales':



    for i in followers.browse(cr, uid, followers_ids): i.unlink()


return res

 

This code helps all the developers to fix the error. You can solve this Odoo warning by following this code. You can edit few lines which are mentioned below.

•followers_ids = followers.search(cr, uid, [('res_model', 'in', ['job.card'])])?   

Here you can fill your table information in which table you face this issue instead  of  “job.card”


if j.name == 'vehicle_sales':

Here you can fill your custom module in which module you face this issue instead of “vehicle_sale”.




Leave a comment

0 Comment