diff options
| author | Foram Katharotiya (OpenERP) <fka@tinyerp.com> | 2012-08-13 15:55:19 +0530 |
|---|---|---|
| committer | Foram Katharotiya (OpenERP) <fka@tinyerp.com> | 2012-08-13 15:55:19 +0530 |
| commit | 1bf105837ed5cad0715b20ef501e7147af87c7ef (patch) | |
| tree | 7a292e7311c91e6e0acafe7359dd1e7f1d7a4cb9 /addons/document/document.py | |
| parent | dae19bc174b3962088bf4b9fd0701f80ab8f8e5e (diff) | |
| parent | 03e6f93fcffa7775754bf5198478b5927d8ffe1c (diff) | |
[MERGE]merge with lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa
bzr revid: fka@tinyerp.com-20120813102519-9h3fpqj29dse2p3m
Diffstat (limited to 'addons/document/document.py')
| -rw-r--r-- | addons/document/document.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index fa65f8d9966..3ee52f8e4fb 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -23,7 +23,7 @@ import base64 from osv import osv, fields import os -# from psycopg2 import Binary +#from psycopg2 import Binary #from tools import config import tools from tools.translate import _ @@ -37,8 +37,8 @@ DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['roo class document_file(osv.osv): _inherit = 'ir.attachment' _rec_name = 'datas_fname' - - + + def _attach_parent_id(self, cr, uid, ids=None, context=None): """Migrate ir.attachments to the document module. @@ -61,7 +61,7 @@ class document_file(osv.osv): return False if ids is not None: - raise NotImplementedError("Ids is just there by convention! Don't use it yet, please.") + raise NotImplementedError("Ids are just there by convention, please do not use it.") cr.execute("UPDATE ir_attachment " \ "SET parent_id = %s, db_datas = decode(encode(db_datas,'escape'), 'base64') " \ @@ -294,7 +294,7 @@ class document_file(osv.osv): ('datas_fname', '=', vals['datas_fname']), ] attach_ids = self.search(cr, uid, domain, context=context) - super(document_file, self).write(cr, uid, attach_ids, + super(document_file, self).write(cr, uid, attach_ids, {'datas' : vals['datas']}, context=context) result = attach_ids[0] @@ -339,7 +339,7 @@ class document_file(osv.osv): if r: unres.append(r) else: - self.loggerdoc.warning("Unlinking attachment #%s %s that has no storage", + self.loggerdoc.warning("Unlinking attachment #%s %s that has no storage.", f.id, f.name) res = super(document_file, self).unlink(cr, uid, ids, context) stor.do_unlink(cr, uid, unres) |
