projects
/
OpenERP
/
todolist.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
09c43f9
)
Ajout verification milestone de la tache < milestone de la liste
author
Alicia FLOREZ
<alicflorez@gmail.com>
Fri, 22 Mar 2013 11:00:11 +0000
(12:00 +0100)
committer
Alicia FLOREZ
<alicflorez@gmail.com>
Fri, 22 Mar 2013 11:00:11 +0000
(12:00 +0100)
todolist.py
patch
|
blob
|
history
diff --git
a/todolist.py
b/todolist.py
index
6812316
..
e75175b
100644
(file)
--- a/
todolist.py
+++ b/
todolist.py
@@
-141,7
+141,7
@@
class Task(osv.Model):
),
(
"manday_sup_0_constraint",
),
(
"manday_sup_0_constraint",
- "CHECK(manday < 0)",
+ "CHECK(manday > 0)",
"The manday should be positive",
),
]
"The manday should be positive",
),
]
@@
-167,13
+167,19
@@
class Task(osv.Model):
self.write(cr, uid, ids, {"state": "done"}, context=context)
return self
self.write(cr, uid, ids, {"state": "done"}, context=context)
return self
+ #chaque utilisateur voit seulement ces taches
def search(self, cr, user, args=[], offset=0, limit=None, order=None, context=None, count=False):
args.append(("create_uid", "=", user))
if len(args) != 1:
args.insert(0, "&")
return osv.Model.search(self, cr, user, args, offset, limit, order, context, count)
def search(self, cr, user, args=[], offset=0, limit=None, order=None, context=None, count=False):
args.append(("create_uid", "=", user))
if len(args) != 1:
args.insert(0, "&")
return osv.Model.search(self, cr, user, args, offset, limit, order, context, count)
-
+ def write(self, cr, user, ids, vals, context=None):
+ if "milestone" in vals.keys():
+ for task in self.browse(cr, user, ids, context=context):
+ if task.container_id.milestone < vals["milestone"]:
+ vals["milestone"] = task.container_id.milestone
+ return osv.Model.write(self, cr, user, ids, vals, context)
class Topic(osv.Model):
class Topic(osv.Model):