[FIX] payroll: added missing files for contribution register report wizard forgotten in previous merge prop
bzr revid: qdp-launchpad@openerp.com-20110623095410-fl7kl8iibx0m2yo3
This commit is contained in:
parent
42f835eb93
commit
0600e1334b
|
@ -0,0 +1,55 @@
|
|||
# -*- 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):
|
||||
datas = {
|
||||
'ids': context.get('active_ids', []),
|
||||
'model': 'hr.contribution.register',
|
||||
'form': self.read(cr, uid, ids, [], context=context)[0]
|
||||
}
|
||||
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:
|
|
@ -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="payslip_lines_contribution_register_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>
|
Loading…
Reference in New Issue