Correction du bug avec les wizards
authorAlicia FLOREZ <alicflorez@gmail.com>
Fri, 24 May 2013 13:30:33 +0000 (15:30 +0200)
committerAlicia FLOREZ <alicflorez@gmail.com>
Fri, 24 May 2013 13:30:33 +0000 (15:30 +0200)
views/projet.xml
wizards/domaine.py
wizards/moa.py
wizards/moe.py

index bd1199a..c5ced1a 100644 (file)
@@ -24,7 +24,7 @@
                             </page>
                             <page string="MO">
                                 <p>MOE</p>
-                                <button type="action" target="new" name="cmmi.wizard_add_moe_to_project" string="Add a MOE" class="oe_highlight" context="{'project_id': id}" />
+                                <button type="action" target="new" name="%(wizard_add_moe_to_project)d" string="Add a MOE" class="oe_highlight" context="{'project_id': id}" />
                                 <field name="moe_ids">
                                     <tree create="false" delete="true" editable="true">
                                         <field name="project_id" invisible="1" />
@@ -34,7 +34,7 @@
                                     </tree>
                                 </field>
                                 <p>MOA</p>
-                                <button type="action" target="new" name="cmmi.wizard_add_moa_to_project" string="Add a MOA" class="oe_highlight" context="{'project_id': id}" />
+                                <button type="action" target="new" name="%(wizard_add_moa_to_project)d" string="Add a MOA" class="oe_highlight" context="{'project_id': id}" />
                                 <field name="moa_ids">
                                     <tree create="false" delete="true" editable="true">
                                         <field name="project_id" invisible="1" />
@@ -55,7 +55,7 @@
                                 </field>
                             </page>
                             <page string="Domaines">
-                                <button type="action" target="new" name="cmmi.wizard_add_domain_to_project" string="Add a domain" class="oe_highlight" context="{'project_id': id}" />
+                                <button type="action" target="new" name="%(wizard_add_domain_to_project)d" string="Add a domain" class="oe_highlight" context="{'project_id': id}" />
                                 <field name="domains">
                                     <tree create="false" delete="true" editable="true">
                                         <field name="project_id" invisible="1" />
index 29b5c5d..49ad82a 100644 (file)
@@ -101,18 +101,20 @@ class ProjetDomaineWizard(osv.TransientModel):
             }, context=context)
 
         # Fermer simplement la fenêtre
-        #return {'type': 'ir.actions.act_window_close'}
-
-        # Renvoi vers la vue du modèle
-        return {
-            "type": 'ir.actions.act_window',
-            "res_model": "cmmi.projet",
-            'view_type': 'form',
-            'view_mode': 'form',
-            'res_id': result["project_id"][0],
-            #'target': 'new', = pop-up
-            'context': context,
-        }
+        return {'type': 'ir.actions.act_window_close'}
+
+        #-----------------------------------------------------------------------
+        # # Renvoi vers la vue du modèle
+        # return {
+        #   "type": 'ir.actions.act_window',
+        #   "res_model": "cmmi.projet",
+        #   'view_type': 'form',
+        #   'view_mode': 'form',
+        #   'res_id': result["project_id"][0],
+        #   #'target': 'new', = pop-up
+        #   'context': context,
+        # }
+        #-----------------------------------------------------------------------
 
     _columns = {
         "main": fields.boolean(string="Domaine principal ?"),
index 20d7816..551fa50 100644 (file)
@@ -37,7 +37,7 @@ class ProjetMoaWizard(osv.TransientModel):
             context=context
         )]))
 
-        # recherche des domaines autres que ceux déjà sélectionnés
+        # recherche des moas autres que ceux déjà sélectionnés
         moa_ids = model_base.search(
             cr,
             uid,
@@ -94,16 +94,21 @@ class ProjetMoaWizard(osv.TransientModel):
             "moa_id": result["moa_id"],
             }, context=context)
 
-
-        # Renvoi vers la vue du modèle
-        return {
-            "type": 'ir.actions.act_window',
-            "res_model": "cmmi.projet",
-            'view_type': 'form',
-            'view_mode': 'form',
-            'res_id': result["project_id"][0],
-            'context': context,
-        }
+        # Fermer simplement la fenêtre
+        return {'type': 'ir.actions.act_window_close'}
+
+
+        #-----------------------------------------------------------------------
+        # # Renvoi vers la vue du modèle
+        # return {
+        #    "type": 'ir.actions.act_window',
+        #    "res_model": "cmmi.projet",
+        #    'view_type': 'form',
+        #    'view_mode': 'form',
+        #    'res_id': result["project_id"][0],
+        #    'context': context,
+        # }
+        #-----------------------------------------------------------------------
 
     _columns = {
         "main": fields.boolean(string="MOA principale ?"),
index b5af893..a54168e 100644 (file)
@@ -37,7 +37,7 @@ class ProjetMoeWizard(osv.TransientModel):
             context=context
         )]))
 
-        # recherche des domaines autres que ceux déjà sélectionnés
+        # recherche des moes autres que ceux déjà sélectionnés
         moe_ids = model_base.search(
             cr,
             uid,
@@ -94,16 +94,20 @@ class ProjetMoeWizard(osv.TransientModel):
             "moe_id": result["moe_id"],
             }, context=context)
 
-
-        # Renvoi vers la vue du modèle
-        return {
-            "type": 'ir.actions.act_window',
-            "res_model": "cmmi.projet",
-            'view_type': 'form',
-            'view_mode': 'form',
-            'res_id': result["project_id"][0],
-            'context': context,
-        }
+        # Fermer simplement la fenêtre
+        return {'type': 'ir.actions.act_window_close'}
+
+        #-----------------------------------------------------------------------
+        # # Renvoi vers la vue du modèle
+        # return {
+        #    "type": 'ir.actions.act_window',
+        #    "res_model": "cmmi.projet",
+        #    'view_type': 'form',
+        #    'view_mode': 'form',
+        #    'res_id': result["project_id"][0],
+        #    'context': context,
+        # }
+        #-----------------------------------------------------------------------
 
     _columns = {
         "main": fields.boolean(string="MOE principale ?"),