[IMP] removes 'Employee Timesheet' and 'Employees Timesheet' reports in HR reporting (addon hr_timesheet)

bzr revid: ged@openerp.com-20140127132020-qhxgkygxx38vecab
This commit is contained in:
Gery Debongnie 2014-01-27 14:20:20 +01:00
parent 68a466e8a8
commit a584ba9ed2
6 changed files with 0 additions and 212 deletions

View File

@ -49,8 +49,6 @@ up a management by affair.
'hr_timesheet_report.xml',
'hr_timesheet_wizard.xml',
'process/hr_timesheet_process.xml',
'wizard/hr_timesheet_print_employee_view.xml',
'wizard/hr_timesheet_print_users_view.xml',
'wizard/hr_timesheet_sign_in_out_view.xml',
'hr_timesheet_installer.xml',
'hr_timesheet_data.xml'

View File

@ -20,8 +20,6 @@
##############################################################################
import hr_timesheet_sign_in_out
import hr_timesheet_print_employee
import hr_timesheet_print_users
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,66 +0,0 @@
# -*- 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 datetime
from openerp.osv import fields, osv
from openerp.tools.translate import _
class analytical_timesheet_employee(osv.osv_memory):
_name = 'hr.analytical.timesheet.employee'
_description = 'Print Employee Timesheet & Print My Timesheet'
_columns = {
'month': fields.selection([(1,'January'), (2,'February'), (3,'March'), (4,'April'),
(5,'May'), (6,'June'), (7,'July'), (8,'August'), (9,'September'),
(10,'October'), (11,'November'), (12,'December')], 'Month', required=True),
'year': fields.integer('Year', required=True),
'employee_id': fields.many2one('hr.employee', 'Employee', required=True)
}
def _get_user(self, cr, uid, context=None):
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
if not emp_id:
raise osv.except_osv(_("Warning!"), _("Please define employee for this user!"))
return emp_id and emp_id[0] or False
_defaults = {
'month': lambda *a: datetime.date.today().month,
'year': lambda *a: datetime.date.today().year,
'employee_id': _get_user
}
def print_report(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids, context=context)[0]
data['employee_id'] = data['employee_id'][0]
datas = {
'ids': [],
'model': 'hr.employee',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'hr.analytical.timesheet',
'datas': datas,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Print Employee Timesheet -->
<record id="view_hr_timesheet_employee" model="ir.ui.view">
<field name="name">hr.analytical.timesheet.employee.form</field>
<field name="model">hr.analytical.timesheet.employee</field>
<field name="arch" type="xml">
<form string="Monthly Employee Timesheet" version="7.0">
<group colspan="4">
<field name="month"/>
<field name="year"/>
<field name="employee_id" />
</group>
<footer>
<button string="Print" name="print_report" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_hr_timesheet_employee" model="ir.actions.act_window">
<field name="name">Employee Timesheet</field>
<field name="res_model">hr.analytical.timesheet.employee</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_hr_timesheet_employee"/>
<field name="target">new</field>
</record>
<menuitem action="action_hr_timesheet_employee"
id="menu_hr_timesheet_employee"
parent="hr.menu_hr_reporting_timesheet"
sequence="2" icon="STOCK_PRINT"/>
</data>
</openerp>

View File

@ -1,56 +0,0 @@
# -*- 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 datetime
from openerp.osv import fields, osv
class analytical_timesheet_employees(osv.osv_memory):
_name = 'hr.analytical.timesheet.users'
_description = 'Print Employees Timesheet'
_columns = {
'month': fields.selection([(1,'January'), (2,'February'), (3,'March'), (4,'April'),
(5,'May'), (6,'June'), (7,'July'), (8,'August'), (9,'September'),
(10,'October'), (11,'November'), (12,'December')], 'Month', required=True),
'year': fields.integer('Year', required=True),
'employee_ids': fields.many2many('hr.employee', 'timesheet_employee_rel', 'timesheet_id', 'employee_id', 'employees', required=True)
}
_defaults = {
'month': lambda *a: datetime.date.today().month,
'year': lambda *a: datetime.date.today().year,
}
def print_report(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids, context=context)[0]
datas = {
'ids': [],
'model': 'hr.employee',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'hr.analytical.timesheet_users',
'datas': datas,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Print Employees Timesheets -->
<record id="view_hr_timesheet_users" model="ir.ui.view">
<field name="name">hr.analytical.timesheet.users.form</field>
<field name="model">hr.analytical.timesheet.users</field>
<field name="arch" type="xml">
<form string="Monthly Employees Timesheet" version="7.0">
<sheet>
<group>
<label for="month" string="Period"/>
<div>
<field name="month" class="oe_inline"/>
<field name="year" class="oe_inline"/>
</div>
</group>
<group string="Employees">
<field name="employee_ids" nolabel="1"/>
</group>
</sheet>
<footer>
<button string="Print" name="print_report" type="object" class="oe_highlight"/> or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="action_hr_timesheet_users" model="ir.actions.act_window">
<field name="name">Employees Timesheet</field>
<field name="res_model">hr.analytical.timesheet.users</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_hr_timesheet_users"/>
<field name="target">new</field>
</record>
<menuitem action="action_hr_timesheet_users"
id="menu_hr_timesheet_users"
parent="hr.menu_hr_reporting_timesheet"
groups="base.group_hr_manager" sequence="2" icon="STOCK_PRINT"/>
</data>
</openerp>