projects
/
OpenERP
/
cmmi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Corretion aux bugs du dernier commit + modification vue form évolution
[OpenERP/cmmi.git]
/
projet.py
diff --git
a/projet.py
b/projet.py
index
90a40d6
..
f37b957
100644
(file)
--- a/
projet.py
+++ b/
projet.py
@@
-5,6
+5,7
@@
from openerp.osv import osv, fields
from openerp.osv import osv, fields
+# ================================== PROJET ================================= #
class Projet(osv.Model):
_name = "cmmi.projet"
class Projet(osv.Model):
_name = "cmmi.projet"
@@
-82,6
+83,9
@@
class Projet(osv.Model):
_columns = {
"name": fields.char(string="Title", size=64, required=True),
"description": fields.text(string="Description"),
_columns = {
"name": fields.char(string="Title", size=64, required=True),
"description": fields.text(string="Description"),
+ "use_chantier": fields.boolean(string="Utilisation de la notion de chantier ?"),
+ "use_palier": fields.boolean(string="Utilisation de la notion de palier ?"),
+
# Backrefs
"domains": fields.one2many("cmmi.projet.domaine",
"project_id",
# Backrefs
"domains": fields.one2many("cmmi.projet.domaine",
"project_id",
@@
-110,7
+114,6
@@
class Projet(osv.Model):
"evolutions": fields.one2many("cmmi.evolution",
"projet_id",
string="Evolutions"),
"evolutions": fields.one2many("cmmi.evolution",
"projet_id",
string="Evolutions"),
- # TODO: faire un champs fonction qui renvoie uniquement les domaines sélectionnés
# Champs fonction rapatriant les mo ou domaine principaux
"moe_id": fields.function(_get_main_moe,
# Champs fonction rapatriant les mo ou domaine principaux
"moe_id": fields.function(_get_main_moe,
@@
-128,6
+131,11
@@
class Projet(osv.Model):
string="Phases sélectionnées"),
}
string="Phases sélectionnées"),
}
+ _defaults = {
+ "use_chantier": True,
+ "use_palier": True,
+ }
+
def create(self, cr, uid, vals, context=None):
project_id = osv.Model.create(self, cr, uid, vals, context=context)
def create(self, cr, uid, vals, context=None):
project_id = osv.Model.create(self, cr, uid, vals, context=context)
@@
-163,6
+171,7
@@
class Projet(osv.Model):
+# ============================= PROJET DOMAINE ============================== #
class ProjetDomaine(osv.Model):
_name = "cmmi.projet.domaine"
class ProjetDomaine(osv.Model):
_name = "cmmi.projet.domaine"
@@
-222,6
+231,7
@@
class ProjetDomaine(osv.Model):
+# =============================== PROJET MOE ================================ #
class ProjetMoe(osv.Model):
_name = "cmmi.projet.moe"
class ProjetMoe(osv.Model):
_name = "cmmi.projet.moe"
@@
-280,6
+290,7
@@
class ProjetMoe(osv.Model):
+# =============================== PROJET MOA ================================ #
class ProjetMoa(osv.Model):
_name = "cmmi.projet.moa"
class ProjetMoa(osv.Model):
_name = "cmmi.projet.moa"
@@
-338,21
+349,18
@@
class ProjetMoa(osv.Model):
+# =============================== PROJET PHASE ============================== #
class ProjetPhase(osv.Model):
_name = "cmmi.projet.phase"
_description = "Rattachement des Phases aux projets"
class ProjetPhase(osv.Model):
_name = "cmmi.projet.phase"
_description = "Rattachement des Phases aux projets"
- def _get_name(self, cr, uid, ids, field_name=None, arg=None, context=None):
- if isinstance(ids, (int, long)):
- ids = [ids]
- return dict([(i, r.phase_id.name) for i, r in
- zip(ids, self.browse(cr, uid, ids, context=context))])
-
_columns = {
_columns = {
- "name": fields.function(_get_name,
- type='char',
- store=True,
+ "name": fields.related("phase_id",
+ "name",
+ read_only=True,
+ type="char",
+ relation="cmmi.phase",
string="Nom de la phase"),
"phase_id": fields.many2one("cmmi.phase",
string="Phase",
string="Nom de la phase"),
"phase_id": fields.many2one("cmmi.phase",
string="Phase",
@@
-365,6
+373,7
@@
class ProjetPhase(osv.Model):
+# ============================ PROJET TEAM MEMBER =========================== #
class ProjetTeammember(osv.Model):
_name = "cmmi.projet.teammember"
class ProjetTeammember(osv.Model):
_name = "cmmi.projet.teammember"