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:
3891203
)
Utilisation de fields.related pour l'affectation du name de la class ProjetPhase
author
Alicia FLOREZ
<alicflorez@gmail.com>
Tue, 4 Jun 2013 16:06:52 +0000
(18:06 +0200)
committer
Alicia FLOREZ
<alicflorez@gmail.com>
Tue, 4 Jun 2013 16:06:52 +0000
(18:06 +0200)
projet.py
patch
|
blob
|
history
diff --git
a/projet.py
b/projet.py
index
6fd936e
..
e730fef
100644
(file)
--- a/
projet.py
+++ b/
projet.py
@@
-350,16
+350,12
@@
class ProjetPhase(osv.Model):
_description = "Rattachement des Phases aux projets"
_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",