Merge lp:~akretion-team/openobject-server/openobject-server-fix-ir_model-field_description into lp:openobject-server/7.0

Proposed by David BEAL (ak)
Status: Needs review
Proposed branch: lp:~akretion-team/openobject-server/openobject-server-fix-ir_model-field_description
Merge into: lp:openobject-server/7.0
Diff against target: 43 lines (+5/-5)
1 file modified
openerp/addons/base/ir/ir_model.py (+5/-5)
To merge this branch: bzr merge lp:~akretion-team/openobject-server/openobject-server-fix-ir_model-field_description
Reviewer Review Type Date Requested Status
Raphaël Valyi - http://www.akretion.com (community) Approve
OpenERP Core Team Pending
Review via email: mp+188005@code.launchpad.net

Description of the change

Avoid to crash when you change 'field_description' value with some non ascii 128 chars

[FIX] replace 'str' by 'unicode' in 'ir_model_fields' class (write method) in 'model_props' list for 'field_description' field

How to reproduce the bug
see https://bugs.launchpad.net/openobject-server/+bug/1231900

To post a comment you must log in.
Revision history for this message
David BEAL (ak) (davidbeal) wrote :

my IDE delete spaces in the end of lines like in lines 17, 26, 35

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

I confirm both the bug and the fact this is a valid fix for it (tested here). Thanks for merging.

review: Approve

Unmerged revisions

5089. By David BEAL (ak)

[FIX] replace 'str' by 'unicode' in 'ir_model_fields' class (write method) in 'model_props' list for 'field_description' field : avoid to crash when you change 'field_description' value with some non ascii chars

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/addons/base/ir/ir_model.py'
2--- openerp/addons/base/ir/ir_model.py 2013-07-30 11:46:45 +0000
3+++ openerp/addons/base/ir/ir_model.py 2013-09-27 10:04:00 +0000
4@@ -381,7 +381,7 @@
5
6 # static table of properties
7 model_props = [ # (our-name, fields.prop, set_fn)
8- ('field_description', 'string', str),
9+ ('field_description', 'string', unicode),
10 ('required', 'required', bool),
11 ('readonly', 'readonly', bool),
12 ('domain', '_domain', eval),
13@@ -504,7 +504,7 @@
14 def _module_data_uninstall(self, cr, uid, ids, context=None):
15 """
16 Delete PostgreSQL foreign keys and constraints tracked by this model.
17- """
18+ """
19
20 if uid != SUPERUSER_ID and not self.pool.get('ir.model.access').check_groups(cr, uid, "base.group_system"):
21 raise except_orm(_('Permission Denied'), (_('Administrator access is required to uninstall a module')))
22@@ -565,7 +565,7 @@
23 def _module_data_uninstall(self, cr, uid, ids, context=None):
24 """
25 Delete PostgreSQL many2many relations tracked by this model.
26- """
27+ """
28
29 if uid != SUPERUSER_ID and not self.pool.get('ir.model.access').check_groups(cr, uid, "base.group_system"):
30 raise except_orm(_('Permission Denied'), (_('Administrator access is required to uninstall a module')))
31@@ -1020,11 +1020,11 @@
32 ``ids`` along with their corresponding database backed (including
33 dropping tables, columns, FKs, etc, as long as there is no other
34 ir.model.data entry holding a reference to them (which indicates that
35- they are still owned by another module).
36+ they are still owned by another module).
37 Attempts to perform the deletion in an appropriate order to maximize
38 the chance of gracefully deleting all records.
39 This step is performed as part of the full uninstallation of a module.
40- """
41+ """
42
43 ids = self.search(cr, uid, [('module', 'in', modules_to_remove)])
44