From 61b8f19ba41688dba2e4601e4f47caadb3238c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 10 Sep 2012 10:31:35 +0200 Subject: [PATCH] [CLEAN] mail/res_users: cleaned comment in auto_init. bzr revid: tde@openerp.com-20120910083135-2tef7mn01kujtyvj --- addons/mail/res_users.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py index a5aea54bf9b..f9ca54c478d 100644 --- a/addons/mail/res_users.py +++ b/addons/mail/res_users.py @@ -55,10 +55,11 @@ class res_users(osv.Model): return init_res def _auto_init(self, cr, context=None): - """Installation hook to create aliases for all users and avoid constraint errors.""" + """ Installation hook: aliases, partner following themselves """ + # create aliases for all users and avoid constraint errors self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(res_users, self)._auto_init, self._columns['alias_id'], 'login', alias_force_key='id', context=context) - # make already existing users follow themselves, using read to avoid unprefetched fields browse failure + # make already existing users follow themselves, using SQL to avoid using the ORM during the auto_init cr.execute(""" SELECT p.id FROM res_partner p LEFT JOIN mail_followers n ON (n.partner_id = p.id AND n.res_model = 'res.partner' AND n.res_id = p.id)