Merge lp:~unifield-team/unifield-server/server-uf-1916 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 3449
Proposed branch: lp:~unifield-team/unifield-server/server-uf-1916
Merge into: lp:unifield-server
Diff against target: 27 lines (+7/-1)
1 file modified
bin/tools/translate.py (+7/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/server-uf-1916
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+157309@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/tools/translate.py'
2--- bin/tools/translate.py 2013-03-11 10:30:16 +0000
3+++ bin/tools/translate.py 2013-04-05 09:28:08 +0000
4@@ -922,6 +922,7 @@
5
6 # read the rest of the file
7 line = 1
8+ clear_cache = False
9 for row in reader:
10 line += 1
11 # skip empty rows and rows where the translation field (=last fiefd) is empty
12@@ -962,9 +963,14 @@
13 ids = trans_obj.search(cr, uid, args)
14 if ids:
15 if context.get('overwrite') and dic['value']:
16- trans_obj.write(cr, uid, ids, {'value': dic['value']})
17+ # trans_obj.write(cr, uid, ids, {'value': dic['value']})
18+ # bypass write method to speed up the update, the cache will be cleared after the import
19+ clear_cache = True
20+ cr.execute('UPDATE ir_translation SET value=%s WHERE id in %s', (dic['value'], tuple(ids)))
21 else:
22 trans_obj.create(cr, uid, dic)
23+ if clear_cache:
24+ tools.cache.clean_caches_for_db(cr.dbname)
25 if verbose:
26 logger.info("translation file loaded succesfully")
27 except IOError:

Subscribers

People subscribed via source and target branches

to all changes: