diff --git a/trytond/ir/translation.xml b/trytond/ir/translation.xml
index edde03c466..42cf666ddb 100644
--- a/trytond/ir/translation.xml
+++ b/trytond/ir/translation.xml
@@ -95,6 +95,15 @@
ir
+
+ delete_workflow_record
+ en_US
+ error
+ You cannot delete a record with a running workflow.
+ You cannot delete a record with a running workflow.
+ ir
+
+
ir.translation.set_report.init
diff --git a/trytond/ir/ui/view.py b/trytond/ir/ui/view.py
index 6a9bf270f0..7519aba7ac 100644
--- a/trytond/ir/ui/view.py
+++ b/trytond/ir/ui/view.py
@@ -15,12 +15,13 @@ class View(OSV):
model = fields.Char('Model', required=True, select=1)
priority = fields.Integer('Priority', required=True, select=1)
type = fields.Selection([
- ('tree','Tree'),
- ('form','Form'),
- ('graph', 'Graph'),
- ('calendar', 'Calendar'),
- ('board', 'Board'),
- ], 'View Type', select=1)
+ (False, ''),
+ ('tree','Tree'),
+ ('form','Form'),
+ ('graph', 'Graph'),
+ ('calendar', 'Calendar'),
+ ('board', 'Board'),
+ ], 'View Type', select=1)
arch = fields.Text('View Architecture', required=True)
inherit = fields.Many2One('ir.ui.view', 'Inherited View', select=1,
ondelete='CASCADE')
@@ -33,7 +34,7 @@ class View(OSV):
('check_xml', 'invalid_xml'),
]
self._error_messages.update({
- 'invalid_xml': 'Invalid XML for View Architecture!',
+ 'invalid_xml': 'Invalid XML for View!',
})
self._order.insert(0, ('priority', 'ASC'))
@@ -63,6 +64,14 @@ class View(OSV):
xml = view.arch.strip()
tree = etree.fromstring(xml)
+ if view.inherit:
+ if view.model != view.inherit.model:
+ logger = logging.getLogger('ir')
+ logger.error('Invalid model "%s" ' \
+ 'with inherited model "%"' % \
+ (view.model, view.inherit.model))
+ return False
+
# validate the tree using RelaxNG
rng_name = os.path.join(os.path.dirname(__file__),
(view.inherit and view.inherit.type or view.type) + '.rng')
diff --git a/trytond/netsvc.py b/trytond/netsvc.py
index d24911343e..c4fd3e2074 100644
--- a/trytond/netsvc.py
+++ b/trytond/netsvc.py
@@ -295,7 +295,12 @@ class TinySocketClientThread(threading.Thread):
import pdb
tback = sys.exc_info()[2]
pdb.post_mortem(tback)
- pysocket.send(exception.args, exception=True, traceback=tb_s)
+ try:
+ pysocket.send(exception.args, exception=True, traceback=tb_s)
+ except:
+ pysocket.disconnect()
+ self.threads.remove(self)
+ return False
pysocket.disconnect()
self.threads.remove(self)
return True
diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py
index d57504d1b6..e40dba42f6 100644
--- a/trytond/osv/orm.py
+++ b/trytond/osv/orm.py
@@ -1406,8 +1406,8 @@ class ORM(object):
"AND res_type = %s AND state != 'complete'",
ids + [self._name])
if cursor.rowcount != 0:
- raise Exception('UserError',
- 'You cannot delete a record with a running workflow.')
+ self.raise_user_error(cursor, 'delete_workflow_record',
+ context=context)
wf_service = LocalService("workflow")
for obj_id in ids:
@@ -2142,7 +2142,7 @@ class ORM(object):
raise AttributeError('Unknown position ' \
'in inherited view %s!' % pos)
else:
- raise AttributeError('Couldn\'t find tag in parent view!')
+ raise AttributeError('Couldn\'t find tag (%s: %s) in parent view!' % (element2.tag, element2.get('expr')))
return etree.tostring(tree_src, encoding='utf-8')
result = {'type': view_type, 'model': self._name}