[MERGE] hr_attendacne: Add missing action on employee to print weekly report
bzr revid: mra@mra-laptop-20110210112615-iradv2to27xybtpy
This commit is contained in:
commit
e98148f02f
|
@ -24,9 +24,9 @@ from datetime import datetime
|
|||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
import pooler
|
||||
|
||||
from report.interface import report_rml
|
||||
from report.interface import toxml
|
||||
import tools
|
||||
|
||||
one_week = relativedelta(days=7)
|
||||
num2day = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
|
||||
|
@ -38,7 +38,7 @@ class report_custom(report_rml):
|
|||
|
||||
def create_xml(self, cr, uid, ids, datas, context=None):
|
||||
obj_emp = pooler.get_pool(cr.dbname).get('hr.employee')
|
||||
|
||||
|
||||
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())
|
||||
|
@ -58,7 +58,7 @@ class report_custom(report_rml):
|
|||
<name>%s</name>
|
||||
%%s
|
||||
</user>
|
||||
''' % ustr(toxml(emp['name']))
|
||||
''' % tools.ustr(toxml(emp['name']))
|
||||
while monday != last_monday:
|
||||
#### Work hour calculation
|
||||
sql = '''
|
||||
|
|
|
@ -1,6 +1,40 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_hr_attendance_week" model="ir.ui.view">
|
||||
<field name="name">Attendances Report Weekly</field>
|
||||
<field name="model">hr.attendance.week</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Print Attendance Report Weekly">
|
||||
<field name="init_date"/>
|
||||
<field name="end_date"/>
|
||||
<newline/>
|
||||
<separator colspan="4"/>
|
||||
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
|
||||
<button name="print_report" string="Print" type="object" icon="gtk-print"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_hr_attendance_week" model="ir.actions.act_window">
|
||||
<field name="name">Attendances By Week</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.attendance.week</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="hr_attendance_week_values">
|
||||
<field name="model_id" ref="hr.model_hr_employee" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Attendances By Week</field>
|
||||
<field name="key2">client_print_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_hr_attendance_week'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">hr.employee</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue