← Back to team overview

openerp-india team mailing list archive

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

 

** Also affects: therp-backports/addons-6.1
   Importance: Medium
       Status: Fix Released

** Also affects: therp-backports/addons-7.0
   Importance: Undecided
       Status: New

** Changed in: therp-backports/addons-6.1
    Milestone: 7.0-maintenance => None

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1082632

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

Status in OpenERP Addons (modules):
  New
Status in Therp Backports:
  Fix Released
Status in Therp Backports addons-6.1 series:
  Fix Released
Status in Therp Backports addons-7.0 series:
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1082632/+subscriptions


References