
Co-authored-by: Victor Feyens (vfe) <vfe@odoo.com> Co-authored-by: Elisabeth Dickinson (edi) <edi@odoo.com> Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
25 lines
713 B
Plaintext
25 lines
713 B
Plaintext
# HG changeset patch
|
|
# Parent 121bbfe120be3007f5e04611dbc27038abafcce8
|
|
|
|
Index: addons/openacademy/models.py
|
|
===================================================================
|
|
--- addons.orig/openacademy/models.py
|
|
+++ addons/openacademy/models.py
|
|
@@ -14,6 +14,16 @@
|
|
session_ids = fields.One2many(
|
|
'openacademy.session', 'course_id', string="Sessions")
|
|
|
|
+ _sql_constraints = [
|
|
+ ('name_description_check',
|
|
+ 'CHECK(name != description)',
|
|
+ "The title of the course should not be the description"),
|
|
+
|
|
+ ('name_unique',
|
|
+ 'UNIQUE(name)',
|
|
+ "The course title must be unique"),
|
|
+ ]
|
|
+
|
|
|
|
class Session(models.Model):
|
|
_name = 'openacademy.session'
|