Commit 2863a960 authored by Roque's avatar Roque

erp5_officejs: no sense to get tales raw definition

parent 83dfceec
...@@ -4,21 +4,14 @@ ...@@ -4,21 +4,14 @@
"use strict"; "use strict";
function renderField(field_id, field_definition, document) { function renderField(field_id, field_definition, document) {
var key, raw_value, tales_expr, override, final_value, item_list, result = {}; var key, raw_value, override, final_value, item_list, result = {};
for (key in field_definition.values) { for (key in field_definition.values) {
if (field_definition.values.hasOwnProperty(key)) { if (field_definition.values.hasOwnProperty(key)) {
// order to get the final value (based on Field.py get_value) // order to get the final value (based on Field.py get_value)
// 1.tales, 2.override, 3.form-def-value, 4.context-default // 1.override, 2.form-def-value, 3.context-default
raw_value = field_definition.values[key]; raw_value = field_definition.values[key];
tales_expr = field_definition.tales[key];
override = field_definition.overrides[key]; override = field_definition.overrides[key];
final_value = undefined; final_value = undefined;
if (tales_expr !== undefined && tales_expr !== null && tales_expr !== '') {
try {
throw "error";
//final_value = eval(tales_expr);
} catch (ignore) {} // TALES expressions are usually python code, so for now ignore
}
if (final_value === undefined) { if (final_value === undefined) {
if (override !== undefined && override !== null && override !== '') { if (override !== undefined && override !== null && override !== '') {
final_value = override; final_value = override;
......
...@@ -15,7 +15,6 @@ def getFieldRawProperties(field, meta_type=None, key=None, key_prefix=None): ...@@ -15,7 +15,6 @@ def getFieldRawProperties(field, meta_type=None, key=None, key_prefix=None):
"type": meta_type, "type": meta_type,
"key": key, "key": key,
"values": {}, "values": {},
"tales": {},
"overrides": field.overrides, "overrides": field.overrides,
"message_values": field.message_values "message_values": field.message_values
} }
...@@ -49,9 +48,6 @@ def getFieldRawProperties(field, meta_type=None, key=None, key_prefix=None): ...@@ -49,9 +48,6 @@ def getFieldRawProperties(field, meta_type=None, key=None, key_prefix=None):
result["values"]["renderjs_extra"] = result["values"]["renderjs_extra"][0][0] result["values"]["renderjs_extra"] = result["values"]["renderjs_extra"][0][0]
except (ValueError, KeyError, IndexError): except (ValueError, KeyError, IndexError):
log("error while patching form gadget list definition") log("error while patching form gadget list definition")
for key in field.tales.keys():
if field.tales[key]:
result["tales"][key] = str(field.tales[key])
return result return result
if REQUEST.get("view") == "definition_view": if REQUEST.get("view") == "definition_view":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment