[REM] hr_timesheet_invoice:Remove Define Your Employees Invoice Data config wiz
bzr revid: aag@tinyerp.co.in-20110622065243-5py3bb6o4fr1rotu
This commit is contained in:
parent
5baec6a299
commit
997093f9c8
|
@ -21,6 +21,5 @@
|
||||||
import hr_timesheet_invoice
|
import hr_timesheet_invoice
|
||||||
import wizard
|
import wizard
|
||||||
import report
|
import report
|
||||||
import hr_timesheet_invoice_installer
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
||||||
|
|
|
@ -1,78 +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/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
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:
|
|
|
@ -1,49 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_hr_timesheet_invoice_wizard" model="ir.ui.view">
|
|
||||||
<field name="name">Define Your Employee's Invoice Data</field>
|
|
||||||
<field name="model">hr.timesheet.invoice.wizard</field>
|
|
||||||
<field name="type">form</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<form string="Employee Invoice Data">
|
|
||||||
<field colspan="4" name="emp_ids" nolabel="1" mode="tree,form">
|
|
||||||
<tree string="Employee Invoice Data" editable="bottom">
|
|
||||||
<field name="employee_id"/>
|
|
||||||
<field name="product_id"/>
|
|
||||||
<field name="journal_id"/>
|
|
||||||
</tree>
|
|
||||||
<form string="Employee Invoice Data">
|
|
||||||
<field name="employee_id"/>
|
|
||||||
<field name="product_id"/>
|
|
||||||
<field name="journal_id"/>
|
|
||||||
</form>
|
|
||||||
</field>
|
|
||||||
<separator string="" colspan="4" />
|
|
||||||
<label string="" colspan="2" />
|
|
||||||
<button special="cancel" string="Cancel" icon="gtk-cancel" />
|
|
||||||
<button name="set_employee_data" string="OK" type="object" icon="gtk-ok"/>
|
|
||||||
</form>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_hr_timesheet_invoice_wizard" model="ir.actions.act_window">
|
|
||||||
<field name="name">Define Your Employee's Invoice Data</field>
|
|
||||||
<field name="type">ir.actions.act_window</field>
|
|
||||||
<field name="res_model">hr.timesheet.invoice.wizard</field>
|
|
||||||
<field name="view_type">form</field>
|
|
||||||
<field name="view_mode">form</field>
|
|
||||||
<field name="view_id" ref="view_hr_timesheet_invoice_wizard"/>
|
|
||||||
<field name="target">new</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="hr_timesheet_invoice_todo" model="ir.actions.todo">
|
|
||||||
<field name="action_id" ref="action_hr_timesheet_invoice_wizard"/>
|
|
||||||
<field name="category_id" ref="hr.category_hr_management_config"/>
|
|
||||||
<field name="sequence">3</field>
|
|
||||||
<field name="type">normal</field>
|
|
||||||
<field name="state">skip</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<!-- Configure Your Services Config Wiz -->
|
<!-- Configure Your Services Config Wiz -->
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue