[FIX] Special case id fields
lp bug: https://launchpad.net/bugs/919184 fixed bzr revid: fme@openerp.com-20120125111628-vsz6mwptd7bm8hlm
This commit is contained in:
parent
82b7eb4951
commit
4ffe5f5545
|
@ -965,6 +965,10 @@ class View(openerpweb.Controller):
|
||||||
xml = ElementTree.fromstring(arch)
|
xml = ElementTree.fromstring(arch)
|
||||||
fvg['arch'] = common.xml2json.from_elementtree(xml, preserve_whitespaces)
|
fvg['arch'] = common.xml2json.from_elementtree(xml, preserve_whitespaces)
|
||||||
|
|
||||||
|
if 'id' in fvg['fields']:
|
||||||
|
# Special case for id's
|
||||||
|
fvg['fields']['id']['type'] = 'id'
|
||||||
|
|
||||||
for field in fvg['fields'].itervalues():
|
for field in fvg['fields'].itervalues():
|
||||||
if field.get('views'):
|
if field.get('views'):
|
||||||
for view in field["views"].itervalues():
|
for view in field["views"].itervalues():
|
||||||
|
|
|
@ -90,6 +90,8 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) {
|
||||||
}
|
}
|
||||||
var l10n = _t.database.parameters;
|
var l10n = _t.database.parameters;
|
||||||
switch (descriptor.widget || descriptor.type) {
|
switch (descriptor.widget || descriptor.type) {
|
||||||
|
case 'id':
|
||||||
|
return value.toString();
|
||||||
case 'integer':
|
case 'integer':
|
||||||
return openerp.web.insert_thousand_seps(
|
return openerp.web.insert_thousand_seps(
|
||||||
_.str.sprintf('%d', value));
|
_.str.sprintf('%d', value));
|
||||||
|
|
|
@ -3227,6 +3227,7 @@ openerp.web.form.widgets = new openerp.web.Registry({
|
||||||
'label' : 'openerp.web.form.WidgetLabel',
|
'label' : 'openerp.web.form.WidgetLabel',
|
||||||
'button' : 'openerp.web.form.WidgetButton',
|
'button' : 'openerp.web.form.WidgetButton',
|
||||||
'char' : 'openerp.web.form.FieldChar',
|
'char' : 'openerp.web.form.FieldChar',
|
||||||
|
'id' : 'openerp.web.form.FieldChar',
|
||||||
'email' : 'openerp.web.form.FieldEmail',
|
'email' : 'openerp.web.form.FieldEmail',
|
||||||
'url' : 'openerp.web.form.FieldUrl',
|
'url' : 'openerp.web.form.FieldUrl',
|
||||||
'text' : 'openerp.web.form.FieldText',
|
'text' : 'openerp.web.form.FieldText',
|
||||||
|
|
|
@ -245,6 +245,7 @@ openerp.web.page = function (openerp) {
|
||||||
openerp.web.page.readonly = openerp.web.form.widgets.clone({
|
openerp.web.page.readonly = openerp.web.form.widgets.clone({
|
||||||
'frame': 'openerp.web.page.WidgetFrameReadonly',
|
'frame': 'openerp.web.page.WidgetFrameReadonly',
|
||||||
'char': 'openerp.web.page.FieldCharReadonly',
|
'char': 'openerp.web.page.FieldCharReadonly',
|
||||||
|
'id': 'openerp.web.page.FieldCharReadonly',
|
||||||
'email': 'openerp.web.page.FieldEmailReadonly',
|
'email': 'openerp.web.page.FieldEmailReadonly',
|
||||||
'url': 'openerp.web.page.FieldUrlReadonly',
|
'url': 'openerp.web.page.FieldUrlReadonly',
|
||||||
'text': 'openerp.web.page.FieldCharReadonly',
|
'text': 'openerp.web.page.FieldCharReadonly',
|
||||||
|
|
Loading…
Reference in New Issue