summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Grand-Guillaume @ CampToCamp <>2009-06-30 13:03:44 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2009-06-30 13:03:44 +0530
commitcc4e06238da72bc0622f39cc958078fd457bb4d3 (patch)
tree2a37eec2a2465a9c30587b12f3d9dc6021879db3
parentc7bb1da092523ffd7bb05c765e8fa3d6170bba6b (diff)
[FIX] Character Truncation problem on updation solved
lp bug: https://launchpad.net/bugs/381204 fixed bzr revid: jvo@tinyerp.com-20090630073344-crmlcg3hbmiqzthk
-rw-r--r--bin/osv/orm.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/osv/orm.py b/bin/osv/orm.py
index 4d91e4a213f..1cd3acc08c9 100644
--- a/bin/osv/orm.py
+++ b/bin/osv/orm.py
@@ -1633,7 +1633,9 @@ class orm(orm_template):
('int4', 'float', get_pg_type(f)[1], '::'+get_pg_type(f)[1]),
('date', 'datetime', 'TIMESTAMP', '::TIMESTAMP'),
]
- if f_pg_type == 'varchar' and f._type == 'char' and f_pg_size != f.size:
+ # !!! Avoid reduction of varchar field !!!
+ if f_pg_type == 'varchar' and f._type == 'char' and f_pg_size < f.size:
+ # if f_pg_type == 'varchar' and f._type == 'char' and f_pg_size != f.size:
logger.notifyChannel('orm', netsvc.LOG_INFO, "column '%s' in table '%s' changed size" % (k, self._table))
cr.execute('ALTER TABLE "%s" RENAME COLUMN "%s" TO temp_change_size' % (self._table, k))
cr.execute('ALTER TABLE "%s" ADD COLUMN "%s" VARCHAR(%d)' % (self._table, k, f.size))