Raphael Collet (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-995986-rco into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #995986 in OpenERP Addons: "column crm_lead.opt_out does not exist"
  https://bugs.launchpad.net/openobject-addons/+bug/995986

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-995986-rco/+merge/105042

Rename the crm.lead fields optin, optout to opt_in, opt_out.
It makes them consistent with the field opt_out added to res.partner by module 
email_template.

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-995986-rco/+merge/105042
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-995986-rco.
=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py	2012-04-03 17:21:08 +0000
+++ crm/crm_lead.py	2012-05-08 08:40:23 +0000
@@ -162,8 +162,8 @@
         'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel (mail, direct, phone, ...)"),
         'contact_name': fields.char('Contact Name', size=64),
         'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner company that will be created while converting the lead into opportunity', select=1),
-        'optin': fields.boolean('Opt-In', help="If opt-in is checked, this contact has accepted to receive emails."),
-        'optout': fields.boolean('Opt-Out', help="If opt-out is checked, this contact has refused to receive emails or unsubscribed to a campaign."),
+        'opt_in': fields.boolean('Opt-In', help="If opt-in is checked, this contact has accepted to receive emails."),
+        'opt_out': fields.boolean('Opt-Out', help="If opt-out is checked, this contact has refused to receive emails or unsubscribed to a campaign."),
         'type':fields.selection([ ('lead','Lead'), ('opportunity','Opportunity'), ],'Type', help="Type is used to separate Leads and Opportunities"),
         'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True),
         'date_closed': fields.datetime('Closed', readonly=True),
@@ -227,11 +227,11 @@
         self.create_send_note(cr, uid, [obj_id], context=context)
         return obj_id
     
-    def on_change_optin(self, cr, uid, ids, optin):
-        return {'value':{'optin':optin,'optout':False}}
+    def on_change_opt_in(self, cr, uid, ids, opt_in):
+        return {'value':{'opt_in':opt_in,'opt_out':False}}
 
-    def on_change_optout(self, cr, uid, ids, optout):
-        return {'value':{'optout':optout,'optin':False}}
+    def on_change_opt_out(self, cr, uid, ids, opt_out):
+        return {'value':{'opt_out':opt_out,'opt_in':False}}
 
     def onchange_stage_id(self, cr, uid, ids, stage_id, context={}):
         if not stage_id:

=== modified file 'crm/crm_lead_view.xml'
--- crm/crm_lead_view.xml	2012-04-25 11:51:39 +0000
+++ crm/crm_lead_view.xml	2012-05-08 08:40:23 +0000
@@ -144,8 +144,8 @@
                     </group>
                     <group colspan="2" col="2">
                         <separator string="Mailings" colspan="2" col="2"/>
-                        <field name="optin" on_change="on_change_optin(optin)"/>
-                        <field name="optout" on_change="on_change_optout(optout)"/>
+                        <field name="opt_in" on_change="on_change_opt_in(opt_in)"/>
+                        <field name="opt_out" on_change="on_change_opt_out(opt_out)"/>
                     </group>
                     <group colspan="2" col="2" groups="base.group_no_one">
                         <separator string="Statistics" colspan="2" col="2"/>
@@ -506,8 +506,8 @@
                     </group>
                     <group colspan="2" col="2">
                         <separator string="Mailings" colspan="2"/>
-                        <field name="optin" on_change="on_change_optin(optin)"/>
-                        <field name="optout" on_change="on_change_optout(optout)"/>
+                        <field name="opt_in" on_change="on_change_opt_in(opt_in)"/>
+                        <field name="opt_out" on_change="on_change_opt_out(opt_out)"/>
                     </group>
                 </page>
                 <page string="Extra Info">

=== modified file 'email_template/res_partner.py'
--- email_template/res_partner.py	2011-12-19 16:54:40 +0000
+++ email_template/res_partner.py	2012-05-08 08:40:23 +0000
@@ -28,7 +28,7 @@
     _inherit = 'res.partner'
 
     _columns = {
-        'opt_out': fields.boolean('Opt-out', help="If checked, this partner will not receive any automated email " \
+        'opt_out': fields.boolean('Opt-Out', help="If checked, this partner will not receive any automated email " \
                                                   "notifications, such as the availability of invoices."),
     }
 

=== modified file 'import_sugarcrm/import_sugarcrm.py'
--- import_sugarcrm/import_sugarcrm.py	2012-02-16 17:29:41 +0000
+++ import_sugarcrm/import_sugarcrm.py	2012-05-08 08:40:23 +0000
@@ -697,7 +697,7 @@
                 'state': map_val('status', self.lead_state) ,
                 'fax': 'phone_fax',
                 'referred': 'refered_by',
-                'optout': 'do_not_call',
+                'opt_out': 'do_not_call',
                 'channel_id/id': call(self.get_channel_id, value('lead_source')),
                 'type_id/id': ref(self.TABLE_COMPAIGN, 'campaign_id'),
                 'country_id/id': 'country_id/id',

_______________________________________________
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

Reply via email to