Xavier ALT (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.1-opw-573041-xal into
lp:openobject-addons/6.1.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-573041-xal/+merge/99679
Hi,
When creating an "Opportunity" when both "crm" and "base_contact" modules are
installed, the system always create a "lead" - ignoring context
"{'default_type': 'opportunity'}".
As lead inherit from res.partner.address, once the "base_contact" module is
installed, we get calling the base_contact's res.partner.address default_get(),
which is removing "default_type" from context!
This MP force usage of base ORM default_get() to avoid conflicting with
base_contact implementation.
Please kindly review it.
Cheers,
Xavier
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-573041-xal/+merge/99679
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.1-opw-573041-xal.
=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py 2012-01-31 13:36:57 +0000
+++ crm/crm_lead.py 2012-03-28 07:20:27 +0000
@@ -68,6 +68,11 @@
return [(r['id'], tools.ustr(r[self._rec_name]))
for r in self.read(cr, user, ids, [self._rec_name], context)]
+ # overridden because if 'base_contact' is installed - their default_get() will remove
+ # 'default_type' from context making it impossible to record an 'opportunity'
+ def default_get(self, cr, uid, fields_list, context=None):
+ return super(osv.osv, self).default_get(cr, uid, fields_list, context=context)
+
def _compute_day(self, cr, uid, ids, fields, args, context=None):
"""
@param cr: the current row, from the database cursor,
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp