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:
e2d9a54
)
Rajout d'une méthode permettant de suspendre un mesurable
author
Alicia FLOREZ
<alicflorez@gmail.com>
Tue, 4 Jun 2013 07:54:41 +0000
(09:54 +0200)
committer
Alicia FLOREZ
<alicflorez@gmail.com>
Tue, 4 Jun 2013 07:54:41 +0000
(09:54 +0200)
axes.py
patch
|
blob
|
history
diff --git
a/axes.py
b/axes.py
index
8270559
..
8b2233d
100644
(file)
--- a/
axes.py
+++ b/
axes.py
@@
-80,7
+80,8
@@
class Mesurable(osv.Model):
self.write(
cr,
self.write(
cr,
- uid, ids, {
+ uid,
+ ids, {
'date_init_deb' : palier['date_plan_deb'],
'date_init_fin' : palier['date_plan_fin'],
'statut': 'encours'
'date_init_deb' : palier['date_plan_deb'],
'date_init_fin' : palier['date_plan_fin'],
'statut': 'encours'
@@
-89,6
+90,25
@@
class Mesurable(osv.Model):
return self
return self
+ def suspendre(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, ['statut'], context, context)
+ if mesurable['statut'] != 'encours':
+ return
+ self.write(
+ cr,
+ uid,
+ ids,
+ {'statut': 'suspendu'},
+ context,
+ )
+
+
+
#------------ TRAVAIL CALCUL JOURS OUVRES ------------
@staticmethod
def _get_date_paques(annee):
#------------ TRAVAIL CALCUL JOURS OUVRES ------------
@staticmethod
def _get_date_paques(annee):