From 1fccb8fb0c76123aac93642be40d8f74fd067c4b Mon Sep 17 00:00:00 2001 From: Alicia FLOREZ Date: Tue, 26 Mar 2013 11:08:34 +0100 Subject: [PATCH] Task : modification contrainte, manday doit etre>= 0 --- sql/COPIER_CONTAINERS.SQL | 8 ++++---- todolist.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/COPIER_CONTAINERS.SQL b/sql/COPIER_CONTAINERS.SQL index 075db64..2d02fe0 100644 --- a/sql/COPIER_CONTAINERS.SQL +++ b/sql/COPIER_CONTAINERS.SQL @@ -2,16 +2,16 @@ CREATE OR REPLACE FUNCTION copierContainer (id_container todolist_container.id%T DECLARE copy_id todolist_container.id%TYPE; BEGIN - INSERT INTO todolist_container (name, description, state) ( - SELECT 'Copy of ' || name, description, 'draft' + INSERT INTO todolist_container (name, description, state, create_uid) ( + SELECT 'Copy of ' || name, description, 'draft', create_uid FROM todolist_container WHERE id = id_container ); SELECT currval(pg_get_serial_sequence('todolist_container', 'id')) INTO copy_id; - INSERT INTO todolist_task (name, description, container_id, milestone, planned, manday, priority) ( - SELECT name, description, copy_id, milestone, planned, manday, priority + INSERT INTO todolist_task (name, description, container_id, milestone, planned, manday, priority, create_uid) ( + SELECT name, description, copy_id, milestone, planned, manday, priority, create_uid FROM todolist_task WHERE container_id = id_container ); diff --git a/todolist.py b/todolist.py index 5d0c666..e1be67c 100644 --- a/todolist.py +++ b/todolist.py @@ -155,7 +155,7 @@ class Task(osv.Model): ), ( "manday_sup_0_constraint", - "CHECK(manday > 0)", + "CHECK(manday >= 0)", "The manday should be positive", ), ] -- 1.7.10.4