Merge lp:~openerp-dev/openobject-server/trunk-bug-1029344-aja into lp:openobject-server

Proposed by ajay javiya (OpenERP)
Status: Rejected
Rejected by: Vo Minh Thu
Proposed branch: lp:~openerp-dev/openobject-server/trunk-bug-1029344-aja
Merge into: lp:openobject-server
Diff against target: 20 lines (+2/-2)
1 file modified
openerp/tools/translate.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/trunk-bug-1029344-aja
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+128691@code.launchpad.net

Description of the change

Hello,
Fix issue Synchronize translation terms crash when abstract models are used.
Thank You

To post a comment you must log in.
Revision history for this message
Vo Minh Thu (thu) wrote :

The `not(... or ...)` is not equivalent to the previous condition (i.e. it will crash if objmodel is None). It should have been `not (... and ...)`.

The test for AbstractModel is better than nothing (i.e. to not discard report which have _auto to False but still exist in database) but still not enough; we need something more accurate.

As we have still the merge prop. from Guewen I will reject this one and work on the other one.

Unmerged revisions

4478. By ajay javiya (OpenERP)

[FIX]:Synchronize translation issue

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/tools/translate.py'
2--- openerp/tools/translate.py 2012-10-03 13:26:59 +0000
3+++ openerp/tools/translate.py 2012-10-09 11:49:21 +0000
4@@ -45,7 +45,7 @@
5 from misc import SKIPPED_ELEMENT_TYPES
6 import osutil
7 from openerp import SUPERUSER_ID
8-
9+import openerp
10 _logger = logging.getLogger(__name__)
11
12 # used to notify web client that these translations should be loaded in the UI
13@@ -697,7 +697,7 @@
14 _logger.error("name error in %s: %s", xml_name, str(exc))
15 continue
16 objmodel = pool.get(obj.model)
17- if not objmodel or not field_name in objmodel._columns:
18+ if not (objmodel or field_name in objmodel._columns) or (isinstance(objmodel,openerp.osv.orm.AbstractModel) and not objmodel._auto):
19 continue
20 field_def = objmodel._columns[field_name]
21