Stephane Wirtel (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-fix_fetchmail_modules-stw into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-fix_fetchmail_modules-stw/+merge/77686

Remove the useless default_get method and set the right model in the context 
via evaluation
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-fix_fetchmail_modules-stw/+merge/77686
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-fix_fetchmail_modules-stw.
=== modified file 'fetchmail/fetchmail.py'
--- fetchmail/fetchmail.py	2011-09-22 13:14:29 +0000
+++ fetchmail/fetchmail.py	2011-09-30 11:00:36 +0000
@@ -78,22 +78,6 @@
         'attach': True,
     }
 
-    def default_get(self, cr, uid, fields, context=None):
-        if context is None:
-            context = {}
-
-        result = super(fetchmail_server, self).default_get(cr, uid, fields, context=context)
-
-        model = context.pop('fetchmail_model', False) or False
-
-        if isinstance(model, basestring):
-            model_id = self.pool.get('ir.model').search(cr, uid, [('model', '=', model)], context=context)
-            result.update(
-                object_id = model_id[0],
-            )
-
-        return result
-
     def onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False):
         port = 0
         if server_type == 'pop':

=== modified file 'fetchmail_crm/installer.xml'
--- fetchmail_crm/installer.xml	2011-09-23 13:30:56 +0000
+++ fetchmail_crm/installer.xml	2011-09-30 11:00:36 +0000
@@ -6,8 +6,8 @@
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">fetchmail.server</field>
             <field name="view_type">form</field>
-            <field name="view_mode">form</field>
-            <field name="context">{'default_name' : "Email Account For Leads", 'fetchmail_model' : 'crm.lead'}</field>
+            <field name="view_mode">form,tree</field>
+            <field name="context" eval="'{\'default_name\' : \'Email Account For Leads\', \'search_default_object_id\' : %d, \'default_object_id\': %d}' % (ref('crm.model_crm_lead'), ref('crm.model_crm_lead'))" />
         </record>
 
         <record model="ir.actions.todo" id="config_wizard_action_create_crm_leads_from_email_account">

=== modified file 'fetchmail_crm_claim/installer.xml'
--- fetchmail_crm_claim/installer.xml	2011-09-23 13:30:56 +0000
+++ fetchmail_crm_claim/installer.xml	2011-09-30 11:00:36 +0000
@@ -6,8 +6,8 @@
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">fetchmail.server</field>
             <field name="view_type">form</field>
-            <field name="view_mode">form</field>
-            <field name="context">{'default_name' : "Email Account For Claims", 'fetchmail_model' : 'crm.claim'}</field>
+            <field name="view_mode">form,tree</field>
+            <field name="context" eval="'{\'default_name\' : \'Email Account For Claims\', \'search_default_object_id\':%d, \'default_object_id\': %d}' % (ref('crm_claim.model_crm_claim'), ref('crm_claim.model_crm_claim'))" />
         </record>
 
         <record model="ir.actions.todo" id="config_wizard_action_create_crm_claims_from_email_account">

=== modified file 'fetchmail_hr_recruitment/installer.xml'
--- fetchmail_hr_recruitment/installer.xml	2011-09-23 13:30:56 +0000
+++ fetchmail_hr_recruitment/installer.xml	2011-09-30 11:00:36 +0000
@@ -6,8 +6,8 @@
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">fetchmail.server</field>
             <field name="view_type">form</field>
-            <field name="view_mode">form</field>
-            <field name="context">{'default_name' : "Email Account For Applicant", 'fetchmail_model' : 'hr.applicant'}</field>
+            <field name="view_mode">form,tree</field>
+            <field name="context" eval="'{\'default_name\' : \'Email Account For Applicants\', \'search_default_object_id\': %d, \'default_object_id\': %d}' % (ref('hr_recruitment.model_hr_applicant'), ref('hr_recruitment.model_hr_applicant'))" />
         </record>
 
         <record model="ir.actions.todo" id="config_wizard_action_link_applicant_to_email_account">

=== modified file 'fetchmail_project_issue/installer.xml'
--- fetchmail_project_issue/installer.xml	2011-09-23 13:30:56 +0000
+++ fetchmail_project_issue/installer.xml	2011-09-30 11:00:36 +0000
@@ -6,8 +6,8 @@
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">fetchmail.server</field>
             <field name="view_type">form</field>
-            <field name="view_mode">form</field>
-            <field name="context">{'default_name' : "Email Account For Issue", 'fetchmail_model' : 'project.issue'}</field>
+            <field name="view_mode">form,tree</field>
+            <field name="context" eval="'{\'default_name\' : \'Email Account For Issues\', \'search_default_object_id\' : %d, \'default_object_id\': %d}' % (ref('project_issue.model_project_issue'), ref('project_issue.model_project_issue'))" />
         </record>
 
         <record model="ir.actions.todo" id="config_wizard_action_link_issue_to_email_account">

_______________________________________________
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