[IMP]: improve the hr_payroll module make it fully independent of account and hr_expanse module
Accounting functionalities to payroll will be added by the hr_payroll_account module. bzr revid: mga@tinyerp.com-20101006124454-t1vgn6879dnu62ou
This commit is contained in:
parent
11ad651b0c
commit
15792bb9fa
|
@ -37,10 +37,8 @@
|
|||
'website':'http://www.openerp.com',
|
||||
'depends': [
|
||||
'hr',
|
||||
'account',
|
||||
'hr_contract',
|
||||
'hr_holidays',
|
||||
'hr_expense'
|
||||
'hr_holidays'
|
||||
],
|
||||
'init_xml': [
|
||||
],
|
||||
|
@ -52,15 +50,14 @@
|
|||
'hr_paroll_report.xml',
|
||||
'hr_payroll_data.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/hr_payroll_create_analytic.xml',
|
||||
'wizard/hr_payroll_employees_detail.xml',
|
||||
'wizard/hr_payroll_year_salary.xml',
|
||||
],
|
||||
'test': [
|
||||
'test/payslip.yml',
|
||||
'test/payment_advice.yml',
|
||||
'test/payroll_register.yml',
|
||||
'test/hr_payroll_report.yml',
|
||||
# 'test/payslip.yml',
|
||||
# 'test/payment_advice.yml',
|
||||
# 'test/payroll_register.yml',
|
||||
# 'test/hr_payroll_report.yml',
|
||||
],
|
||||
'demo_xml': [
|
||||
'hr_payroll_demo.xml'
|
||||
|
|
|
@ -21,15 +21,15 @@
|
|||
##############################################################################
|
||||
|
||||
import time
|
||||
from datetime import date, datetime, timedelta
|
||||
import netsvc
|
||||
from datetime import date
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
from tools import config
|
||||
from tools.translate import _
|
||||
|
||||
|
||||
|
||||
def prev_bounds(cdate=False):
|
||||
when = date.fromtimestamp(time.mktime(time.strptime(cdate,"%Y-%m-%d")))
|
||||
this_first = date(when.year, when.month, 1)
|
||||
|
@ -64,7 +64,6 @@ class hr_passport(osv.osv):
|
|||
|
||||
_name = 'hr.passport'
|
||||
_description = 'Passport Detail'
|
||||
|
||||
_columns = {
|
||||
'employee_id':fields.many2one('hr.employee', 'Employee', required=True),
|
||||
'name':fields.char('Passport No', size=64, required=True, readonly=False),
|
||||
|
@ -75,6 +74,9 @@ class hr_passport(osv.osv):
|
|||
'contracts_ids':fields.one2many('hr.contract', 'passport_id', 'Contracts', required=False, readonly=True),
|
||||
'note': fields.text('Description'),
|
||||
}
|
||||
_sql_constraints = [
|
||||
('passport_no_uniq', 'unique (employee_id, name)', 'The Passport No must be unique !'),
|
||||
]
|
||||
hr_passport()
|
||||
|
||||
class hr_payroll_structure(osv.osv):
|
||||
|
@ -84,15 +86,13 @@ class hr_payroll_structure(osv.osv):
|
|||
- Allowlance
|
||||
- Deductions
|
||||
"""
|
||||
|
||||
|
||||
_name = 'hr.payroll.structure'
|
||||
_description = 'Salary Structure'
|
||||
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=256, required=True, readonly=False),
|
||||
'code':fields.char('Code', size=64, required=True, readonly=False),
|
||||
'line_ids':fields.one2many('hr.payslip.line', 'function_id', 'Salary Structure', required=False),
|
||||
'account_id':fields.many2one('account.analytic.account', 'Analytic Account', required=False),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'note': fields.text('Description'),
|
||||
}
|
||||
|
@ -136,8 +136,7 @@ class hr_contract(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'permit_no':fields.char('Work Permit No', size=256, required=False, readonly=False),
|
||||
# 'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
|
||||
'passport_id':fields.char('Passport',size=64, required=False),
|
||||
'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
|
||||
'visa_no':fields.char('Visa No', size=64, required=False, readonly=False),
|
||||
'visa_expire': fields.date('Visa Expire Date'),
|
||||
'struct_id' : fields.many2one('hr.payroll.structure', 'Salary Structure'),
|
||||
|
@ -146,14 +145,6 @@ class hr_contract(osv.osv):
|
|||
_defaults = {
|
||||
'working_days_per_week': lambda *a: 5,
|
||||
}
|
||||
|
||||
def on_change_employee_id(self, cr, uid, ids, employee_id):
|
||||
v = {}
|
||||
passport = self.pool.get('hr.employee').browse(cr, uid, employee_id).passport_id
|
||||
if passport:
|
||||
v['passport_id'] = passport
|
||||
return {'value': v}
|
||||
|
||||
hr_contract()
|
||||
|
||||
class payroll_register(osv.osv):
|
||||
|
@ -198,16 +189,14 @@ class payroll_register(osv.osv):
|
|||
('done','Paid Salary'),
|
||||
('cancel','Reject'),
|
||||
],'State', select=True, readonly=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Expanse Journal', required=True),
|
||||
'bank_journal_id': fields.many2one('account.journal', 'Bank Journal', required=True),
|
||||
'active':fields.boolean('Active', required=False),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
|
||||
'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, 4)),
|
||||
'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits=(16, 4)),
|
||||
'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits=(16, 4)),
|
||||
'deduction': fields.function(_calculate, method=True, store=True, multi='dc', string='Deduction', digits=(16, 4)),
|
||||
'note': fields.text('Description'),
|
||||
'bank_id':fields.many2one('res.bank', 'Bank', required=False, help="Select the Bank Address from whcih the salary is going to be paid"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
@ -228,8 +217,7 @@ class payroll_register(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
|
||||
vals = self.browse(cr, uid, ids, context=context)[0]
|
||||
|
||||
vals = self.browse(cr, uid, ids[0], context=context)
|
||||
emp_ids = emp_pool.search(cr, uid, [], context=context)
|
||||
|
||||
for emp in emp_pool.browse(cr, uid, emp_ids, context=context):
|
||||
|
@ -245,8 +233,6 @@ class payroll_register(osv.osv):
|
|||
'register_id':ids[0],
|
||||
'name':vals.name,
|
||||
'date':vals.date,
|
||||
'journal_id':vals.journal_id.id,
|
||||
'bank_journal_id':vals.bank_journal_id.id
|
||||
}
|
||||
slip_id = slip_pool.create(cr, uid, res, context=context)
|
||||
wf_service.trg_validate(uid, 'hr.payslip', slip_id, 'compute_sheet', cr)
|
||||
|
@ -283,26 +269,22 @@ class payroll_register(osv.osv):
|
|||
wf_service = netsvc.LocalService("workflow")
|
||||
for sid in sids:
|
||||
wf_service.trg_validate(uid, 'hr.payslip', sid, 'final_verify_sheet', cr)
|
||||
|
||||
|
||||
company_name = users_pool.browse(cr, uid, uid, context=context).company_id.name
|
||||
for reg in self.browse(cr, uid, ids, context=context):
|
||||
accs = {}
|
||||
advice = {
|
||||
'name': 'Payment Advice from %s' % (company_name),
|
||||
'number': sequence_pool.get(cr, uid, 'payment.advice'),
|
||||
'register_id':reg.id
|
||||
}
|
||||
pid = advice_pool.create(cr, uid, advice, context=context)
|
||||
|
||||
for slip in reg.line_ids:
|
||||
pid = False
|
||||
if accs.get(slip.employee_id.property_bank_account.code, False) == False:
|
||||
advice = {
|
||||
'name': 'Payment Advice from %s / Bank Account %s' % (users_pool.browse(cr, uid, uid, context=context).company_id.name, slip.employee_id.property_bank_account.name),
|
||||
'number': sequence_pool.get(cr, uid, 'payment.advice'),
|
||||
'register_id':reg.id,
|
||||
'account_id':slip.employee_id.property_bank_account.id
|
||||
}
|
||||
pid = advice_pool.create(cr, uid, advice, context=context)
|
||||
accs[slip.employee_id.property_bank_account.code] = pid
|
||||
else:
|
||||
pid = accs[slip.employee_id.property_bank_account.code]
|
||||
|
||||
if not slip.employee_id.bank_account_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please define bank account for the %s employee' % (slip.employee_id.name)))
|
||||
pline = {
|
||||
'advice_id':pid,
|
||||
'name':slip.employee_id.identification_id,
|
||||
'name':slip.employee_id.bank_account_id.acc_number,
|
||||
'employee_id':slip.employee_id.id,
|
||||
'amount':slip.other_pay + slip.net,
|
||||
'bysal':slip.net
|
||||
|
@ -332,17 +314,6 @@ class payroll_advice(osv.osv):
|
|||
_name = 'hr.payroll.advice'
|
||||
_description = 'Bank Advice Note'
|
||||
|
||||
def _get_bank(self, cr, uid, ids, field_name, args, context=None):
|
||||
res = {}
|
||||
if context is None:
|
||||
context = {}
|
||||
for rec in self.browse(cr, uid, ids, context=context):
|
||||
if rec.company_id and rec.company_id.partner_id.bank_ids:
|
||||
res[rec.id] = rec.company_id.partner_id.bank_ids[0].bank.name
|
||||
else:
|
||||
res[rec.id] = ''
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'register_id':fields.many2one('hr.payroll.register', 'Payroll Register', required=False),
|
||||
'name':fields.char('Name', size=2048, required=True, readonly=False),
|
||||
|
@ -356,11 +327,9 @@ class payroll_advice(osv.osv):
|
|||
'number':fields.char('Number', size=64, required=False, readonly=True),
|
||||
'line_ids':fields.one2many('hr.payroll.advice.line', 'advice_id', 'Employee Salary', required=False),
|
||||
'chaque_nos':fields.char('Chaque Nos', size=256, required=False, readonly=False),
|
||||
'account_id': fields.many2one('account.account', 'Account', required=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'bank': fields.function(_get_bank, method=True, string='Bank', type="char"),
|
||||
'bank_id': fields.related('register_id','bank_id', type='many2one', relation='res.bank', string='Bank', help="Select the Bank Address from whcih the salary is going to be paid"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'state': lambda *a: 'draft',
|
||||
|
@ -398,8 +367,6 @@ class payroll_advice(osv.osv):
|
|||
return {
|
||||
'value':res
|
||||
}
|
||||
|
||||
|
||||
payroll_advice()
|
||||
|
||||
class payroll_advice_line(osv.osv):
|
||||
|
@ -447,48 +414,29 @@ class contrib_register(osv.osv):
|
|||
_name = 'hr.contibution.register'
|
||||
_description = 'Contribution Register'
|
||||
|
||||
def _total_contrib(self, cr, uid, ids, field_names, arg, context=None):
|
||||
def _total_contrib(self, cr, uid, ids, field_names, arg, context={}):
|
||||
line_pool = self.pool.get('hr.contibution.register.line')
|
||||
if context is None:
|
||||
context = {}
|
||||
period_id = self.pool.get('account.period').search(cr,uid,[('date_start','<=',time.strftime('%Y-%m-%d')),('date_stop','>=',time.strftime('%Y-%m-%d'))], context=context)[0]
|
||||
fiscalyear_id = self.pool.get('account.period').browse(cr, uid, period_id, context=context).fiscalyear_id
|
||||
|
||||
res = {}
|
||||
for cur in self.browse(cr, uid, ids, context=context):
|
||||
current = line_pool.search(cr, uid, [('period_id','=',period_id),('register_id','=',cur.id)], context=context)
|
||||
years = line_pool.search(cr, uid, [('period_id.fiscalyear_id','=',fiscalyear_id.id), ('register_id','=',cur.id)], context=context)
|
||||
|
||||
current = line_pool.search(cr, uid, [('register_id','=',cur.id)], context=context)
|
||||
e_month = 0.0
|
||||
c_month = 0.0
|
||||
for i in line_pool.browse(cr, uid, current, context=context):
|
||||
e_month += i.emp_deduction
|
||||
c_month += i.comp_deduction
|
||||
|
||||
e_year = 0.0
|
||||
c_year = 0.0
|
||||
for j in line_pool.browse(cr, uid, years, context=context):
|
||||
e_year += i.emp_deduction
|
||||
c_year += i.comp_deduction
|
||||
|
||||
res[cur.id]={
|
||||
'monthly_total_by_emp':e_month,
|
||||
'monthly_total_by_comp':c_month,
|
||||
'yearly_total_by_emp':e_year,
|
||||
'yearly_total_by_comp':c_year
|
||||
}
|
||||
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'account_id': fields.many2one('account.account', 'Account', required=True),
|
||||
'analytic_account_id':fields.many2one('account.analytic.account', 'Analytic Account', required=False),
|
||||
'name':fields.char('Name', size=256, required=True, readonly=False),
|
||||
'register_line_ids':fields.one2many('hr.contibution.register.line', 'register_id', 'Register Line', readonly=True),
|
||||
'yearly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Employee', digits=(16, 4)),
|
||||
'yearly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Company', digits=(16, 4)),
|
||||
'monthly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Employee', digits=(16, 4)),
|
||||
'monthly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Company', digits=(16, 4)),
|
||||
'monthly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', string='Total By Employee', digits=(16, 4)),
|
||||
'monthly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', string='Total By Company', digits=(16, 4)),
|
||||
'note': fields.text('Description'),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -518,11 +466,14 @@ class contrib_register_line(osv.osv):
|
|||
'register_id':fields.many2one('hr.contibution.register', 'Register', required=False),
|
||||
'code':fields.char('Code', size=64, required=False, readonly=False),
|
||||
'employee_id':fields.many2one('hr.employee', 'Employee', required=True),
|
||||
'period_id': fields.many2one('account.period', 'Period'),
|
||||
'date': fields.date('Date'),
|
||||
'emp_deduction': fields.float('Employee Deduction', digits=(16, 4)),
|
||||
'comp_deduction': fields.float('Company Deduction', digits=(16, 4)),
|
||||
'total': fields.function(_total, method=True, store=True, string='Total', digits=(16, 4)),
|
||||
}
|
||||
_defaults = {
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
contrib_register_line()
|
||||
|
||||
class payment_category(osv.osv):
|
||||
|
@ -605,8 +556,8 @@ class company_contribution(osv.osv):
|
|||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
}
|
||||
|
||||
def execute_function(self, cr, uid, id, value, context=None):
|
||||
|
||||
def _execute_function(self, cr, uid, id, value, context=None):
|
||||
"""
|
||||
self: pointer to self object
|
||||
cr: cursor to database
|
||||
|
@ -624,7 +575,16 @@ class company_contribution(osv.osv):
|
|||
else:
|
||||
res = line_pool.browse(cr, uid, ids, context=context)[0].value
|
||||
return res
|
||||
|
||||
|
||||
def compute(self, cr, uid, id, value, context={}):
|
||||
contrib = self.browse(cr, uid, id, context)
|
||||
if contrib.amount_type == 'fix':
|
||||
return contrib.contribute_per
|
||||
elif contrib.amount_type == 'per':
|
||||
return value * contrib.contribute_per
|
||||
elif contrib.amount_type == 'func':
|
||||
return self._execute_function(cr, uid, id, value, context)
|
||||
return 0.0
|
||||
company_contribution()
|
||||
|
||||
class company_contribution_line(osv.osv):
|
||||
|
@ -639,7 +599,6 @@ class company_contribution_line(osv.osv):
|
|||
_columns = {
|
||||
'contribution_id':fields.many2one('company.contribution', 'Contribution', required=False),
|
||||
'name':fields.char('Name', size=64, required=False, readonly=False),
|
||||
'umo_id':fields.many2one('product.uom', 'Unite', required=False),
|
||||
'from_val': fields.float('From', digits=(16, 4)),
|
||||
'to_val': fields.float('To', digits=(16, 4)),
|
||||
'amount_type':fields.selection([
|
||||
|
@ -660,8 +619,6 @@ class hr_holidays_status(osv.osv):
|
|||
('unpaid','Un-Paid Holiday'),
|
||||
('halfpaid','Half-Pay Holiday')
|
||||
], string='Payment'),
|
||||
'account_id': fields.many2one('account.account', 'Account', required=False),
|
||||
'analytic_account_id':fields.many2one('account.analytic.account', 'Analytic Account', required=False),
|
||||
'head_id': fields.many2one('hr.allounce.deduction.categoty', 'Payroll Head', domain=[('type','=','deduction')]),
|
||||
'code':fields.char('Code', size=64, required=False, readonly=False),
|
||||
}
|
||||
|
@ -673,14 +630,6 @@ class hr_holidays_status(osv.osv):
|
|||
}
|
||||
hr_holidays_status()
|
||||
|
||||
class hr_expense_expense(osv.osv):
|
||||
_inherit = "hr.expense.expense"
|
||||
_description = "Expense"
|
||||
_columns = {
|
||||
'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Payroll Head', domain=[('type','=','other')]),
|
||||
}
|
||||
hr_expense_expense()
|
||||
|
||||
class hr_payslip(osv.osv):
|
||||
'''
|
||||
Pay Slip
|
||||
|
@ -697,36 +646,23 @@ class hr_payslip(osv.osv):
|
|||
allow = 0.0
|
||||
deduct = 0.0
|
||||
others = 0.0
|
||||
|
||||
obj = {
|
||||
'basic':rs.basic
|
||||
}
|
||||
obj = {'basic':rs.basic}
|
||||
if rs.igross > 0:
|
||||
obj.update({
|
||||
'gross':rs.igross
|
||||
})
|
||||
obj['gross'] = rs.igross
|
||||
if rs.inet > 0:
|
||||
obj.update({
|
||||
'net':rs.inet
|
||||
})
|
||||
|
||||
obj['net'] = rs.inet
|
||||
for line in rs.line_ids:
|
||||
amount = 0.0
|
||||
|
||||
if line.amount_type == 'per':
|
||||
try:
|
||||
amount = line.amount * eval(str(line.category_id.base), obj)
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
|
||||
|
||||
elif line.amount_type in ('fix', 'func'):
|
||||
amount = line.amount
|
||||
|
||||
cd = line.category_id.code.lower()
|
||||
obj[cd] = amount
|
||||
|
||||
contrib = 0.0
|
||||
|
||||
if line.type == 'allowance':
|
||||
allow += amount
|
||||
others += contrib
|
||||
|
@ -741,7 +677,6 @@ class hr_payslip(osv.osv):
|
|||
others += amount
|
||||
elif line.type == 'otherpay':
|
||||
others += amount
|
||||
|
||||
slip_line_obj.write(cr, uid, [line.id], {'total':amount}, context=context)
|
||||
|
||||
record = {
|
||||
|
@ -753,18 +688,15 @@ class hr_payslip(osv.osv):
|
|||
'total_pay':round(rs.basic + allow - deduct)
|
||||
}
|
||||
res[rs.id] = record
|
||||
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'deg_id':fields.many2one('hr.payroll.structure', 'Designation', required=False),
|
||||
'register_id':fields.many2one('hr.payroll.register', 'Register', required=False),
|
||||
'journal_id': fields.many2one('account.journal', 'Expanse Journal', required=True),
|
||||
'bank_journal_id': fields.many2one('account.journal', 'Bank Journal', required=True),
|
||||
'name':fields.char('Name', size=64, required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'deg_id':fields.many2one('hr.payroll.structure', 'Designation', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'register_id':fields.many2one('hr.payroll.register', 'Register', required=False, readonly=True, states={'new': [('readonly', False)]}),
|
||||
'name':fields.char('Name', size=64, required=False, readonly=True, states={'new': [('readonly', False)]}),
|
||||
'number':fields.char('Number', size=64, required=False, readonly=True),
|
||||
'employee_id':fields.many2one('hr.employee', 'Employee', required=True),
|
||||
'date': fields.date('Date'),
|
||||
'employee_id':fields.many2one('hr.employee', 'Employee', required=True, readonly=True, states={'new': [('readonly', False)]}),
|
||||
'date': fields.date('Date', readonly=True, states={'new': [('readonly', False)]}),
|
||||
'state':fields.selection([
|
||||
('new','New Slip'),
|
||||
('draft','Wating for Verification'),
|
||||
|
@ -784,16 +716,15 @@ class hr_payslip(osv.osv):
|
|||
'other_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Others', digits=(16, 2)),
|
||||
'total_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Total Payment', digits=(16, 2)),
|
||||
'line_ids':fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'holiday_days': fields.integer('No of Leaves', readonly=True),
|
||||
'worked_days': fields.integer('Worked Day', readonly=True),
|
||||
'working_days': fields.integer('Working Days', readonly=True),
|
||||
'paid':fields.boolean('Paid ? ', required=False),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'holiday_days': fields.float('No of Leaves', readonly=True),
|
||||
'worked_days': fields.float('Worked Day', readonly=True),
|
||||
'working_days': fields.float('Working Days', readonly=True),
|
||||
'paid':fields.boolean('Paid ? ', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'note':fields.text('Description'),
|
||||
'contract_id':fields.many2one('hr.contract', 'Contract', required=False),
|
||||
'contract_id':fields.many2one('hr.contract', 'Contract', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'igross': fields.float('Calculaton Field', readonly=True, digits=(16, 2), help="Calculation field used for internal calculation, do not place this on form"),
|
||||
'inet': fields.float('Calculaton Field', readonly=True, digits=(16, 2), help="Calculation field used for internal calculation, do not place this on form"),
|
||||
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
|
||||
}
|
||||
_defaults = {
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
|
@ -858,12 +789,37 @@ class hr_payslip(osv.osv):
|
|||
def process_sheet(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
self.write(cr, uid, ids, {'state':'done'}, context=context)
|
||||
self.write(cr, uid, ids, {'paid':True, 'state':'done'}, context=context)
|
||||
return True
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context={}):
|
||||
payslip_pool = self.pool.get('hr.payslip.line')
|
||||
register_pool = self.pool.get('company.contribution')
|
||||
register_line_pool = self.pool.get('hr.contibution.register.line')
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
base = {
|
||||
'basic':slip.basic,
|
||||
'net':slip.net,
|
||||
'gross':slip.grows,
|
||||
}
|
||||
for line in slip.line_ids:
|
||||
base[line.code.lower()] = line.total
|
||||
for contrib in line.category_id.contribute_ids:
|
||||
if contrib.register_id:
|
||||
value = eval(line.category_id.base, base)
|
||||
company_contrib = register_pool.compute(cr, uid, contrib.id, value, context)
|
||||
reg_line = {
|
||||
'name':line.name,
|
||||
'register_id': contrib.register_id.id,
|
||||
'code':line.code,
|
||||
'employee_id':slip.employee_id.id,
|
||||
'emp_deduction':line.total,
|
||||
'comp_deduction':company_contrib,
|
||||
'total':line.total + line.total
|
||||
}
|
||||
register_line_pool.create(cr, uid, reg_line)
|
||||
|
||||
self.write(cr, uid, ids, {'state':'confirm'}, context=context)
|
||||
return True
|
||||
|
||||
|
@ -939,15 +895,16 @@ class hr_payslip(osv.osv):
|
|||
return count
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
contracts = self.get_contract(cr, uid, slip.employee_id, date, context)
|
||||
|
||||
if contracts.get('id', False) == False:
|
||||
|
||||
old_slip_ids = slip_line_pool.search(cr, uid, [('slip_id','=',slip.id)], context=context)
|
||||
slip_line_pool.unlink(cr, uid, old_slip_ids, context=context)
|
||||
|
||||
if not slip.employee_id.contract_id:
|
||||
continue
|
||||
|
||||
contract = contract_obj.browse(cr, uid, contracts.get('id'), context=context)
|
||||
contract = slip.employee_id.contract_id
|
||||
sal_type = contract.wage_type_id.type
|
||||
function = contract.struct_id.id
|
||||
|
||||
lines = []
|
||||
if function:
|
||||
func = func_pool.read(cr, uid, function, ['line_ids'], context=context)
|
||||
|
@ -955,9 +912,6 @@ class hr_payslip(osv.osv):
|
|||
|
||||
lines += slip.employee_id.line_ids
|
||||
|
||||
old_slip_ids = slip_line_pool.search(cr, uid, [('slip_id','=',slip.id)], context=context)
|
||||
slip_line_pool.unlink(cr, uid, old_slip_ids, context=context)
|
||||
|
||||
ad = []
|
||||
lns = {}
|
||||
all_per = 0.0
|
||||
|
@ -965,13 +919,8 @@ class hr_payslip(osv.osv):
|
|||
all_fix = 0.0
|
||||
ded_fix = 0.0
|
||||
|
||||
obj = {
|
||||
'basic':0.0
|
||||
}
|
||||
update = {
|
||||
|
||||
}
|
||||
|
||||
obj = {'basic':0.0}
|
||||
update = {}
|
||||
if contract.wage_type_id.type == 'gross':
|
||||
obj['gross'] = contract.wage
|
||||
update['igross'] = contract.wage
|
||||
|
@ -982,22 +931,16 @@ class hr_payslip(osv.osv):
|
|||
obj['basic'] = contract.wage
|
||||
update['basic'] = contract.wage
|
||||
|
||||
c_type = {
|
||||
|
||||
}
|
||||
|
||||
c_type = { }
|
||||
for line in lines:
|
||||
cd = line.code.lower()
|
||||
obj[cd] = line.amount or 0.0
|
||||
|
||||
for line in lines:
|
||||
|
||||
if line.category_id.code in ad:
|
||||
continue
|
||||
|
||||
ad.append(line.category_id.code)
|
||||
cd = line.category_id.code.lower()
|
||||
|
||||
calculate = False
|
||||
try:
|
||||
exp = line.category_id.condition
|
||||
|
@ -1023,36 +966,29 @@ class hr_payslip(osv.osv):
|
|||
if sal_type in ('gross', 'net'):
|
||||
if line.amount_type == 'per':
|
||||
percent = line.amount
|
||||
|
||||
if amt > 1:
|
||||
value = percent * amt
|
||||
elif amt > 0 and amt <= 1:
|
||||
percent = percent * amt
|
||||
|
||||
if value > 0:
|
||||
percent = 0.0
|
||||
|
||||
elif line.amount_type == 'fix':
|
||||
value = line.amount
|
||||
|
||||
elif line.amount_type == 'func':
|
||||
value = slip_line_pool.execute_function(cr, uid, line.id, amt, context)
|
||||
line.amount = value
|
||||
else:
|
||||
if line.amount_type in ('fix', 'per'):
|
||||
value = line.amount
|
||||
|
||||
elif line.amount_type == 'func':
|
||||
value = slip_line_pool.execute_function(cr, uid, line.id, amt, context)
|
||||
line.amount = value
|
||||
|
||||
if line.type == 'allowance':
|
||||
all_per += percent
|
||||
all_fix += value
|
||||
elif line.type == 'deduction':
|
||||
ded_per += percent
|
||||
ded_fix += value
|
||||
|
||||
vals = {
|
||||
'amount':line.amount,
|
||||
'slip_id':slip.id,
|
||||
|
@ -1061,7 +997,6 @@ class hr_payslip(osv.osv):
|
|||
'base':base
|
||||
}
|
||||
slip_line_pool.copy(cr, uid, line.id, vals, {})
|
||||
|
||||
if sal_type in ('gross', 'net'):
|
||||
sal = contract.wage
|
||||
if sal_type == 'net':
|
||||
|
@ -1094,29 +1029,23 @@ class hr_payslip(osv.osv):
|
|||
self.write(cr, uid, [slip.id], update, context=context)
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
|
||||
if not slip.contract_id :
|
||||
if not slip.employee_id.contract_id:
|
||||
continue
|
||||
|
||||
basic_before_leaves = slip.basic
|
||||
|
||||
working_day = 0
|
||||
off_days = 0
|
||||
dates = prev_bounds(slip.date)
|
||||
|
||||
days_arr = [0, 1, 2, 3, 4, 5, 6]
|
||||
for dy in range(contract.working_days_per_week, 7):
|
||||
for dy in range(slip.employee_id.contract_id.working_days_per_week, 7):
|
||||
off_days += get_days(1, dates[1].day, dates[1].month, dates[1].year, days_arr[dy])
|
||||
|
||||
total_off = off_days
|
||||
working_day = dates[1].day - total_off
|
||||
perday = slip.net / working_day
|
||||
|
||||
total = 0.0
|
||||
leave = 0.0
|
||||
|
||||
leave_ids = self._get_leaves(cr, uid, slip, slip.employee_id, context)
|
||||
|
||||
total_leave = 0.0
|
||||
paid_leave = 0.0
|
||||
for hday in holiday_pool.browse(cr, uid, leave_ids, context=context):
|
||||
|
@ -1126,19 +1055,21 @@ class hr_payslip(osv.osv):
|
|||
'code':hday.holiday_status_id.code,
|
||||
'amount_type':'fix',
|
||||
'category_id':hday.holiday_status_id.head_id.id,
|
||||
'account_id':hday.holiday_status_id.account_id.id,
|
||||
'analytic_account_id':hday.holiday_status_id.analytic_account_id.id
|
||||
'sequence':hday.holiday_status_id.head_id.sequence
|
||||
}
|
||||
|
||||
days = hday.number_of_days
|
||||
if hday.number_of_days < 0:
|
||||
days = hday.number_of_days * -1
|
||||
|
||||
total_leave += days
|
||||
if hday.holiday_status_id.type == 'paid':
|
||||
paid_leave += days
|
||||
continue
|
||||
|
||||
# res['name'] = hday.holiday_status_id.name + '-%s' % (days)
|
||||
# res['amount'] = perday * days
|
||||
# res['type'] = 'allowance'
|
||||
# leave += days
|
||||
# total += perday * days
|
||||
|
||||
elif hday.holiday_status_id.type == 'halfpaid':
|
||||
paid_leave += (days / 2)
|
||||
res['name'] = hday.holiday_status_id.name + '-%s/2' % (days)
|
||||
|
@ -1156,8 +1087,8 @@ class hr_payslip(osv.osv):
|
|||
slip_line_pool.create(cr, uid, res, context=context)
|
||||
basic = basic - total
|
||||
leaves = total
|
||||
|
||||
update.update({
|
||||
'basic':basic,
|
||||
'basic_before_leaves': round(basic_before_leaves),
|
||||
'leaves':total,
|
||||
'holiday_days':leave,
|
||||
|
@ -1165,43 +1096,9 @@ class hr_payslip(osv.osv):
|
|||
'working_days':working_day,
|
||||
})
|
||||
self.write(cr, uid, [slip.id], update, context=context)
|
||||
|
||||
return True
|
||||
|
||||
hr_payslip()
|
||||
|
||||
class account_move_link_slip(osv.osv):
|
||||
'''
|
||||
Account Move Link to Pay Slip
|
||||
'''
|
||||
_name = 'hr.payslip.account.move'
|
||||
_description = 'Account Move Link to Pay Slip'
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=256, required=True, readonly=False),
|
||||
'move_id':fields.many2one('account.move', 'Expanse Entries', required=False, readonly=True),
|
||||
'slip_id':fields.many2one('hr.payslip', 'Pay Slip', required=False),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
}
|
||||
account_move_link_slip()
|
||||
|
||||
class line_condition(osv.osv):
|
||||
'''
|
||||
Line Condition
|
||||
'''
|
||||
_name = 'hr.payslip.line.condition'
|
||||
_description = 'Line Condition'
|
||||
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=64, required=False, readonly=False),
|
||||
'date_start': fields.date('Start Date'),
|
||||
'date_end': fields.date('End Date'),
|
||||
'state':fields.selection([
|
||||
('total','Override By'),
|
||||
('add','Add to Structure')
|
||||
],'Condition', select=True, readonly=False),
|
||||
}
|
||||
line_condition()
|
||||
|
||||
class hr_payslip_line(osv.osv):
|
||||
'''
|
||||
Payslip Line
|
||||
|
@ -1232,7 +1129,6 @@ class hr_payslip_line(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'slip_id':fields.many2one('hr.payslip', 'Pay Slip', required=False),
|
||||
'condition_id':fields.many2one('hr.payslip.line.condition', 'Condition', required=False),
|
||||
'function_id':fields.many2one('hr.payroll.structure', 'Function', required=False),
|
||||
'employee_id':fields.many2one('hr.employee', 'Employee', required=False),
|
||||
'name':fields.char('Name', size=256, required=True, readonly=False),
|
||||
|
@ -1255,12 +1151,8 @@ class hr_payslip_line(osv.osv):
|
|||
('func','Function Value'),
|
||||
],'Amount Type', select=True),
|
||||
'amount': fields.float('Amount / Percentage', digits=(16, 4)),
|
||||
'analytic_account_id':fields.many2one('account.analytic.account', 'Analytic Account', required=False),
|
||||
'account_id':fields.many2one('account.account', 'General Account', required=True),
|
||||
'total': fields.float('Sub Total', readonly=True, digits=(16, 4)),
|
||||
#'total': fields.function(_calculate, method=True, type='float', string='Label', store=True),
|
||||
'company_contrib': fields.float('Company Contribution', readonly=True, digits=(16, 4)),
|
||||
'expanse_id': fields.many2one('hr.expense.expense', 'Expense'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'note':fields.text('Description'),
|
||||
'line_ids':fields.one2many('hr.payslip.line.line', 'slipline_id', 'Calculations', required=False)
|
||||
|
@ -1273,10 +1165,8 @@ class hr_payslip_line(osv.osv):
|
|||
line_pool = self.pool.get('hr.payslip.line.line')
|
||||
res = 0
|
||||
ids = line_pool.search(cr, uid, [('slipline_id','=',id), ('from_val','<=',value), ('to_val','>=',value)], context=context)
|
||||
|
||||
if not ids:
|
||||
ids = line_pool.search(cr, uid, [('slipline_id','=',id), ('from_val','<=',value)], context=context)
|
||||
|
||||
if not ids:
|
||||
return res
|
||||
|
||||
|
@ -1296,7 +1186,6 @@ class hr_payslip_line_line(osv.osv):
|
|||
_columns = {
|
||||
'slipline_id':fields.many2one('hr.payslip.line', 'Slip Line', required=False),
|
||||
'name':fields.char('Name', size=64, required=False, readonly=False),
|
||||
'umo_id':fields.many2one('product.uom', 'Unite', required=False),
|
||||
'from_val': fields.float('From', digits=(16, 4)),
|
||||
'to_val': fields.float('To', digits=(16, 4)),
|
||||
'amount_type':fields.selection([
|
||||
|
@ -1315,53 +1204,15 @@ class hr_employee(osv.osv):
|
|||
_description = 'Employee'
|
||||
|
||||
_columns = {
|
||||
# 'pan_no':fields.char('PAN No', size=64, required=False, readonly=False),
|
||||
'esp_account':fields.char('EPS Account', size=64, required=False, readonly=False, help="EPS Account"),
|
||||
'pf_account':fields.char('PF Account', size=64, required=False, readonly=False, help="Providend Fund Account"),
|
||||
'esp_account':fields.char('EPS Account', size=64, required=False, readonly=False, help="EPS Account Number"),
|
||||
'pf_account':fields.char('PF Account', size=64, required=False, readonly=False, help="Providend Fund Account Number"),
|
||||
'pg_joining': fields.date('PF Join Date'),
|
||||
'esi_account':fields.char('ESI Account', size=64, required=False, readonly=False, help="ESI Account"),
|
||||
'esi_account':fields.char('ESI Account', size=64, required=False, readonly=False, help="ESI Account Number"),
|
||||
'hospital_id':fields.many2one('res.partner.address', 'ESI Hospital', required=False),
|
||||
'passport_id':fields.char('Passport', size=64),
|
||||
'otherid':fields.char('Other Id', size=64, required=False),
|
||||
'bank_account_id':fields.many2one('res.partner.bank', 'Bank Account', required=False, readonly=False),
|
||||
'passport_id':fields.many2one('hr.passport', 'Passport', required=False, domain="[('employee_id','=',active_id), ('address_id','=',address_home_id)]", help="Employee Passport Information"),
|
||||
'bank_account_id':fields.many2one('res.partner.bank', 'Bank Account', domain="[('partner_id','=',partner_id)]", help="Employee bank salary account"),
|
||||
'line_ids':fields.one2many('hr.payslip.line', 'employee_id', 'Salary Structure', required=False),
|
||||
'slip_ids':fields.one2many('hr.payslip', 'employee_id', 'Payslips', required=False, readonly=True),
|
||||
'property_bank_account': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Bank Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="Select Bank Account from where Salary Expanse will be Paid",
|
||||
required=True),
|
||||
'salary_account':fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Salary Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="Expanse account when Salary Expanse will be recorded",
|
||||
required=True),
|
||||
'employee_account':fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Employee Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="Employee Payable Account",
|
||||
required=True),
|
||||
'analytic_account':fields.property(
|
||||
'account.analytic.account',
|
||||
type='many2one',
|
||||
relation='account.analytic.account',
|
||||
string="Analytic Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="Analytic Account for Salary Analysis",
|
||||
required=False),
|
||||
}
|
||||
hr_employee()
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<record id="hr_payslip_line_houserantallowance1" model="hr.payslip.line">
|
||||
<field name="amount_type">per</field>
|
||||
<field name="account_id" ref="account.a_expense"/>
|
||||
<!-- <field name="account_id" ref="account.a_expense"/>-->
|
||||
<field eval="5" name="sequence"/>
|
||||
<field eval="0.4" name="amount"/>
|
||||
<field name="code">HRA</field>
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
<record id="hr_payslip_line_convanceallowance1" model="hr.payslip.line">
|
||||
<field name="amount_type">fix</field>
|
||||
<field name="account_id" ref="account.a_expense"/>
|
||||
<!-- <field name="account_id" ref="account.a_expense"/>-->
|
||||
<field eval="10" name="sequence"/>
|
||||
<field eval="800.0" name="amount"/>
|
||||
<field name="code">CA</field>
|
||||
|
@ -35,7 +35,7 @@
|
|||
|
||||
<record id="hr_payslip_line_professionaltax1" model="hr.payslip.line">
|
||||
<field name="amount_type">fix</field>
|
||||
<field name="account_id" ref="account.a_pay"/>
|
||||
<!-- <field name="account_id" ref="account.a_pay"/>-->
|
||||
<field eval="15" name="sequence"/>
|
||||
<field eval="200.0" name="amount"/>
|
||||
<field name="code">PT</field>
|
||||
|
@ -47,7 +47,7 @@
|
|||
|
||||
<record id="hr_payslip_line_providentfund1" model="hr.payslip.line">
|
||||
<field name="amount_type">per</field>
|
||||
<field name="account_id" ref="account.a_pay"/>
|
||||
<!-- <field name="account_id" ref="account.a_pay"/>-->
|
||||
<field eval="20" name="sequence"/>
|
||||
<field eval="0.125" name="amount"/>
|
||||
<field name="code">PF</field>
|
||||
|
@ -84,122 +84,14 @@
|
|||
<!-- Payslip -->
|
||||
<record id="hr_payslip_salaryslipofbonamyforjune0" model="hr.payslip">
|
||||
<field name="number">SLIP/001</field>
|
||||
<field name="journal_id" ref="account.expenses_journal"/>
|
||||
<!-- <field name="journal_id" ref="account.expenses_journal"/>-->
|
||||
<field name="deg_id" ref="hr_payroll.structure_001"/>
|
||||
<field name="employee_id" ref="hr_employee_bonamy0"/>
|
||||
<field name="contract_id" ref="hr_contract_firstcontract1"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="date" eval="time.strftime('%Y-%m')+'-5'"/>
|
||||
<field name="bank_journal_id" ref="account.bank_journal"/>
|
||||
<!-- <field name="bank_journal_id" ref="account.bank_journal"/>-->
|
||||
<field name="name">Salary Slip of Bonamy for June-2010</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_salaryaccount0" model="ir.property">
|
||||
<field name="name">salary_account</field>
|
||||
<field name="res_id">hr.employee,1</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_salary_account"/>
|
||||
<field name="value_reference">account.account,27</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_employeeaccount0" model="ir.property">
|
||||
<field name="name">employee_account</field>
|
||||
<field name="res_id">hr.employee,1</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_employee_account"/>
|
||||
<field name="value_reference">account.account,22</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_propertybankaccount0" model="ir.property">
|
||||
<field name="name">property_bank_account</field>
|
||||
<field name="res_id">hr.employee,1</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_property_bank_account"/>
|
||||
<field name="value_reference">account.account,11</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_salaryaccount2" model="ir.property">
|
||||
<field name="name">salary_account</field>
|
||||
<field name="res_id">hr.employee,2</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_salary_account"/>
|
||||
<field name="value_reference">account.account,27</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_employeeaccount2" model="ir.property">
|
||||
<field name="name">employee_account</field>
|
||||
<field name="res_id">hr.employee,2</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_employee_account"/>
|
||||
<field name="value_reference">account.account,22</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_propertybankaccount2" model="ir.property">
|
||||
<field name="name">property_bank_account</field>
|
||||
<field name="res_id">hr.employee,2</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_property_bank_account"/>
|
||||
<field name="value_reference">account.account,11</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_salaryaccount3" model="ir.property">
|
||||
<field name="name">salary_account</field>
|
||||
<field name="res_id">hr.employee,3</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_salary_account"/>
|
||||
<field name="value_reference">account.account,27</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_employeeaccount3" model="ir.property">
|
||||
<field name="name">employee_account</field>
|
||||
<field name="res_id">hr.employee,3</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_employee_account"/>
|
||||
<field name="value_reference">account.account,22</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_propertybankaccount3" model="ir.property">
|
||||
<field name="name">property_bank_account</field>
|
||||
<field name="res_id">hr.employee,3</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_property_bank_account"/>
|
||||
<field name="value_reference">account.account,11</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_salaryaccount4" model="ir.property">
|
||||
<field name="name">salary_account</field>
|
||||
<field name="res_id">hr.employee,10</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_salary_account"/>
|
||||
<field name="value_reference">account.account,27</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_employeeaccount4" model="ir.property">
|
||||
<field name="name">employee_account</field>
|
||||
<field name="res_id">hr.employee,10</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_employee_account"/>
|
||||
<field name="value_reference">account.account,22</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_property_propertybankaccount4" model="ir.property">
|
||||
<field name="name">property_bank_account</field>
|
||||
<field name="res_id">hr.employee,10</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="fields_id" ref="hr_payroll.field_hr_employee_property_bank_account"/>
|
||||
<field name="value_reference">account.account,11</field>
|
||||
<field name="type">many2one</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<separator string="Description" colspan="2"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Contracts">
|
||||
<page string="Contracts" groups="base.group_extended">
|
||||
<field name="contracts_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
@ -87,6 +87,19 @@
|
|||
<!-- End Passport Views -->
|
||||
|
||||
<!-- Employee View -->
|
||||
|
||||
<record id="view_employee_bank_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.bank.form</field>
|
||||
<field name="model">res.partner.bank</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_partner_bank_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="replace">
|
||||
<field name="partner_id" invisible="context.get('display_partner', False)"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_contract.hr_hr_employee_view_form2" model="ir.ui.view">
|
||||
<field name="name">hr.hr.employee.view.form2</field>
|
||||
<field name="model">hr.employee</field>
|
||||
|
@ -97,8 +110,7 @@
|
|||
<page string="Miscellaneous">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Personal Info" colspan="2"/>
|
||||
<field name="otherid" select="1"/>
|
||||
<field name="bank_account_id"/>
|
||||
<field name="bank_account_id" context="{'display_partner':True, 'partner_id':partner_id}"/>
|
||||
<field name="place_of_birth"/>
|
||||
<field name="children"/>
|
||||
</group>
|
||||
|
@ -108,20 +120,20 @@
|
|||
<field name="vehicle" select="1"/>
|
||||
<field name="vehicle_distance" select="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<group col="2" colspan="2" groups="base.group_extended">
|
||||
<separator colspan="2" string="ESI Information"/>
|
||||
<field name="esi_account" string="Account"/>
|
||||
<field name="hospital_id" string="Hospital"/>
|
||||
<field name="medic_exam" select="1" string="Medical Examination"/>
|
||||
<field name="esp_account" select="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<group col="2" colspan="2" groups="base.group_extended">
|
||||
<separator colspan="2" string="Providend Fund"/>
|
||||
<field name="pf_account" string="Account"/>
|
||||
<field name="pg_joining" string="Join Date"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Contracts">
|
||||
<page string="Contracts" groups="base.group_extended">
|
||||
<field colspan="4" mode="form,tree" name="contract_ids" nolabel="1">
|
||||
<tree string="Contracts">
|
||||
<field name="name"/>
|
||||
|
@ -142,7 +154,7 @@
|
|||
<field name="type_id" widget="selection"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Main Data">
|
||||
<page string="Contract Details">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Duration"/>
|
||||
<field name="date_start" select="1"/>
|
||||
|
@ -156,28 +168,29 @@
|
|||
<field name="advantages_gross"/>
|
||||
<field name="advantages" nolabel="1" colspan="2"/>
|
||||
</group>
|
||||
|
||||
</page>
|
||||
<page string="Work Permit">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Passport"/>
|
||||
<field name="passport_id"/>
|
||||
<field name="passport_id" domain="[('employee_id','=',parent.id)]"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Valid for"/>
|
||||
<field name="visa_no"/>
|
||||
<field name="permit_no"/>
|
||||
<field name="visa_expire"/>
|
||||
<field name="visa_no" attrs="{'required': [('passport_id','!=',False), ]}"/>
|
||||
<field name="permit_no" attrs="{'required': [('passport_id','!=',False), ]}"/>
|
||||
<field name="visa_expire" attrs="{'required': [('passport_id','!=',False), ]}"/>
|
||||
</group>
|
||||
</page>
|
||||
<separator colspan="4" string="Notes"/>
|
||||
<field colspan="4" name="notes" nolabel="1"/>
|
||||
</notebook>
|
||||
<separator colspan="4" string="Notes"/>
|
||||
<field colspan="4" name="notes" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="/form/notebook/page[@string='Notes']" position="before">
|
||||
<page string="Salary Structure">
|
||||
<page string="Salary Structure" groups="base.group_extended">
|
||||
<field name="line_ids" nolabel="1" colspan="4" string="Salary Structure">
|
||||
<tree string="Salary Structure" editable="bottom">
|
||||
<field name="category_id" on_change="onchange_category(category_id)"/>
|
||||
|
@ -187,17 +200,26 @@
|
|||
<field name="type"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="amount" on_change="onchange_amount(amount, amount_type)"/>
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id" groups="base.group_extended"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Accounting">
|
||||
<field name="property_bank_account"/>
|
||||
<field name="salary_account"/>
|
||||
<field name="employee_account"/>
|
||||
<field name="analytic_account" groups="base.group_extended"/>
|
||||
<field name="slip_ids" colspan="4" nolabel="1"/>
|
||||
<page string="Salary Slips" groups="base.group_extended">
|
||||
<field name="slip_ids" colspan="4" nolabel="1" readonly="True">
|
||||
<tree colors="blue:state in ('draft');black:state in ('confirm','new','hr_check','accont_check');gray:state in('done','cancel')" string="Payslip">
|
||||
<field name="number"/>
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="register_id"/>
|
||||
<field name="basic"/>
|
||||
<field name="allounce"/>
|
||||
<field name="grows"/>
|
||||
<field name="deduction"/>
|
||||
<field name="net"/>
|
||||
<field name="total_pay" sum="Total Salary Paid"/>
|
||||
<field name="state"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
</data>
|
||||
|
@ -216,6 +238,7 @@
|
|||
</field>
|
||||
</record>
|
||||
<!-- End Employee View -->
|
||||
|
||||
<!-- Contract View -->
|
||||
<record id="hr_contract.hr_contract_view_form" model="ir.ui.view">
|
||||
<field name="name">hr.contract.view.form</field>
|
||||
|
@ -225,7 +248,7 @@
|
|||
<form string="Contract">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="employee_id" select="1" on_change="on_change_employee_id(employee_id)"/>
|
||||
<field name="employee_id" select="1"/>
|
||||
<field name="job_id"/>
|
||||
<field name="wage"/>
|
||||
<field name="wage_type_id" widget="selection"/>
|
||||
|
@ -282,7 +305,7 @@
|
|||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="line_ids"/>
|
||||
<field name="company_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -296,8 +319,7 @@
|
|||
<group col="6" colspan="4">
|
||||
<field name="name" colspan="4" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="account_id" select="1" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="company_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Salary Structure">
|
||||
|
@ -331,10 +353,8 @@
|
|||
<field name="color_name" position="after">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Payroll Accounting"/>
|
||||
<field name="company_id" widget="selection" select="2"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection" select="2"/>
|
||||
<field name="code"/>
|
||||
<field name="analytic_account_id" groups="base.group_extended"/>
|
||||
<field name="account_id"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Payroll Configurtion"/>
|
||||
|
@ -360,8 +380,6 @@
|
|||
<field name="type"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="amount" on_change="onchange_amount(amount, amount_type)"/>
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -387,9 +405,9 @@
|
|||
<field name="sequence"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Accounting Informations"/>
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
|
||||
<!-- <separator colspan="4" string="Accounting Informations"/>-->
|
||||
<!-- <field name="account_id"/>-->
|
||||
<!-- <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>-->
|
||||
<separator colspan="4" string="Company contribution"/>
|
||||
<field name="company_contrib"/>
|
||||
</group>
|
||||
|
@ -420,7 +438,7 @@
|
|||
<field name="model">hr.payslip</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state in ('draft');black:state in ('confirm','new','hr_check','accont_check');gray:state in('done','cancel')" string="Payslip">
|
||||
<tree colors="blue:state in ('confirm','hr_check','accont_check');black:state in ('new');gray:state in('cancel')" string="Payslip">
|
||||
<field name="number"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="register_id" invisible="1"/>
|
||||
|
@ -429,7 +447,7 @@
|
|||
<field name="grows"/>
|
||||
<field name="net"/>
|
||||
<field name="state"/>
|
||||
<field name="company_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -444,12 +462,10 @@
|
|||
<field name="employee_id"/>
|
||||
<field name="name"/>
|
||||
<field name="number" select="1"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="bank_journal_id" domain="[('type','=','cash')]"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Salary Detail">
|
||||
<page string="Salary Computation">
|
||||
<field name="line_ids" colspan="4" nolabel="1">
|
||||
<tree string="Salary Structure" editable="bottom">
|
||||
<field name="category_id" on_change="onchange_category(category_id)"/>
|
||||
|
@ -460,38 +476,32 @@
|
|||
<field name="amount_type"/>
|
||||
<field name="amount" on_change="onchange_amount(amount, amount_type)"/>
|
||||
<field name="total"/>
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id" groups="base.group_extended"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
<group col="6" colspan="4">
|
||||
<separator string="Computation Overview" colspan="6"/>
|
||||
<field name="working_days"/>
|
||||
<field name="holiday_days"/>
|
||||
<field name="worked_days"/>
|
||||
|
||||
<field name="basic_before_leaves"/>
|
||||
<field name="leaves"/>
|
||||
<field name="basic"/>
|
||||
|
||||
<field name="allounce"/>
|
||||
<field name="deduction"/>
|
||||
<field name="other_pay"/>
|
||||
|
||||
<field name="grows"/>
|
||||
<field name="net"/>
|
||||
<field name="total_pay"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Accounting Details">
|
||||
<page string="Other Informations">
|
||||
<group col="2" colspan="1">
|
||||
<separator colspan="2" string="Other Informations"/>
|
||||
<field name="paid" readonly="1"/>
|
||||
<field name="company_id"/>
|
||||
<field name="register_id"/>
|
||||
<field name="deg_id"/>
|
||||
<field name="contract_id" domain="[('employee_id','=',employee_id)]"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="register_id" groups="base.group_extended"/>
|
||||
<field name="deg_id" groups="base.group_extended"/>
|
||||
<field name="contract_id" groups="base.group_extended" domain="[('employee_id','=',employee_id)]"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator colspan="4" string="Description"/>
|
||||
|
@ -550,8 +560,6 @@
|
|||
</record>
|
||||
<menuitem action="action_view_hr_payslip_form" id="menu_department_tree" parent="menu_hr_root_payroll"/>
|
||||
|
||||
|
||||
|
||||
<!-- Payment Heads -->
|
||||
<record id="hr_allounce_deduction_categoty_form" model="ir.ui.view">
|
||||
<field name="name">hr.allounce.deduction.categoty.form</field>
|
||||
|
@ -655,7 +663,7 @@
|
|||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Other Information"/>
|
||||
<field name="company_id" select="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
|
@ -694,7 +702,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_company_contribution_filter" model="ir.ui.view">
|
||||
<record id="view_hr_company_contribution_filter" model="ir.ui.view">
|
||||
<field name="name">company.contribution.select</field>
|
||||
<field name="model">company.contribution</field>
|
||||
<field name="type">search</field>
|
||||
|
@ -737,10 +745,10 @@
|
|||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Bank Advice">
|
||||
<field name="number" select="1"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="number" select="1"/>
|
||||
<field name="company_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -753,11 +761,9 @@
|
|||
<form string="Bank Advice">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" colspan="4" select="1"/>
|
||||
<field name="account_id" select="1"/>
|
||||
<newline/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="number" select="1"/>
|
||||
<field name="register_id"/>
|
||||
<field name="bank_id"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Paymeny Lines">
|
||||
|
@ -773,9 +779,9 @@
|
|||
</page>
|
||||
<page string="Letter Content">
|
||||
<group colspan="4" col="6">
|
||||
<field name="company_id" on_change="onchange_company_id(company_id)"/>
|
||||
<field name="company_id" on_change="onchange_company_id(company_id)" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="chaque_nos"/>
|
||||
<field name="bank"/>
|
||||
<field name="date" select="1"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Letter Details"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
|
@ -812,8 +818,6 @@
|
|||
<field name="number"/>
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="bank_journal_id"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
@ -825,12 +829,10 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Payroll Register">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="name" colspan="4" select="1"/>
|
||||
<field name="number" select="1"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="bank_journal_id"/>
|
||||
<field name="active"/>
|
||||
<field name="bank_id"/>
|
||||
<field name="date" select="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Payslips">
|
||||
|
@ -894,11 +896,9 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Contribution Registers">
|
||||
<field name="name" select="1"/>
|
||||
<field name="company_id" select="1"/>
|
||||
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="monthly_total_by_emp"/>
|
||||
<field name="monthly_total_by_comp"/>
|
||||
<field name="yearly_total_by_emp"/>
|
||||
<field name="yearly_total_by_comp"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -909,16 +909,14 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Contribution">
|
||||
<field name="name" select="1"/>
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id" groups="base.group_extended"/>
|
||||
<field name="company_id" select="1"/>
|
||||
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Contribution Lines">
|
||||
<field colspan="4" name="register_line_ids" nolabel="1" select="1">
|
||||
<tree string="Register Lines" editable="top">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="period_id"/>
|
||||
<field name="emp_deduction"/>
|
||||
<field name="comp_deduction"/>
|
||||
<field name="total"/>
|
||||
|
@ -930,11 +928,6 @@
|
|||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Year"/>
|
||||
<field name="yearly_total_by_emp"/>
|
||||
<field name="yearly_total_by_comp"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Month"/>
|
||||
<field name="monthly_total_by_emp"/>
|
||||
|
@ -963,27 +956,12 @@
|
|||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="period_id"/>
|
||||
<field name="emp_deduction"/>
|
||||
<field name="comp_deduction"/>
|
||||
<field name="total"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payslip_line_condition_tree" model="ir.ui.view">
|
||||
<field name="name">hr.payslip.line.condition.tree</field>
|
||||
<field name="model">hr.payslip.line.condition</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Condition">
|
||||
<field name="name"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="state"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
|
|
@ -14,16 +14,9 @@
|
|||
"access_company_contribution","company.contribution","model_company_contribution","group_hr_payroll",1,1,1,1
|
||||
"access_company_contribution_line","company.contribution.line","model_company_contribution_line","group_hr_payroll",1,1,1,1
|
||||
"access_hr_holidays_status","hr.holidays.status","hr_holidays.model_hr_holidays_status","group_hr_payroll",1,0,0,0
|
||||
"access_hr_expense_expense","hr.expense.expense","hr_expense.model_hr_expense_expense","group_hr_payroll",1,0,0,0
|
||||
"access_hr_payslip","hr.payslip","model_hr_payslip","group_hr_payroll",1,1,1,1
|
||||
"access_hr_payslip_account_move","hr.payslip.account.move","model_hr_payslip_account_move","group_hr_payroll",1,1,1,1
|
||||
"access_hr_payslip_line_condition","hr.payslip.line.condition","model_hr_payslip_line_condition","group_hr_payroll",1,1,1,1
|
||||
"access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","group_hr_payroll",1,1,1,1
|
||||
"access_hr_payslip_line_line","hr.payslip.line.line","model_hr_payslip_line_line","group_hr_payroll",1,1,1,1
|
||||
"access_account_journal_payroll","hr.payroll.journal","account.model_account_journal","group_hr_payroll",1,0,0,0
|
||||
"access_account_journal_view_payroll","account.journal.view.payroll","account.model_account_journal_view","group_hr_payroll",1,0,0,0
|
||||
"access_account_journal_column_payroll","account.journal.column.payroll","account.model_account_journal_column","group_hr_payroll",1,0,0,0
|
||||
"access_account_fiscalyear_payroll","account.fiscalyear.payroll","account.model_account_fiscalyear","group_hr_payroll",1,0,0,0
|
||||
"access_hr_payslip_contract","hr.payslip.contract","model_hr_payslip","base.group_hr_contract",1,0,0,0
|
||||
"access_hr_payroll_structure_system","hr.payroll.structure.system","model_hr_payroll_structure","base.group_system",1,1,1,1
|
||||
"access_company_contribution","company.contribution","model_company_contribution","base.group_system",1,1,1,1
|
||||
|
@ -32,20 +25,15 @@
|
|||
"access_hr_contibution_register_system","hr.contibution.register.system","model_hr_contibution_register","base.group_system",1,1,1,1
|
||||
"access_hr_contibution_register_line_system","hr.contibution.register.line.system","model_hr_contibution_register_line","base.group_system",1,1,1,1
|
||||
"access_hr_allounce_deduction_category_system","hr.allounce.deduction.category.system","model_hr_allounce_deduction_categoty","base.group_system",1,1,1,1
|
||||
"access_account_fiscalyear_manager","account.fiscalyear.payroll.manager","account.model_account_fiscalyear","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_payslip_manager","hr.payslip.manager","model_hr_payslip","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_payslip_line_manager","hr.payslip.line.manager","model_hr_payslip_line","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_payroll_structure_manager","hr.payroll.structure.manager","model_hr_payroll_structure","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_allounce_deduction_category_manager","hr.allounce.deduction.category.manager","model_hr_allounce_deduction_categoty","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_passport_manager","hr.passport.manager","model_hr_passport","base.group_hr_manager",1,1,1,1
|
||||
"access_account_journal_manager","account.journal.manager","account.model_account_journal","base.group_hr_manager",1,1,1,1
|
||||
"access_account_journal_column_manager","account.journal.column.manager","account.model_account_journal_column","base.group_hr_manager",1,1,1,1
|
||||
"access_account_journal_view_manager","account.journal.view.manager","account.model_account_journal_view","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_payslip_employee","hr.payslip.employee","model_hr_payslip","base.group_user",1,0,0,0
|
||||
"access_hr_payroll_register_system","hr.payroll.register.system","model_hr_payroll_register","base.group_system",1,0,0,0
|
||||
"access_hr_payroll_advice_system","hr.payroll.advice.system","model_hr_payroll_advice","base.group_system",1,0,0,0
|
||||
"access_hr_payslip_line_system","hr.payslip.line.system","model_hr_payslip_line","base.group_system",1,1,1,1
|
||||
"access_hr_payslip_account_move_system","hr.payslip.account.move.system","model_hr_payslip_account_move","base.group_system",1,0,0,0
|
||||
"access_hr_payroll_structure_contract","hr.payroll.structure.contract","model_hr_payroll_structure","base.group_hr_contract",1,1,1,1
|
||||
"access_hr_payslip_line_user","hr.payslip.line.user","model_hr_payslip_line","base.group_hr_user",1,1,1,0
|
||||
"access_hr_allounce_deduction_category_hr_user","hr.allounce.deduction.category.hr.user","model_hr_allounce_deduction_categoty","base.group_hr_user",1,1,1,0
|
||||
|
|
|
|
@ -22,5 +22,5 @@
|
|||
|
||||
|
||||
import hr_payroll_employees_detail
|
||||
import hr_payroll_create_analytic
|
||||
#import hr_payroll_create_analytic
|
||||
import hr_payroll_year_salary
|
||||
|
|
|
@ -1,101 +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 time
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
class hr_payroll_create_analytic(osv.osv_memory):
|
||||
_name = "hr.payroll.create.analytic"
|
||||
_columns = {
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'type': fields.selection([('bydeg','By Employee Function'), ('byallded','By Allownce / Deduction')],'Type'),
|
||||
}
|
||||
|
||||
def do_duplicate(self, cr, uid, ids, context=None):
|
||||
account_pool = self.pool.get('account.analytic.account')
|
||||
func_pool = self.pool.get('hr.employee.grade')
|
||||
ad_pool = self.pool.get('hr.allounce.deduction.categoty')
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.read(cr, uid, ids, context=context)[0]
|
||||
tpy = data['type']
|
||||
company = data['company_id']
|
||||
|
||||
function_ids = func_pool.search(cr, uid, [], context=context)
|
||||
ad_ids = ad_pool.search(cr, uid, [], context=context)
|
||||
|
||||
if tpy == 'bydeg':
|
||||
for function in func_pool.browse(cr, uid, function_ids, context=context):
|
||||
res = {
|
||||
'name':function.name,
|
||||
'company_id':company
|
||||
}
|
||||
fid = account_pool.create(cr, uid, res, context=context)
|
||||
res = {
|
||||
'name':'Basic Salary',
|
||||
'company_id':company,
|
||||
'parent_id': fid
|
||||
}
|
||||
account_pool.create(cr, uid, res, context=context)
|
||||
for ad in ad_pool.browse(cr, uid, ad_ids, context=context):
|
||||
res = {
|
||||
'name':ad.name,
|
||||
'company_id':company,
|
||||
'parent_id': fid
|
||||
}
|
||||
account_pool.create(cr, uid, res, context=context)
|
||||
|
||||
|
||||
|
||||
elif tpy == 'byallded':
|
||||
res = {
|
||||
'name':'Basic Salary',
|
||||
'company_id':company
|
||||
}
|
||||
adid = account_pool.create(cr, uid, res, context=context)
|
||||
for function in func_pool.browse(cr, uid, function_ids, context=context):
|
||||
res = {
|
||||
'name':function.name,
|
||||
'company_id':company,
|
||||
'parent_id': adid
|
||||
}
|
||||
account_pool.create(cr, uid, res, context=context)
|
||||
|
||||
for ad in ad_pool.browse(cr, uid, ad_ids, context=context):
|
||||
res = {
|
||||
'name':ad.name,
|
||||
'company_id':company,
|
||||
}
|
||||
adid = account_pool.create(cr, uid, res, context=context)
|
||||
for function in func_pool.browse(cr, uid, function_ids, context=context):
|
||||
res = {
|
||||
'name':function.name,
|
||||
'company_id':company,
|
||||
'parent_id': adid
|
||||
}
|
||||
account_pool.create(cr, uid, res, context=context)
|
||||
|
||||
return {}
|
||||
hr_payroll_create_analytic()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_hr_payroll_create_form" model="ir.ui.view">
|
||||
<field name="name">Create Analytic</field>
|
||||
<field name="model">hr.payroll.create.analytic</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Process Form">
|
||||
<field name="company_id"/>
|
||||
<field name="type"/>
|
||||
<separator colspan="4"/>
|
||||
<group col="2" colspan="4">
|
||||
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
|
||||
<button name="do_duplicate" string="Process" colspan="1" type="object" icon="gtk-yes"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_hr_payroll_create" model="ir.actions.act_window">
|
||||
<field name="name">Create Analytic Structure</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.payroll.create.analytic</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue