diff options
| author | Antonin Bourguignon <abo@openerp.com> | 2012-09-17 13:44:55 +0200 |
|---|---|---|
| committer | Antonin Bourguignon <abo@openerp.com> | 2012-09-17 13:44:55 +0200 |
| commit | ccb15e76f64f324f2dc2e446cac43f05c3a0aab2 (patch) | |
| tree | 4f9f7732b0071ba48544d3767591545ada04265f /addons/document/document.py | |
| parent | 7488a675b4d9a8e99cf2b9b25c194e114babcafb (diff) | |
| parent | 84094e0c39bf20499aefccc6c78143aeb2227d18 (diff) | |
[MERGE] latest trunk
bzr revid: abo@openerp.com-20120917114455-nygv16c93qwcwnsx
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) |
