diff --git a/addons/hr_timesheet_invoice/__init__.py b/addons/hr_timesheet_invoice/__init__.py index c6d84bbda04..a80615f5c9b 100644 --- a/addons/hr_timesheet_invoice/__init__.py +++ b/addons/hr_timesheet_invoice/__init__.py @@ -21,6 +21,5 @@ import hr_timesheet_invoice import wizard import report -import hr_timesheet_invoice_installer # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_installer.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice_installer.py deleted file mode 100644 index 045019c2fb8..00000000000 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_installer.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -from osv import fields, osv -from tools.translate import _ - -class hr_timesheet_invoice_installer(osv.osv_memory): - _name = "hr.timesheet.invoice.installer" - _description = "Employee Invoice Data" - _columns = { - 'employee_id': fields.many2one('hr.employee', 'Employee', domain="['|',('product_id','=',False),('journal_id','=',False)]" ,required=True), - 'product_id': fields.many2one('product.product', 'Product', domain="[('type','=','service')]"), - 'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal',domain="[('type','=','general')]"), - 'wizard_id': fields.many2one('hr.timesheet.invoice.wizard','Employee', required=True), - } - - -hr_timesheet_invoice_installer() - -class hr_timesheet_invoice_wizard(osv.osv_memory): - _name = "hr.timesheet.invoice.wizard" - _description = "Timesheet Invoice" - _columns = { - 'emp_ids':fields.one2many('hr.timesheet.invoice.installer', 'wizard_id', 'Wizard Reference'), - } - - def default_get(self, cr, uid, fields, context=None): - """ - To get default values for the object. - @param self: The object pointer. - @param cr: A database cursor - @param uid: ID of the user currently logged in - @param fields: List of fields for which we want default values - @param context: A standard dictionary - @return: A dictionary with default values for all field in ``fields`` - """ - if context is None: - context = {} - res = super(hr_timesheet_invoice_wizard, self).default_get(cr, uid, fields, context=context) - emp_obj = self.pool.get('hr.employee') - emp_ids = emp_obj.search(cr, uid, ['|', ('product_id', '=', False), ('journal_id', '=', False)], context=context) - result = [] - for emp in emp_obj.browse(cr, uid, emp_ids, context=context): - result.append({'employee_id': emp.id, 'product_id': emp.product_id.id, 'journal_id': emp.journal_id.id}) - if 'emp_ids' in fields: - res.update({'emp_ids': result}) - return res - - def set_employee_data(self, cr, uid, ids, context=None): - if context is None: - context = {} - hr_obj = self.pool.get('hr.employee') - for emp in self.browse(cr, uid, ids, context=context): - for emp_data in emp.emp_ids: - hr_obj.write(cr, uid, emp_data.employee_id.id, {'name': emp_data.employee_id.name, 'product_id':emp_data.product_id.id or False, 'journal_id':emp_data.journal_id.id or ''}) - return {'type': 'ir.actions.act_window_close'} - -hr_timesheet_invoice_wizard() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_installer_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_installer_view.xml index 780444ea3be..22d12db6ec8 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_installer_view.xml +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_installer_view.xml @@ -1,49 +1,6 @@ - - Define Your Employee's Invoice Data - hr.timesheet.invoice.wizard - form - -
- - - - - - - - - - - - - -