← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/atp-dev-addons1 into lp:~openerp-dev/openobject-addons/trunk-dev-addons1

 

atp(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/atp-dev-addons1 into lp:~openerp-dev/openobject-addons/trunk-dev-addons1.

Requested reviews:
  Harry (Open ERP) (hmo-tinyerp)
Related bugs:
  #669868 project_planning : Failed to search user, KeyError: 'parent_id'
  https://bugs.launchpad.net/bugs/669868
  #673899 caldav : Calendar Collections : Fields in 'groupby' must appear in the list of fields to read
  https://bugs.launchpad.net/bugs/673899


1)Improve search view of Task hours report of project_timesheet module

2)Improvement for file descriptor close() in document module.

3)Fix parent_id problem of resource model field in document_ics module.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/atp-dev-addons1/+merge/40726
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/atp-dev-addons1.
=== modified file 'document/std_index.py'
--- document/std_index.py	2010-06-27 17:20:19 +0000
+++ document/std_index.py	2010-11-12 14:14:15 +0000
@@ -96,8 +96,13 @@
 
     def _doIndexFile(self,fname):
         fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout
-        return _to_unicode(fp.read())
-
+        try:
+            file_data = _to_unicode(fp.read())
+        finally:
+            fp.close()
+            
+        return file_data
+    
 cntIndex.register(DocIndex())
 
 class DocxIndex(indexer):
@@ -158,7 +163,12 @@
 
     def _doIndexFile(self,fname):
         fp = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE).stdout
-        return _to_unicode( fp.read())
+        try:
+           file_data = _to_unicode( fp.read())
+        finally:
+            fp.close()
+                 
+        return file_data
 
 cntIndex.register(PdfIndex())
 

=== modified file 'document_ftp/wizard/ftp_browse.py'
--- document_ftp/wizard/ftp_browse.py	2010-08-19 11:51:57 +0000
+++ document_ftp/wizard/ftp_browse.py	2010-11-12 14:14:15 +0000
@@ -34,10 +34,12 @@
     def default_get(self, cr, uid, fields, context=None):
         res = {}
         if 'url' in fields:
+            print "fieldsdaas",fields
             user_pool = self.pool.get('res.users')
             current_user = user_pool.browse(cr, uid, uid, context=context)
             data_pool = self.pool.get('ir.model.data')
             aid = data_pool._get_id(cr, uid, 'document_ftp', 'action_document_browse')
+            print "aidddddddd",aid
             aid = data_pool.browse(cr, uid, aid, context=context).res_id
             ftp_url = self.pool.get('ir.actions.url').browse(cr, uid, aid, context=context)
             url = ftp_url.url and ftp_url.url.split('ftp://') or []
@@ -51,6 +53,7 @@
     def browse_ftp(self, cr, uid, ids, context):
         data_id = ids and ids[0] or False
         data = self.browse(cr, uid, data_id, context)
+        print "browseeeeeeeee",data
         final_url = data.url
         return {
         'type': 'ir.actions.act_url',

=== modified file 'document_ics/document_ics_config_wizard.xml'
--- document_ics/document_ics_config_wizard.xml	2010-10-06 16:16:52 +0000
+++ document_ics/document_ics_config_wizard.xml	2010-11-12 14:14:15 +0000
@@ -51,7 +51,8 @@
             <field name="target">new</field>
         </record>
 
-         register configuration wizard
+<!--    register configuration wizard  -->
+         
         <record id="config_wizard_step_case_section_menu" model="ir.actions.todo">
             <field name="action_id" ref="action_view_document_ics_config_directories"/>
             <field name="restart">always</field>

=== modified file 'document_ics/document_view.xml'
--- document_ics/document_view.xml	2010-05-26 08:28:37 +0000
+++ document_ics/document_view.xml	2010-11-12 14:14:15 +0000
@@ -24,7 +24,7 @@
         <field name="inherit_id" ref="view_document_directory_form_1"/>
         <field name="arch" type="xml">
             <field name="report_id" position="replace">
-                <field name="report_id" domain="[('model_id','=',parent.ressource_type_id)]"/>
+                <field name="report_id" domain="[('type', '=', 'ressource'),('model_id','=',parent.ressource_type_id)]"/>
                 <separator string="ICS Calendar" colspan="4"/>
                 <field name="ics_domain"/>
                 <field name="ics_field_ids" colspan="4">

=== modified file 'project_timesheet/report/task_report_view.xml'
--- project_timesheet/report/task_report_view.xml	2010-11-04 14:21:10 +0000
+++ project_timesheet/report/task_report_view.xml	2010-11-12 14:14:15 +0000
@@ -31,17 +31,29 @@
             <field name="arch" type="xml">
             	<search string="Tasks by User">
             		<group colspan="4" col="3">
-	            		<filter icon="terp-go-year" string="This Year" domain="[('year','=',time.strftime('%%Y'))]" />
-	            		<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" />
+                        <filter icon="terp-go-year" string=" Year "
+                            name="year"
+                            domain="[('name','&lt;=', time.strftime('%%Y-%%m-%%d')),('name','&gt;=',time.strftime('%%Y-01-01'))]"
+                            help="Task Hours in current year"/>
+                        <filter icon="terp-go-month" string=" Month "
+                            name="month"
+                            domain="[('name','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('name','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
+                            help="Task Hours in current month"/>
+                        <filter icon="terp-go-month"
+                            string=" Month-1 "
+                            domain="[('name','&lt;=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('name','&gt;=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
+                            help="Task hours of last month"/>            		
 	            		<separator orientation="vertical"/>
-	                    <field name="user_id" select="1" widget="selection"/>
+	                    <field name="user_id"/>
                 	</group>
                 	<newline/>
                 	<group expand="1" string="Group By..." colspan="4" col="3">
-                	    <filter string="User" icon="terp-personal" context="{'group_by':'user_id'}" default="1" />
-                    	<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" />
-                    	<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" />
-                	</group>
+                	    <filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}" default="1" />
+                        <separator orientation="vertical"/>
+                        <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/>
+                        <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/>
+                    </group>
+
             	</search>
             </field>
         </record>
@@ -64,8 +76,7 @@
             <field name="res_model">report.timesheet.task.user</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,graph</field>
-            <field name="context">{"search_default_user_id":uid}</field>
-            <field name="search_view_id" ref="view_report_timesheet_task_user_search"/>
+            <field name="context">{'search_default_month':1, 'search_default_group_user_id':1}</field>
         </record>
         <menuitem id="menu_timesheet_task_user" parent="hr_timesheet.menu_hr_reporting_timesheet"
                     action="action_report_timesheet_task_user" sequence="1"/>


Follow ups