summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2011-03-30 17:23:01 +0200
committerVo Minh Thu <vmt@openerp.com>2011-03-30 17:23:01 +0200
commit4944140a91bb80ea7b4c585d7e2fd1fce112efb8 (patch)
treec31ee8cb48e74d383d1879a296ccf77f0fc6137c
parentb247657a6a55c4c1fc6fa41744b7c1b24671718d (diff)
parentfa508cc30c668248b59b2e7e2046c50c307dcce7 (diff)
[MERGE] merged trunk.
bzr revid: vmt@openerp.com-20110330152301-884qvxeg62ae633g
-rw-r--r--debian/po/sq.po39
-rw-r--r--openerp/addons/base/ir/ir_model.py4
-rw-r--r--openerp/osv/orm.py2
-rw-r--r--openerp/tools/convert.py20
-rw-r--r--openerp/tools/misc.py19
5 files changed, 79 insertions, 5 deletions
diff --git a/debian/po/sq.po b/debian/po/sq.po
new file mode 100644
index 00000000000..78c5a241cdc
--- /dev/null
+++ b/debian/po/sq.po
@@ -0,0 +1,39 @@
+# Albanian translation for openobject-server
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-server package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-server\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-08-24 22:41+0300\n"
+"PO-Revision-Date: 2011-03-28 14:50+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Albanian <sq@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2011-03-29 04:39+0000\n"
+"X-Generator: Launchpad (build 12559)\n"
+
+#. Type: string
+#. Description
+#: ../openerp-server.templates:1001
+msgid "Dedicated system account for the Open ERP server:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../openerp-server.templates:1001
+msgid ""
+"The Open ERP server must use a dedicated account for its operation so that "
+"the system's security is not compromised by running it with superuser "
+"privileges."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../openerp-server.templates:1001
+msgid "Please choose that account's username."
+msgstr ""
diff --git a/openerp/addons/base/ir/ir_model.py b/openerp/addons/base/ir/ir_model.py
index 5ce50370c77..794c419dafd 100644
--- a/openerp/addons/base/ir/ir_model.py
+++ b/openerp/addons/base/ir/ir_model.py
@@ -303,10 +303,10 @@ class ir_model_fields(osv.osv):
# static table of properties
model_props = [ # (our-name, fields.prop, set_fn)
- ('field_description', 'string', lambda a: a),
+ ('field_description', 'string', str),
('required', 'required', bool),
('readonly', 'readonly', bool),
- ('domain', '_domain', lambda a: a),
+ ('domain', '_domain', eval),
('size', 'size', int),
('on_delete', 'ondelete', str),
('translate', 'translate', bool),
diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py
index 9ecf547969f..b60d9547869 100644
--- a/openerp/osv/orm.py
+++ b/openerp/osv/orm.py
@@ -2818,7 +2818,7 @@ class orm(orm_template):
'string': field['field_description'],
'required': bool(field['required']),
'readonly': bool(field['readonly']),
- 'domain': field['domain'] or None,
+ 'domain': eval(field['domain']) if field['domain'] else None,
'size': field['size'],
'ondelete': field['on_delete'],
'translate': (field['translate']),
diff --git a/openerp/tools/convert.py b/openerp/tools/convert.py
index 6f91a955cc6..5536f311eb8 100644
--- a/openerp/tools/convert.py
+++ b/openerp/tools/convert.py
@@ -50,6 +50,8 @@ from yaml_import import convert_yaml_import
# List of etree._Element subclasses that we choose to ignore when parsing XML.
from misc import SKIPPED_ELEMENT_TYPES
+from misc import unquote
+
# Import of XML records requires the unsafe eval as well,
# almost everywhere, which is ok because it supposedly comes
# from trusted data, but at least we make it obvious now.
@@ -439,7 +441,21 @@ form: module.record_id""" % (xml_id,)
limit = rec.get('limit','').encode('utf-8')
auto_refresh = rec.get('auto_refresh','').encode('utf-8')
uid = self.uid
- active_id = str("active_id") # for further reference in client/bin/tools/__init__.py
+
+ # Act_window's 'domain' and 'context' contain mostly literals
+ # but they can also refer to the variables provided below
+ # in eval_context, so we need to eval() them before storing.
+ # Among the context variables, 'active_id' refers to
+ # the currently selected items in a list view, and only
+ # takes meaning at runtime on the client side. For this
+ # reason it must remain a bare variable in domain and context,
+ # even after eval() at server-side. We use the special 'unquote'
+ # class to achieve this effect: a string which has itself, unquoted,
+ # as representation.
+ active_id = unquote("active_id")
+ active_ids = unquote("active_ids")
+ active_model = unquote("active_model")
+
def ref(str_id):
return self.id_get(cr, str_id)
@@ -459,6 +475,8 @@ form: module.record_id""" % (xml_id,)
'auto_refresh': auto_refresh,
'uid' : uid,
'active_id': active_id,
+ 'active_ids': active_ids,
+ 'active_model': active_model,
'ref' : ref,
}
context = self.get_context(data_node, rec, eval_context)
diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py
index cd817fa796a..1524d95d922 100644
--- a/openerp/tools/misc.py
+++ b/openerp/tools/misc.py
@@ -1439,6 +1439,23 @@ def attrgetter(*items):
return tuple(resolve_attr(obj, attr) for attr in items)
return g
+class unquote(str):
+ """A subclass of str that implements repr() without enclosing quotation marks
+ or escaping, keeping the original string untouched. The name come from Lisp's unquote.
+ One of the uses for this is to preserve or insert bare variable names within dicts during eval()
+ of a dict's repr(). Use with care.
+ Some examples:
+ >>> unquote('active_id')
+ active_id
+ >>> repr(unquote('active_id'))
+ active_id
+ >>> d = {'test': unquote('active_id')}
+ >>> d
+ {'test': active_id}
+ >>> repr(d)
+ "{'test': active_id}"
+ """
+ def __repr__(self):
+ return self
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-