projects
/
OpenERP
/
cmmi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2493195
)
Rajout d'une méthode permettant de terminer un mesurable
author
Alicia FLOREZ
<alicflorez@gmail.com>
Tue, 4 Jun 2013 08:49:14 +0000
(10:49 +0200)
committer
Alicia FLOREZ
<alicflorez@gmail.com>
Tue, 4 Jun 2013 08:49:14 +0000
(10:49 +0200)
axes.py
patch
|
blob
|
history
diff --git
a/axes.py
b/axes.py
index
a48e86a
..
5ef14ed
100644
(file)
--- a/
axes.py
+++ b/
axes.py
@@
-106,6
+106,25
@@
class Mesurable(osv.Model):
{'state': 'suspendu'},
context,
)
+ return self
+
+ def terminer(self, cr, uid, ids, context=None):
+ if type(ids) == list:
+ if len(ids) != 1:
+ return # TODO: message d'avertissement
+ ids = ids[0]
+
+ mesurable = self.read(cr, uid, ids, ['state'], context, context)
+ if mesurable['state'] != 'encours':
+ return
+ self.write(
+ cr,
+ uid,
+ ids,
+ {'state': 'termine'},
+ context,
+ )
+ return self