Files
odoo_source/doc/howtos/backend/exercise-constraint-sql
T
Xavier Morel 1126485373 [FIX] doc: warnings when installing openacademy
* add _description to openacademy models
* add aria-label to kanban view
* many patches need to be rewritten to unfuzz them

closes odoo/odoo#27617
2018-10-10 11:04:37 +00:00

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'