← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 801490] Re: [AddOns: Document] document write (updating existant)

 

Hello,

Would you please check this again with latest updated code.

Currently I am closing this issue and if you still face the problem then
you can reopen this with more information.

Thanks.


** Changed in: openobject-addons
       Status: Expired => Invalid

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/801490

Title:
  [AddOns: Document] document write (updating existant)

Status in OpenERP Modules (addons):
  Invalid

Bug description:
  Hi,

  when I try to update an existing attached document i get the following
  error

  I think there is a probleme with base64 encoding on line 116
  document.py (_data_set)

  regards

  pedro

  Traceback (most recent call last):
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 489, in dispatch
      result = ExportService.getService(service_name).dispatch(method, auth, params)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 599, in dispatch
      res = fn(db, uid, *params)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/document/document.py", line 271, in write
      result = super(document_file,self).write(cr, uid, ids, vals, context=context)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base/ir/ir_attachment.py", line 106, in write
      return super(ir_attachment, self).write(cr, uid, ids, vals, context)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 3434, in write
      result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/fields.py", line 837, in set
      self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/document/document.py", line 116, in _data_set
      res=fnode.set_data(cr, base64.decodestring(value), fbro)
    File "/usr/lib/python2.6/base64.py", line 321, in decodestring
      return binascii.a2b_base64(s)
  Error: Incorrect padding

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


References