Merge lp:~dieck/openobject-server/dieck-6.0-lp780584 into lp:openobject-server/6.0

Proposed by Marco Dieckhoff
Status: Rejected
Rejected by: Vo Minh Thu
Proposed branch: lp:~dieck/openobject-server/dieck-6.0-lp780584
Merge into: lp:openobject-server/6.0
Diff against target: 43 lines (+6/-5)
1 file modified
bin/osv/orm.py (+6/-5)
To merge this branch: bzr merge lp:~dieck/openobject-server/dieck-6.0-lp780584
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+61714@code.launchpad.net

Description of the change

FIXED Bug 780584: Field definition translate=Yes is not stored in ir.model.fields; fix was provided by xrg on http://git.hellug.gr/?p=xrg/openobject-server;a=commit;h=d7a8fa5352e995d526c

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

I have provided a link in the related bug report to a branch with this patch. It is based on this one but also add the column to base.sql. It casts also the integer to a bool. I will reject this patch as it doesn't work as is and another is provided.

Unmerged revisions

3429. By Panos Christeas (xrg)

FIXED Bug 780584: Field definition translate=Yes is not stored in ir.model.fields; fix was provided by xrg on http://git.hellug.gr/?p=xrg/openobject-server;a=commit;h=d7a8fa5352e995d526c

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/osv/orm.py'
2--- bin/osv/orm.py 2011-04-11 10:08:47 +0000
3+++ bin/osv/orm.py 2011-05-20 08:44:32 +0000
4@@ -458,6 +458,7 @@
5 'readonly': (f.readonly and 1) or 0,
6 'required': (f.required and 1) or 0,
7 'selectable': (f.selectable and 1) or 0,
8+ 'translate': (f.translate and 1) or 0,
9 'relation_field': (f._type=='one2many' and isinstance(f, fields.one2many)) and f._fields_id or '',
10 }
11 # When its a custom field,it does not contain f.select
12@@ -474,13 +475,13 @@
13 vals['id'] = id
14 cr.execute("""INSERT INTO ir_model_fields (
15 id, model_id, model, name, field_description, ttype,
16- relation,view_load,state,select_level,relation_field
17+ relation,view_load,state,select_level,relation_field, translate
18 ) VALUES (
19- %s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s
20+ %s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s
21 )""", (
22 id, vals['model_id'], vals['model'], vals['name'], vals['field_description'], vals['ttype'],
23 vals['relation'], bool(vals['view_load']), 'base',
24- vals['select_level'], vals['relation_field']
25+ vals['select_level'], vals['relation_field'], vals['translate']
26 ))
27 if 'module' in context:
28 name1 = 'field_' + self._table + '_' + k
29@@ -497,12 +498,12 @@
30 cr.commit()
31 cr.execute("""UPDATE ir_model_fields SET
32 model_id=%s, field_description=%s, ttype=%s, relation=%s,
33- view_load=%s, select_level=%s, readonly=%s ,required=%s, selectable=%s, relation_field=%s
34+ view_load=%s, select_level=%s, readonly=%s ,required=%s, selectable=%s, relation_field=%s, translate=%s
35 WHERE
36 model=%s AND name=%s""", (
37 vals['model_id'], vals['field_description'], vals['ttype'],
38 vals['relation'], bool(vals['view_load']),
39- vals['select_level'], bool(vals['readonly']), bool(vals['required']), bool(vals['selectable']), vals['relation_field'], vals['model'], vals['name']
40+ vals['select_level'], bool(vals['readonly']), bool(vals['required']), bool(vals['selectable']), vals['relation_field'], bool(vals['translate']), vals['model'], vals['name']
41 ))
42 break
43 cr.commit()