Ajay Chauhan(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-addons16_hr-cha into 
lp:openobject-addons.

Requested reviews:
  Purnendu Singh (OpenERP) (psi-tinyerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons16_hr-cha/+merge/129643

Hello,

   I have made changes to fulfill the requirements of addons16 hr issue.

Thanks,
Ajay Chauhan
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons16_hr-cha/+merge/129643
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-addons16_hr-cha.
=== modified file 'hr_attendance/report/attendance_by_month.py'
--- hr_attendance/report/attendance_by_month.py	2012-10-21 19:59:25 +0000
+++ hr_attendance/report/attendance_by_month.py	2012-10-23 12:07:25 +0000
@@ -57,6 +57,7 @@
         if emp_ids:
             for emp in obj_emp.read(cr, uid, emp_ids, ['name']):
                 stop, days_xml = False, []
+                total_wh = 0.0
                 user_repr = '''
                 <user>
                   <name>%s</name>
@@ -92,11 +93,15 @@
                         else:
                             ldt = dt
                     # Week xml representation
+                    total_wh += wh
                     wh = hour2str(wh)
                     today_xml = '<day num="%s"><wh>%s</wh></day>' % ((today - month).days+1, (wh))
                     dy=(today - month).days+1
                     days_xml.append(today_xml)
                     today, tomor = tomor, tomor + one_day
+                total_wh = hour2str(total_wh)
+                today_xml = '<day num="Total"><wh>%s</wh></day>' % (total_wh)
+                days_xml.append(today_xml)
                 user_xml.append(user_repr % '\n'.join(days_xml))
 
         rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee')
@@ -174,8 +179,9 @@
                     cell=cell+x
                     width_dict[j]=x
                 day_diff1=day_diff1-x
+        date_xml += ['<dayy number="Total" cell="Total"/>']
         date_xml.append('</days>')
-        date_xml.append('<cols>3.5cm%s</cols>\n' % (',0.74cm' * (int(dy))))
+        date_xml.append('<cols>3.5cm%s,1.2cm</cols>\n' % (',0.74cm' * (int(dy))))
         xml = '''<?xml version="1.0" encoding="UTF-8" ?>
         <report>
         %s
@@ -183,7 +189,7 @@
         %s
         %s
         </report>
-        ''' % (header_xml,_('Attendances By Month'),'\n'.join(user_xml),date_xml)
+        ''' % (header_xml,_('Attendances by Month'),'\n'.join(user_xml),date_xml)
         return xml
 
 report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl')

=== modified file 'hr_attendance/report/timesheet.py'
--- hr_attendance/report/timesheet.py	2012-10-08 05:10:14 +0000
+++ hr_attendance/report/timesheet.py	2012-10-23 12:07:25 +0000
@@ -20,12 +20,15 @@
 ##############################################################################
 
 
+import time
 from datetime import datetime
 from dateutil.relativedelta import relativedelta
 
 import pooler
 from report.interface import report_rml
 from report.interface import toxml
+from report import report_sxw
+from tools.translate import _
 import tools
 
 one_week = relativedelta(days=7)
@@ -38,7 +41,8 @@
 
     def create_xml(self, cr, uid, ids, datas, context=None):
         obj_emp = pooler.get_pool(cr.dbname).get('hr.employee')
-        ids = datas['active_ids']
+
+        emp_ids = datas['active_ids']
         start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d')
         end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d')
         first_monday = start_date - relativedelta(days=start_date.date().weekday())
@@ -47,9 +51,16 @@
         if last_monday < first_monday:
             first_monday, last_monday = last_monday, first_monday
 
+        rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee')
+        rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
+        header_xml = '''
+        <header>
+        <date>%s</date>
+        <company>%s</company>
+        </header>
+        ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)
         user_xml = []
-
-        for employee_id in ids:
+        for employee_id in emp_ids:
             emp = obj_emp.read(cr, uid, [employee_id], ['id', 'name'])[0]
             monday, n_monday = first_monday, first_monday + one_week
             stop, week_xml = False, []
@@ -103,12 +114,13 @@
 
                 monday, n_monday = n_monday, n_monday + one_week
             user_xml.append(user_repr % '\n'.join(week_xml))
-
         xml = '''<?xml version="1.0" encoding="UTF-8" ?>
         <report>
         %s
+        <title>%s</title>
+        %s
         </report>
-        ''' % '\n'.join(user_xml)
+        ''' % (header_xml,_('Attendances by Week'),'\n'.join(user_xml))
         xml = tools.ustr(xml).encode('utf8')
         return self.post_process_xml_data(cr, uid, xml, context)
 

=== modified file 'hr_attendance/report/timesheet.xsl'
--- hr_attendance/report/timesheet.xsl	2011-01-14 00:11:01 +0000
+++ hr_attendance/report/timesheet.xsl	2012-10-23 12:07:25 +0000
@@ -3,12 +3,15 @@
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
     xmlns:fo="http://www.w3.org/1999/XSL/Format";>
 
+    <xsl:import href="hr_custom_default.xsl"/>
+    <xsl:import href="hr_custom_rml.xsl"/>
+
 	<xsl:template match="/">
         <xsl:call-template name="rml" />
     </xsl:template>
 
 
-    <xsl:template name="rml">
+    <xsl:template name="stylesheet">
 		<document filename="timesheet.pdf">
 			<template pageSize="29.7cm,21cm" leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Timesheets" author="Generated by Open ERP, Fabien Pinckaers" allowSplitting="20">
 				<pageTemplate id="first">
@@ -20,6 +23,7 @@
 			</template>
 			
 			<stylesheet>
+			   <paraStyle name="title" fontName="Helvetica-Bold" fontSize="15.0" leading="17" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
 		       <blockTableStyle id="week">
 		           <blockFont name="Helvetica-BoldOblique" size="12" start="0,0" stop="-1,0"/>
 		           <blockBackground colorName="grey" start="0,0" stop="-1,0"/>
@@ -36,9 +40,19 @@
     </xsl:template>
 
     <xsl:template name="story">
+        <spacer length="1cm" />
+        <xsl:apply-templates select="report/title"/>
+        <spacer length="1cm" />
         <xsl:apply-templates select="report/user"/>
     </xsl:template>
 
+    <xsl:template match="title">
+        <para style="title">
+            <xsl:value-of select="."/>
+        </para>
+        <spacer length="1cm"/>
+    </xsl:template>
+
     <xsl:template match="user">
         <para>
             <b>Name:</b>

=== modified file 'hr_holidays/hr_holidays_view.xml'
--- hr_holidays/hr_holidays_view.xml	2012-10-12 05:51:06 +0000
+++ hr_holidays/hr_holidays_view.xml	2012-10-23 12:07:25 +0000
@@ -46,7 +46,7 @@
                     <field name="date_from"/>
                     <separator/>
                     <filter icon="terp-check" domain="[('state','=','draft')]" string="To Confirm"/>
-                    <filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve" name="approve"/>
+                    <filter icon="terp-camera_test" domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="approve"/>
                     <filter icon="terp-camera_test" domain="[('state','=','validate')]" string="Validated" name="validated"/>
                     <separator/>
                     <filter icon="terp-go-year" name="year" string="Year" domain="[('holiday_status_id.active','=',True)]" help="Filters only on allocations and requests that belong to an holiday type that is 'active' (active field is True)"/>

=== modified file 'hr_recruitment/hr_recruitment.py'
--- hr_recruitment/hr_recruitment.py	2012-10-10 12:41:15 +0000
+++ hr_recruitment/hr_recruitment.py	2012-10-23 12:07:25 +0000
@@ -235,7 +235,6 @@
         'email_from': lambda s, cr, uid, c: s._get_default_email(cr, uid, c),
         'stage_id': lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c),
         'department_id': lambda s, cr, uid, c: s._get_default_department_id(cr, uid, c),
-        'priority': lambda *a: '',
         'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'hr.applicant', context=c),
         'color': 0,
     }

=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
--- hr_timesheet_sheet/hr_timesheet_sheet.py	2012-10-21 19:59:25 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet.py	2012-10-23 12:07:25 +0000
@@ -151,7 +151,7 @@
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id:
                 raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product, like \'Consultant\'.'))
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id:
-                raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal, like \'Timesheet\'.'))
+                raise osv.except_osv(_('Configuration Error!'), _('In order to create a timesheet for this employee, you must assign an analytic journal to the employee, like \'Timesheet Journal\'.'))
         return super(hr_timesheet_sheet, self).create(cr, uid, vals, *args, **argv)
 
     def write(self, cr, uid, ids, vals, *args, **argv):
@@ -164,7 +164,7 @@
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id:
                 raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product.'))
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id:
-                raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal.'))
+                raise osv.except_osv(_('Configuration Error!'), _('In order to create a timesheet for this employee, you must assign an analytic journal to the employee, like \'Timesheet Journal\'.'))
         return super(hr_timesheet_sheet, self).write(cr, uid, ids, vals, *args, **argv)
 
     def button_confirm(self, cr, uid, ids, context=None):

_______________________________________________
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