[6.1] write in mail.message fails because of non existing variable in fetchmail overriding function

Bug #1082632 reported by Ronald Portier (Therp)
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Won't Fix
Undecided
Unassigned
Therp Backports (Deprecated)
Status tracked in Addons-6.1
Addons-6.1
Fix Released
Medium
Unassigned

Bug Description

When calling mail_message.send, the call fails because fetchmail.py overrides the mail_message.write function with a function containing a not existing variable.

Error in log:
  File "/home/openeyedev/var/openerp/addons_6.1/mail/mail_message.py", line 502, in send
    self.write(cr, uid, ids, {'state': 'outgoing'}, context=context)
NameError: global name 'server_id' is not defined

These kind of errors should never happen if modern IDE's were used that would catch these errors immediately.

Anyway below is the failing part of the code:

    def write(self, cr, uid, ids, values, context=None):
        if context is None:
            context={}
        fetchmail_server_id = context.get('fetchmail_server_id')
        if fetchmail_server_id:
            values['fetchmail_server_id'] = server_id
        res = super(mail_message,self).write(cr, uid, ids, values, context=context)
        return res

The variable server_id in the third line from below does not exist. it should be fetchmail_server_id.

This has been fixed in trunk / 7.0 in revision r8037, but left unchanged in 6.1.

Related branches

Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :
description: updated
Changed in therp-backports:
milestone: none → 6.1-maintenance
Changed in therp-backports:
importance: Undecided → Medium
Changed in therp-backports:
status: New → Fix Committed
Changed in therp-backports:
status: Fix Committed → Fix Released
Lara (Therp) (lfreeke)
Changed in therp-backports:
milestone: 6.1-maintenance → 7.0-maintenance
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello,

Currently, We have improved our code in latest trunk as well as in 7.0. That's why we can not consider this Issue.

So,If you have a support and maintenance contract with us then you can contact with our OPW team at <email address hidden> ,they will definitely help you.

I hope you understand.

Thank you..

Changed in openobject-addons:
status: New → Won't Fix
no longer affects: therp-backports/addons-7.0
Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :

Well I do not understand this at all.

A lot of customers are still running on 6.1. Not everybody can switch to 7.0 overnight.

Are you really saying anybody using the fetchmail function on 6.1 should switch to using the Therp backports branch?

I do not need your contract. I created the fix for this problem myself.

The merge request for the standard 6.1 branch is a contribution to the community. The only thing OpenERP S.A. needs to do is merge the ready made solution.

Are you saying you are leaving bugs in 6.1 on purpose, just to force people to take an OPW contract?

Kind regards,

Ronald

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.