[IMP]revert changes as per new spec

bzr revid: sgo@tinyerp.com-20130218061014-lg6uk108vajx43mo
This commit is contained in:
sgo@tinyerp.com
2013-02-18 11:40:14 +05:30
parent 7781f28c15
commit 74a681e9db
2 changed files with 1 additions and 25 deletions
+1 -12
View File
@@ -88,9 +88,6 @@ def is_ir_set(node):
def is_string(node):
return isinstance(node, basestring)
def is_session(node):
return _is_yaml_mapping(node, yaml_tag.Session)
class RecordDictWrapper(dict):
"""
Used to pass a record as locals in eval:
@@ -763,7 +760,7 @@ class YamlInterpreter(object):
keyword = 'client_action_relate'
value = 'ir.actions.act_window,%s' % id
replace = node.replace or True
self.pool.get('ir.model.data').ir_set(self.cr, self.uid, 'action', keyword, \
self.pool.get('ir.model.data').ir_set(self.cr, SUPERUSER_ID, 'action', keyword, \
node.id, [node.src_model], value, replace=replace, noupdate=self.isnoupdate(node), isobject=True, xml_id=node.id)
# TODO add remove ir.model.data
@@ -779,12 +776,6 @@ class YamlInterpreter(object):
else:
self._log("Record not deleted.")
def process_session(self, node):
record, fields = node.items()[0]
uid = self.get_id(record.uid)
self.uid = uid
_logger.debug("RECORD_DICT %s" % uid)
def process_url(self, node):
self.validate_xml_id(node.id)
@@ -898,8 +889,6 @@ class YamlInterpreter(object):
self.process_act_window(node)
elif is_report(node):
self.process_report(node)
elif is_session(node):
self.process_session(node)
elif is_workflow(node):
if isinstance(node, types.DictionaryType):
self.process_workflow(node)
-13
View File
@@ -32,13 +32,6 @@ class Record(YamlTag):
def __str__(self):
return '!record {model: %s, id: %s}:' % (str(self.model,), str(self.id,))
class Session(YamlTag):
def __init__(self, uid, **kwargs):
self.uid = uid
super(Session, self).__init__(**kwargs)
def __str__(self):
return '!session {uid: %s}:' % (str(self.uid,))
class Python(YamlTag):
def __init__(self, model, severity=logging.ERROR, name="", **kwargs):
self.model= model
@@ -120,11 +113,6 @@ def record_constructor(loader, node):
assert "id" in kwargs, "'id' argument is required for !record"
return Record(**kwargs)
def session_constructor(loader, node):
kwargs = loader.construct_mapping(node)
assert "uid" in kwargs, "'uid' argument is required for !session"
return Session(**kwargs)
def python_constructor(loader, node):
kwargs = loader.construct_mapping(node)
return Python(**kwargs)
@@ -194,7 +182,6 @@ def add_constructors():
yaml.add_constructor(u"!eval", eval_constructor)
yaml.add_multi_constructor(u"!ref", ref_constructor)
yaml.add_constructor(u"!ir_set", ir_set_constructor)
yaml.add_constructor(u"!session", session_constructor)
add_constructors()