Merge lp:~openerp-dev/openobject-addons/6.0-opw-576907-rha into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 5294
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-576907-rha
Merge into: lp:openobject-addons/6.0
Diff against target: 12 lines (+1/-1)
1 file modified
document/document.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-576907-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+115276@code.launchpad.net

Description of the change

Hello,

I have changed type of the document name from str to unicode. Problem occurs
when we have accented char in document name, it generated error.

Steps to re-produce:
1. Install module document. Create a document with name "Brochure_Español.pdf",
   Provide any Directory and save record.
2. Now edit record, change Directory and try to save. Error occurs!

"raise NotImplementedError("Cannot rename and move") # TODO
NotImplementedError: Cannot rename and move"

In write(), it calls fnode.move_to() and it fails name checking in this method because
of type difference of name which is str and unicode.

Please review it.

Regards,
Rifakat

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

5294. By Rifakat Husen (OpenERP)

[FIX] document: converted document name type from str to unicode in case name contains accented characters

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'document/document.py'
2--- document/document.py 2011-07-06 12:44:07 +0000
3+++ document/document.py 2012-07-17 06:26:14 +0000
4@@ -235,7 +235,7 @@
5 ids2.append(fbro.id)
6 continue
7 fnode = nctx.get_file_node(cr, fbro)
8- res = fnode.move_to(cr, dnode or fnode.parent, vals.get('name', fbro.name), fbro, dbro, True)
9+ res = fnode.move_to(cr, dnode or fnode.parent, tools.ustr(vals.get('name', fbro.name)), fbro, dbro, True)
10 if isinstance(res, dict):
11 vals2 = vals.copy()
12 vals2.update(res)