From 3caaf103b38c8fb4ddc1464ce40fabba842f92c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 26 Feb 2009 01:10:37 +0100 Subject: [PATCH] Add report_name_module_uniq constraint on ir.action.report --- trytond/ir/action.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/trytond/ir/action.py b/trytond/ir/action.py index d2762171d0..9c5b1f2af4 100644 --- a/trytond/ir/action.py +++ b/trytond/ir/action.py @@ -236,8 +236,16 @@ class ActionReport(OSV): module = fields.Char('Module', readonly=True) email = fields.Char('Email') + def __init__(self): + super(ActionReport, self).__init__() + self._sql_constraints += [ + ('report_name_module_uniq', 'UNIQUE(report_name, module)', + 'The internal name must be unique by module!'), + ] + def init(self, cursor, module_name): super(ActionReport, self).init(cursor, module_name) + table = TableHandler(cursor, self._table, self._name, module_name) # Migration from 1.0 report_name_uniq has been removed