Sanjay Gohel (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-project-gallery-apa-view-improvements-sgo
 into lp:~openerp-dev/openobject-addons/trunk-project-gallery-apa.

Requested reviews:
  Amit Patel (OpenERP) (apa-tiny)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-project-gallery-apa-view-improvements-sgo/+merge/105045

hello sir

I have made following changes.

1. Remove open_task open_issue and open_phase method as it no longer required 
and set action as per required.
2. Remove default value of that methods.

Thank You.
SGO
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-project-gallery-apa-view-improvements-sgo/+merge/105045
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-project-gallery-apa.
=== modified file 'project/project.py'
--- project/project.py	2012-05-07 12:57:08 +0000
+++ project/project.py	2012-05-08 09:29:22 +0000
@@ -203,6 +203,9 @@
         'color': fields.integer('Color Index'),
         'company_uom_id': fields.related('company_id', 'project_time_mode_id', type='many2one', relation='product.uom'),
      }
+    
+    def dummy(self, cr, uid,ids,context):
+        return False   
          
     def _get_type_common(self, cr, uid, context):
         ids = self.pool.get('project.task.type').search(cr, uid, [('project_default','=',1)], context=context)

=== modified file 'project/static/src/js/project.js'
--- project/static/src/js/project.js	2012-05-07 12:57:08 +0000
+++ project/static/src/js/project.js	2012-05-08 09:29:22 +0000
@@ -16,7 +16,6 @@
                     });
                  });
                 
-                
                 // set sequence like Tasks,Issues,Timesheets and Phases
                 my_list = $("#list a")
                 my_list.sort(function (a, b) {
@@ -26,8 +25,16 @@
                   });
                 $('#list').replaceWith(my_list);
                 
-                //if task is true , then open the task when click on the anywhere in the box.
-                if(this.record.use_tasks.raw_value)$(this.$element).find('.click_button').attr('data-name',my_list[0].getAttribute('data-name'));
+                //it opens action in sequence which ever is first.
+                if (my_list.length!=0){
+                	$(this.$element).find('.click_button').attr('data-name',my_list[0].getAttribute('data-name'));
+                }
+                else{
+                	$(this.$element).find('.click_button').attr('data-name','dummy');
+                }
+                if(isNaN(parseInt($(this.$element).find('.click_button').attr('data-name')))){
+                	$(this.$element).find('.click_button').attr('data-type',"object")
+                }
                 
                 /* set background color.
                   we can do other way to implement new widget.

=== modified file 'project_issue/__openerp__.py'
--- project_issue/__openerp__.py	2012-04-06 08:29:37 +0000
+++ project_issue/__openerp__.py	2012-05-08 09:29:22 +0000
@@ -64,7 +64,6 @@
     'installable': True,
     'auto_install': False,
     'application': True,
-    'js': ['static/src/js/project_issue.js'],
     'certificate' : '001236490750848623845',
 }
 

=== modified file 'project_issue/project_issue.py'
--- project_issue/project_issue.py	2012-05-07 10:07:42 +0000
+++ project_issue/project_issue.py	2012-05-08 09:29:22 +0000
@@ -536,28 +536,6 @@
         'use_issues' : True,
     }
 
-    def open_issues(self, cr, uid, ids, context=None):
-        #Open the View for the Tasks for the project
-        """
-        This opens Issues views
-        @return :Dictionary value for issue view
-        """
-        if context is None:
-            context = {}
-        if ids:
-            context = dict(context, search_default_project_id=ids[0])
-        return {
-            'name': _('Issue'),
-            'view_type': 'form',
-            'view_mode': 'kanban,tree,calendar,form',
-            'res_model': 'project.issue',
-            'view_id': False,
-            'domain':[('project_id','in',ids)],
-            'context': context,
-            'type': 'ir.actions.act_window',
-            'nodestroy': True
-        }
-
     def _check_escalation(self, cr, uid, ids, context=None):
         project_obj = self.browse(cr, uid, ids[0], context=context)
         if project_obj.project_escalation_id:

=== modified file 'project_issue/project_issue_menu.xml'
--- project_issue/project_issue_menu.xml	2012-04-09 05:17:14 +0000
+++ project_issue/project_issue_menu.xml	2012-05-08 09:29:22 +0000
@@ -45,16 +45,6 @@
         <field name="act_window_id" ref="project_issue_categ_act0"/>
     </record>
 
-    <act_window
-            context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"
-            id="act_project_project_2_project_issue_all"
-            name="Issues"
-            res_model="project.issue"
-            src_model="project.project"
-            view_mode="tree,form,calendar,graph"
-            view_type="form"/>
-
-
     <menuitem name="Issues" id="menu_project_issue_track"  parent="project.menu_project_management"
             action="project_issue_categ_act0" sequence="15"/>
 </data>

=== modified file 'project_issue/project_issue_view.xml'
--- project_issue/project_issue_view.xml	2012-05-07 07:20:49 +0000
+++ project_issue/project_issue_view.xml	2012-05-08 09:29:22 +0000
@@ -334,6 +334,15 @@
                 </search>
             </field>
         </record>
+        
+            <act_window
+            context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"
+            id="act_project_project_2_project_issue_all"
+            name="Issues"
+            res_model="project.issue"
+            src_model="project.project"
+            view_mode="kanban,tree,form,calendar,graph"
+            view_type="form"/>
 
     # ------------------------------------------------------
     # Project
@@ -367,7 +376,7 @@
                 </field>
                 <xpath expr="//div[@id='list']" position="inside">
                     <t t-if="record.use_issues.raw_value">
-                        <a id="2" name="open_issues" class="oe_project_buttons" type="object"><t t-if="record.issue_count.value &lt;= 1">Issue</t><t t-if="record.issue_count.value > 1">Issues</t>(<t t-esc="record.issue_count.value"/>)</a>
+                        <a id="2" name="%(act_project_project_2_project_issue_all)d" class="oe_project_buttons" type="action"><t t-if="record.issue_count.value &lt;= 1">Issue</t><t t-if="record.issue_count.value > 1">Issues</t>(<t t-esc="record.issue_count.value"/>)</a>
                     </t>
                 </xpath>
             </field>

=== removed file 'project_issue/static/src/img/issue_icon.png'
Binary files project_issue/static/src/img/issue_icon.png	2012-03-28 09:46:54 +0000 and project_issue/static/src/img/issue_icon.png	1970-01-01 00:00:00 +0000 differ
=== removed directory 'project_issue/static/src/js'
=== removed file 'project_issue/static/src/js/project_issue.js'
--- project_issue/static/src/js/project_issue.js	2012-05-07 07:20:49 +0000
+++ project_issue/static/src/js/project_issue.js	1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
-openerp.project_issue = function(openerp) {
-    openerp.web_kanban.ProjectIssueKanban = openerp.web_kanban.KanbanRecord.include({
-        bind_events: function() {
-            self = this;
-            self._super();
-            if(this.view.dataset.model == 'project.project') {
-	        if(this.record.use_tasks.raw_value && this.record.use_issues.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
-	        if(!this.record.use_tasks.raw_value && this.record.use_issues.raw_value)$(this.$element).find('.click_button').attr('data-name','open_issues');
-            };
-            	
-        }
-    });
-}

=== modified file 'project_long_term/project_long_term.py'
--- project_long_term/project_long_term.py	2012-05-07 10:07:42 +0000
+++ project_long_term/project_long_term.py	2012-05-08 09:29:22 +0000
@@ -234,28 +234,7 @@
     _defaults = {
         'use_phases' : True,
     }
-    def open_phase(self, cr, uid, ids, context=None):
-        #Open the View for the Tasks for the project
-        """
-        This opens Tasks views
-        @return :Dictionary value for task view
-        """
-        if context is None:
-            context = {}
-        if ids:
-            context = dict(context, search_default_project_id=ids[0])
-        return {
-                'name': _('Phase'),
-                'view_type': 'form',
-                'view_mode': 'tree,calendar,form',
-                'res_model': 'project.phase',
-                'view_id': False,
-                'domain':[('project_id','in',ids)],
-                'context': context,
-                'type': 'ir.actions.act_window',
-                'nodestroy': True
-            }
-    
+        
     def schedule_phases(self, cr, uid, ids, context=None):
         context = context or {}
         if type(ids) in (long, int,):

=== modified file 'project_long_term/project_long_term_view.xml'
--- project_long_term/project_long_term_view.xml	2012-05-07 07:20:49 +0000
+++ project_long_term/project_long_term_view.xml	2012-05-08 09:29:22 +0000
@@ -110,6 +110,16 @@
             </field>
         </record>
         
+        <act_window
+	        context="{'search_default_project_id': active_id, 'default_project_id': active_id}"
+	        id="act_project_phases"
+	        name="Phases"
+	        res_model="project.phase"
+	        src_model="project.project"
+	        view_mode="tree,form"
+	        view_type="form"
+        />
+        
         <record id="view_project_kanban_phase" model="ir.ui.view">
             <field name="name">project.project.kanban.inherited</field>
             <field name="model">project.project</field>
@@ -122,7 +132,7 @@
                 </field>
                 <xpath expr="//div[@id='list']" position="inside">
                     <t t-if="record.use_phases.raw_value">
-                        <a id="4" name="open_phase" class="oe_project_buttons" type="object"><t t-if="record.phase_count.value &lt;= 1">Phase</t><t t-if="record.phase_count.value > 1">Phases</t>(<t t-esc="record.phase_count.value"/>)</a>
+                        <a id="4" name="%(act_project_phases)d" class="oe_project_buttons" type="action"><t t-if="record.phase_count.value &lt;= 1">Phase</t><t t-if="record.phase_count.value > 1">Phases</t>(<t t-esc="record.phase_count.value"/>)</a>
                     </t>
                 </xpath>
             </field>
@@ -357,16 +367,6 @@
         view_mode="tree,form"
         />
 
-    <act_window
-        context="{'search_default_project_id': active_id, 'default_project_id': active_id}"
-        id="act_project_phases"
-        name="Phases"
-        res_model="project.phase"
-        src_model="project.project"
-        view_mode="tree,form"
-        view_type="form"
-        />
-
     # ------------------------------------------------------
     # Menu Items
     # ------------------------------------------------------

=== removed directory 'project_long_term/static'
=== removed directory 'project_long_term/static/src'
=== removed directory 'project_long_term/static/src/img'
=== removed file 'project_long_term/static/src/img/phases_icon.jpg'
Binary files project_long_term/static/src/img/phases_icon.jpg	2012-03-28 07:51:47 +0000 and project_long_term/static/src/img/phases_icon.jpg	1970-01-01 00:00:00 +0000 differ
=== modified file 'project_timesheet/__openerp__.py'
--- project_timesheet/__openerp__.py	2012-04-06 08:37:27 +0000
+++ project_timesheet/__openerp__.py	2012-05-08 09:29:22 +0000
@@ -44,7 +44,6 @@
     ],
     'installable': True,
     'auto_install': False,
-    'js': ['static/src/js/project_timesheet.js'],
     'certificate': '0075123647453',
 }
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== removed directory 'project_timesheet/static'
=== removed directory 'project_timesheet/static/src'
=== removed directory 'project_timesheet/static/src/img'
=== removed file 'project_timesheet/static/src/img/timesheet_icon.png'
Binary files project_timesheet/static/src/img/timesheet_icon.png	2012-03-28 09:46:54 +0000 and project_timesheet/static/src/img/timesheet_icon.png	1970-01-01 00:00:00 +0000 differ
=== removed directory 'project_timesheet/static/src/js'
=== removed file 'project_timesheet/static/src/js/project_timesheet.js'
--- project_timesheet/static/src/js/project_timesheet.js	2012-05-07 07:20:49 +0000
+++ project_timesheet/static/src/js/project_timesheet.js	1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
-openerp.project_timesheet = function(openerp) {
-    openerp.web_kanban.ProjectTimeSheetKanban = openerp.web_kanban.KanbanRecord.include({
-        bind_events: function() {
-            self = this;
-            self._super();
-            if(this.view.dataset.model == 'project.project') {
-            	function include(arr, obj) {
-		    for(var i=0; i<arr.length; i++) {
-			if (arr[i] == obj) return true;
-		    }
-		}
-            	if(include(this.view.fields_keys,"issues"))
-            	{
-            	    if(!this.record.use_tasks.raw_value && !this.record.use_issues.raw_value && this.record.use_timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_timesheets');
-            	};
-            	if(this.record.use_tasks.raw_value && this.record.use_timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
-            };
-        }
-    });
-}

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to