openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #07551
lp:~openerp-dev/openobject-addons/trunk-payroll-contribution-report-psi into lp:~openerp-dev/openobject-addons/trunk-payroll
Purnendu Singh (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-payroll-contribution-report-psi into lp:~openerp-dev/openobject-addons/trunk-payroll.
Requested reviews:
Purnendu Singh (OpenERP) (psi-tinyerp)
qdp (OpenERP) (qdp)
Mustufa Rangwala (Open ERP) (mra-tinyerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-payroll-contribution-report-psi/+merge/61374
Hello,
Add a new rml report on payslip.register object to get details on payslip lines based on register.
Thanks
Purnendu Singh
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-payroll-contribution-report-psi/+merge/61374
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-payroll.
=== modified file 'hr_payroll/__openerp__.py'
--- hr_payroll/__openerp__.py 2011-05-03 12:38:07 +0000
+++ hr_payroll/__openerp__.py 2011-05-27 05:54:23 +0000
@@ -58,6 +58,7 @@
'security/ir.model.access.csv',
'wizard/hr_payroll_employees_detail.xml',
'wizard/hr_payroll_year_salary.xml',
+ 'wizard/hr_payroll_cotribution_register_report.xml',
],
'test': [
# 'test/payslip.yml',
=== modified file 'hr_payroll/hr_payroll.py'
--- hr_payroll/hr_payroll.py 2011-05-26 16:56:10 +0000
+++ hr_payroll/hr_payroll.py 2011-05-27 05:54:23 +0000
@@ -759,16 +759,7 @@
'amount_python_compute':fields.text('Python Code'),
'amount_percentage_base':fields.char('Percentage based on',size=1024, required=False, readonly=False, help='result will be affected to a variable'),
'child_ids':fields.one2many('hr.salary.rule', 'parent_rule_id', 'Child Salary Rule'),
- 'register_id':fields.property(
- 'hr.contribution.register',
- type='many2one',
- relation='hr.contribution.register',
- string="Contribution Register",
- method=True,
- view_load=True,
- help="Contribution register based on company",
- required=False
- ),
+ 'register_id':fields.many2one('hr.contribution.register', 'Contribution Register', help="Contribution register based on company", required=False),
'input_ids': fields.one2many('hr.rule.input', 'input_id', 'Inputs'),
'note':fields.text('Description'),
}
=== modified file 'hr_payroll/hr_payroll_report.xml'
--- hr_payroll/hr_payroll_report.xml 2011-05-24 09:14:17 +0000
+++ hr_payroll/hr_payroll_report.xml 2011-05-27 05:54:23 +0000
@@ -18,5 +18,14 @@
rml="hr_payroll/report/report_payslip_details.rml"
string="PaySlip Details" />
+ <report
+ auto="False"
+ menu="False"
+ id="contribution_register"
+ model="hr.contribution.register"
+ name="contribution.register.lines"
+ rml="hr_payroll/report/report_contribution_register.rml"
+ string="PaySlip Lines By Conribution Register" />
+
</data>
</openerp>
=== modified file 'hr_payroll/report/__init__.py'
--- hr_payroll/report/__init__.py 2011-05-16 09:46:55 +0000
+++ hr_payroll/report/__init__.py 2011-05-27 05:54:23 +0000
@@ -29,5 +29,6 @@
import report_payroll_register
import report_employees_detail
import report_emp_salary_structure
+import report_contribution_register
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added file 'hr_payroll/report/report_contribution_register.py'
--- hr_payroll/report/report_contribution_register.py 1970-01-01 00:00:00 +0000
+++ hr_payroll/report/report_contribution_register.py 2011-05-27 05:54:23 +0000
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# d$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+from datetime import datetime
+from dateutil import relativedelta
+
+from report import report_sxw
+from tools.safe_eval import safe_eval as eval
+
+class contribution_register_report(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(contribution_register_report, self).__init__(cr, uid, name, context)
+ self.localcontext.update({
+ 'get_payslip_lines': self._get_payslip_lines,
+ 'sum_total': self.sum_total,
+ })
+
+ def set_context(self, objects, data, ids, report_type=None):
+ self.date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d'))
+ self.date_to = data['form'].get('date_to', str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10])
+ return super(contribution_register_report, self).set_context(objects, data, ids, report_type=report_type)
+
+ def sum_total(self):
+ return self.regi_total
+
+ def _get_payslip_lines(self, obj):
+ payslip_obj = self.pool.get('hr.payslip')
+ payslip_line = self.pool.get('hr.payslip.line')
+ localdict = {}
+ res = []
+ result = {}
+ self.regi_total = 0.0
+ self.cr.execute("SELECT pl.id, pl.slip_id from hr_payslip_line as pl "\
+ "LEFT JOIN hr_payslip AS hp on (pl.slip_id = hp.id) "\
+ "WHERE (hp.date_from >= %s) AND (hp.date_to <= %s) "\
+ "AND pl.register_id = %s "\
+ "GROUP BY pl.slip_id, pl.sequence, pl.id, pl.category_id "\
+ "ORDER BY pl.sequence",
+ (self.date_from, self.date_to, obj.id))
+ for x in self.cr.fetchall():
+ result.setdefault(x[1], [])
+ result[x[1]].append(x[0])
+ for key, value in result.iteritems():
+ for line in payslip_line.browse(self.cr, self.uid, value):
+ res.append({
+ 'payslip_name': payslip_obj.browse(self.cr, self.uid, [key])[0].name,
+ 'name': line.name,
+ 'code': line.code,
+ 'quantity': line.quantity,
+ 'amount': line.amount,
+ 'total': line.total,
+ })
+ self.regi_total += line.total
+ return res
+
+report_sxw.report_sxw('report.contribution.register.lines', 'hr.contribution.register', 'hr_payroll/report/report_contribution_register.rml', parser=contribution_register_report)
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added file 'hr_payroll/report/report_contribution_register.rml'
--- hr_payroll/report/report_contribution_register.rml 1970-01-01 00:00:00 +0000
+++ hr_payroll/report/report_contribution_register.rml 2011-05-27 05:54:23 +0000
@@ -0,0 +1,224 @@
+<?xml version="1.0"?>
+<document filename="test.pdf">
+ <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
+ <pageTemplate id="first">
+ <frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
+ </pageTemplate>
+ </template>
+ <stylesheet>
+ <blockTableStyle id="Standard_Outline">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table1">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table3">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table4">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table2">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table16">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table5">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <initialize>
+ <paraStyle name="all" alignment="justify"/>
+ </initialize>
+ <paraStyle name="P1" rightIndent="-56.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P3" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P4" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P5" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P7" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P9" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT"/>
+ <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
+ <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
+ <paraStyle name="P12" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P13" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P14" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P15" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT"/>
+ <paraStyle name="P16" fontName="Helvetica" fontSize="2.0" leading="3"/>
+ <paraStyle name="P17" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P18" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P19" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P20" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P21" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT"/>
+ <paraStyle name="Standard" fontName="Helvetica"/>
+ <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="Index" fontName="Helvetica"/>
+ <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_space" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Centre_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Centre_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Bold_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Bold_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Table Contents" fontName="Helvetica"/>
+ <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
+ <paraStyle name="payslip_adj" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <images/>
+ </stylesheet>
+ <story>
+ <para style="P1">[[repeatIn(objects,'o')]]</para>
+ <blockTable colWidths="539.0" style="Table1">
+ <tr>
+ <td>
+ <para style="P6">PaySlip Lines by Contribution Register</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="P7">
+ <font color="white"> </font>
+ </para>
+ <para style="P5">
+ <font color="white"> </font>
+ </para>
+ <para style="P18"/>
+ <blockTable colWidths="254.0,143.0,141.0" style="Table3">
+ <tr>
+ <td>
+ <para style="P19">Register Name</para>
+ </td>
+ <td>
+ <para style="P14">Date From</para>
+ </td>
+ <td>
+ <para style="P20">Date To</para>
+ </td>
+ </tr>
+ </blockTable>
+ <blockTable colWidths="254.0,143.0,141.0" style="Table4">
+ <tr>
+ <td>
+ <para style="P4">[[ o.name or '']]</para>
+ </td>
+ <td>
+ <para style="P4">[[ data['form']['date_from'] or '']]</para>
+ </td>
+ <td>
+ <para style="P4">[[ data['form']['date_to'] or '' ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_Bold_8"/>
+ <para style="terp_default_Bold_8">
+ <font color="white"> </font>
+ </para>
+ <para style="P8">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="194.0,35.0,167.0,46.0,48.0,48.0" style="Table2">
+ <tr>
+ <td>
+ <para style="P9">PaySlip Name</para>
+ </td>
+ <td>
+ <para style="P9">Code</para>
+ </td>
+ <td>
+ <para style="P9">Name</para>
+ </td>
+ <td>
+ <para style="P9">Quantity</para>
+ </td>
+ <td>
+ <para style="P9">Amount</para>
+ </td>
+ <td>
+ <para style="P10">Total </para>
+ </td>
+ </tr>
+ </blockTable>
+ <section>
+ <para style="P2">[[repeatIn(get_payslip_lines(o),'r') ]]</para>
+ <blockTable colWidths="195.0,35.0,166.0,47.0,48.0,48.0" style="Table16">
+ <tr>
+ <td>
+ <para style="P12">[[ r.get('payslip_name', False) ]]<font face="Helvetica">[[ r.get('payslip_name', False) and ( setTag('para','para',{'style':'terp_default_8'})) or removeParentNode('font')]]</font></para>
+ </td>
+ <td>
+ <para style="P2">[[ r['code'] ]]</para>
+ </td>
+ <td>
+ <para style="P2">[[ r['name'] ]]</para>
+ </td>
+ <td>
+ <para style="P2">[[ r['quantity'] ]]</para>
+ </td>
+ <td>
+ <para style="P2">[[ r['amount'] ]]</para>
+ </td>
+ <td>
+ <para style="P3">[[ r['total'] or '0.0']] [[o.company_id and o.company_id.currency_id.symbol or '']]</para>
+ </td>
+ </tr>
+ </blockTable>
+ </section>
+ <blockTable colWidths="465.0,74.0" style="Table5">
+ <tr>
+ <td>
+ <para style="P13">Total:</para>
+ </td>
+ <td>
+ <para style="P11">[[ sum_total() or 0.0]] [[o.company_id and o.company_id.currency_id.symbol or '']]</para>
+ </td>
+ </tr>
+ </blockTable>
+ </story>
+</document>
+
=== added file 'hr_payroll/report/report_contribution_register.sxw'
Binary files hr_payroll/report/report_contribution_register.sxw 1970-01-01 00:00:00 +0000 and hr_payroll/report/report_contribution_register.sxw 2011-05-27 05:54:23 +0000 differ
=== modified file 'hr_payroll/wizard/__init__.py'
--- hr_payroll/wizard/__init__.py 2011-05-12 13:05:43 +0000
+++ hr_payroll/wizard/__init__.py 2011-05-27 05:54:23 +0000
@@ -25,5 +25,6 @@
#import hr_payroll_create_analytic
import hr_payroll_year_salary
import hr_payroll_payslips_by_employees
+import hr_payroll_cotribution_register_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added file 'hr_payroll/wizard/hr_payroll_cotribution_register_report.py'
--- hr_payroll/wizard/hr_payroll_cotribution_register_report.py 1970-01-01 00:00:00 +0000
+++ hr_payroll/wizard/hr_payroll_cotribution_register_report.py 2011-05-27 05:54:23 +0000
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+from datetime import datetime
+from dateutil import relativedelta
+
+from osv import osv, fields
+
+class payslip_lines_contribution_register(osv.osv_memory):
+ _name = 'payslip.lines.contribution.register'
+ _description = 'PaySlip Lines by Contribution Registers'
+ _columns = {
+ 'date_from': fields.date('Date From', required=True),
+ 'date_to': fields.date('Date To', required=True),
+ }
+
+ _defaults = {
+ 'date_from': lambda *a: time.strftime('%Y-%m-01'),
+ 'date_to': lambda *a: str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10],
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, [], context=context)[0]
+ datas = {
+ 'ids': context.get('active_ids', []),
+ 'model': 'hr.contribution.register',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'contribution.register.lines',
+ 'datas': datas,
+ }
+
+payslip_lines_contribution_register()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'hr_payroll/wizard/hr_payroll_cotribution_register_report.xml'
--- hr_payroll/wizard/hr_payroll_cotribution_register_report.xml 1970-01-01 00:00:00 +0000
+++ hr_payroll/wizard/hr_payroll_cotribution_register_report.xml 2011-05-27 05:54:23 +0000
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="view_payslip_lines_contribution_register" model="ir.ui.view">
+ <field name="name">payslip.lines.contribution.register</field>
+ <field name="model">payslip.lines.contribution.register</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Contribution Register's Payslip Lines">
+ <group col="4" colspan="6">
+ <field name="date_from"/>
+ <newline/>
+ <field name="date_to"/>
+ </group>
+ <separator colspan="4"/>
+ <group col="2" colspan="4">
+ <button special="cancel" string="Cancel" icon='gtk-cancel'/>
+ <button name="print_report" string="Print" colspan="1" type="object" icon="gtk-print"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_payslip_lines_contribution_register" model="ir.actions.act_window">
+ <field name="name">PaySlip Lines</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">payslip.lines.contribution.register</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_holidays_summary_employee_value">
+ <field name="model_id" ref="model_hr_contribution_register" />
+ <field name="object" eval="1" />
+ <field name="name">PaySlip Lines</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value" eval="'ir.actions.act_window,' + str(ref('action_payslip_lines_contribution_register'))" />
+ <field name="key">action</field>
+ <field name="model">hr.contribution.register</field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
References