[MERGE] merge with trunk-payroll-salary_rules-mtr branch
bzr revid: psi@tinyerp.co.in-20110304070625-ya6lepni4jyjw8c7
This commit is contained in:
commit
ed78081860
|
@ -57,9 +57,10 @@ class hr_payroll_structure(osv.osv):
|
|||
_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),
|
||||
# 'line_ids':fields.one2many('hr.payslip.line', 'function_id', 'Salary Structure', required=False),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'note': fields.text('Description'),
|
||||
'parent_id':fields.many2one('hr.payroll.structure', 'Parent Structure'),
|
||||
}
|
||||
_defaults = {
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
|
@ -216,8 +217,8 @@ class payroll_register(osv.osv):
|
|||
|
||||
def final_verify_sheet(self, cr, uid, ids, context=None):
|
||||
slip_pool = self.pool.get('hr.payslip')
|
||||
advice_pool = self.pool.get('hr.payroll.advice')
|
||||
advice_line_pool = self.pool.get('hr.payroll.advice.line')
|
||||
# advice_pool = self.pool.get('hr.payroll.advice')
|
||||
# advice_line_pool = self.pool.get('hr.payroll.advice.line')
|
||||
sequence_pool = self.pool.get('ir.sequence')
|
||||
users_pool = self.pool.get('res.users')
|
||||
|
||||
|
@ -228,26 +229,6 @@ class payroll_register(osv.osv):
|
|||
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):
|
||||
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:
|
||||
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.bank_account_id.acc_number,
|
||||
'employee_id':slip.employee_id.id,
|
||||
# 'amount':slip.other_pay + slip.net, #PSI@ Need to improve
|
||||
# 'bysal':slip.net #PSI@ Need to improve
|
||||
}
|
||||
id = advice_line_pool.create(cr, uid, pline, context=context)
|
||||
|
||||
self.write(cr, uid, ids, {'state':'confirm'}, context=context)
|
||||
return True
|
||||
|
||||
|
@ -264,96 +245,6 @@ class payroll_register(osv.osv):
|
|||
|
||||
payroll_register()
|
||||
|
||||
class payroll_advice(osv.osv):
|
||||
'''
|
||||
Bank Advice Note
|
||||
'''
|
||||
|
||||
_name = 'hr.payroll.advice'
|
||||
_description = 'Bank Advice Note'
|
||||
_columns = {
|
||||
'register_id':fields.many2one('hr.payroll.register', 'Payroll Register', required=False),
|
||||
'name':fields.char('Name', size=2048, required=True, readonly=False),
|
||||
'note': fields.text('Description'),
|
||||
'date': fields.date('Date'),
|
||||
'state':fields.selection([
|
||||
('draft','Draft Sheet'),
|
||||
('confirm','Confirm Sheet'),
|
||||
('cancel','Reject'),
|
||||
],'State', select=True, readonly=True),
|
||||
'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),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'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': 'draft',
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
}
|
||||
|
||||
def confirm_sheet(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'confirm'}, context=context)
|
||||
return True
|
||||
|
||||
def set_to_draft(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'draft'}, context=context)
|
||||
return True
|
||||
|
||||
def cancel_sheet(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'cancel'}, context=context)
|
||||
return True
|
||||
|
||||
def onchange_company_id(self, cr, uid, ids, company_id=False, context=None):
|
||||
res = {}
|
||||
if company_id:
|
||||
company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
|
||||
if company.partner_id.bank_ids:
|
||||
res.update({'bank': company.partner_id.bank_ids[0].bank.name})
|
||||
return {
|
||||
'value':res
|
||||
}
|
||||
payroll_advice()
|
||||
|
||||
class payroll_advice_line(osv.osv):
|
||||
'''
|
||||
Bank Advice Lines
|
||||
'''
|
||||
|
||||
_name = 'hr.payroll.advice.line'
|
||||
_description = 'Bank Advice Lines'
|
||||
_columns = {
|
||||
'advice_id':fields.many2one('hr.payroll.advice', 'Bank Advice', required=False),
|
||||
'name':fields.char('Bank Account A/C', size=64, required=True, readonly=False),
|
||||
'employee_id':fields.many2one('hr.employee', 'Employee', required=True),
|
||||
'amount': fields.float('Amount', digits=(16, 4)),
|
||||
'bysal': fields.float('By Salary', digits=(16, 4)),
|
||||
'flag':fields.char('D/C', size=8, required=True, readonly=False),
|
||||
}
|
||||
_defaults = {
|
||||
'flag': 'C',
|
||||
}
|
||||
|
||||
def onchange_employee_id(self, cr, uid, ids, ddate, employee_id, context=None):
|
||||
vals = {}
|
||||
slip_pool = self.pool.get('hr.payslip')
|
||||
if employee_id:
|
||||
dates = prev_bounds(ddate)
|
||||
sids = False
|
||||
sids = slip_pool.search(cr, uid, [('paid','=',False),('state','=','confirm'),('date','>=',dates[0]), ('employee_id','=',employee_id), ('date','<=',dates[1])], context=context)
|
||||
if sids:
|
||||
slip = slip_pool.browse(cr, uid, sids[0], context=context)
|
||||
vals['name'] = slip.employee_id.identification_id
|
||||
# vals['amount'] = slip.net + slip.other_pay #PSI@ Need to improve (slip.net should replace by someother value)
|
||||
# vals['bysal'] = slip.net #PSI@ Need to improve (slip.net should replace by someother value)
|
||||
return {
|
||||
'value':vals
|
||||
}
|
||||
payroll_advice_line()
|
||||
|
||||
class contrib_register(osv.osv):
|
||||
'''
|
||||
Contribution Register
|
||||
|
@ -423,158 +314,54 @@ class contrib_register_line(osv.osv):
|
|||
}
|
||||
contrib_register_line()
|
||||
|
||||
class payment_category(osv.osv):
|
||||
class hr_salary_head_type(osv.osv):
|
||||
"""
|
||||
Allowance, Deduction Heads
|
||||
House Rent Allowance, Medical Allowance, Food Allowance
|
||||
Professional Tax, Advance TDS, Providend Funds, etc
|
||||
Salary Head Type
|
||||
"""
|
||||
|
||||
_name = 'hr.allounce.deduction.categoty'
|
||||
_description = 'Allowance Deduction Heads'
|
||||
_name = 'hr.salary.head.type'
|
||||
_description = 'Salary Head Type'
|
||||
_columns = {
|
||||
'name':fields.char('Category Name', size=64, required=True, readonly=False),
|
||||
'code':fields.char('Category Code', size=64, required=True, readonly=False),
|
||||
'type':fields.selection([
|
||||
('allowance','Allowance'),
|
||||
('deduction','Deduction'),
|
||||
('leaves','Leaves'),
|
||||
('advance','Advance'),
|
||||
('loan','Loan'),
|
||||
('installment','Loan Installment'),
|
||||
('otherpay','Other Payment'),
|
||||
('otherdeduct','Other Deduction'),
|
||||
],'Type', select=True, required=True),
|
||||
'base':fields.text('Based on', required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
|
||||
'condition':fields.char('Condition', size=1024, required=True, readonly=False, help='Applied this head for calculation if condition is true'),
|
||||
'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'),
|
||||
'name':fields.char('Type Name', size=64, required=True, readonly=False),
|
||||
'code':fields.char('Type Code', size=64, required=True, readonly=False),
|
||||
}
|
||||
|
||||
hr_salary_head_type()
|
||||
|
||||
class hr_salary_head(osv.osv):
|
||||
"""
|
||||
Salary Head
|
||||
"""
|
||||
|
||||
_name = 'hr.salary.head'
|
||||
_description = 'Salary Head'
|
||||
_columns = {
|
||||
'name':fields.char('Salary Head', size=64, required=True, readonly=False),
|
||||
'code':fields.char('Salary Head Code', size=64, required=True, readonly=False),
|
||||
'type':fields.many2one('hr.salary.head.type', 'Type', required=True, help="It is used only for the reporting purpose."),
|
||||
'note': fields.text('Description'),
|
||||
'user_id':fields.char('User', size=64, required=False, readonly=False),
|
||||
'state':fields.char('Label', size=64, required=False, readonly=False),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'contribute_ids':fields.one2many('company.contribution', 'category_id', 'Contributions', required=False),
|
||||
'dispaly_payslip_report': fields.boolean('Display on Payslip Report', help="Used for the display of head on Payslip Report."),
|
||||
# 'computation_based':fields.selection([
|
||||
# ('rules','List of Rules'),
|
||||
# ('exp','Expression'),
|
||||
# ],'Computation Based On', select=True, required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'condition': lambda *a: 'True',
|
||||
'base': lambda *a:'basic',
|
||||
'sequence': lambda *a:5,
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
'dispaly_payslip_report': 1,
|
||||
}
|
||||
payment_category()
|
||||
|
||||
class company_contribution(osv.osv):
|
||||
"""
|
||||
Company contribution
|
||||
Allows to configure company contribution for some taxes
|
||||
"""
|
||||
|
||||
_name = 'company.contribution'
|
||||
_description = "Company Contribution"
|
||||
_columns = {
|
||||
'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Heads', required=False),
|
||||
'name':fields.char('Name', size=256, required=True, readonly=False),
|
||||
'code':fields.char('Code', size=64, required=True, readonly=False),
|
||||
'gratuity':fields.boolean('Use for Gratuity ?', required=False),
|
||||
'line_ids':fields.one2many('company.contribution.line', 'contribution_id', 'Calculations', required=False),
|
||||
'register_id':fields.property(
|
||||
'hr.contibution.register',
|
||||
type='many2one',
|
||||
relation='hr.contibution.register',
|
||||
string="Contribution Register",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="Contribution register based on company",
|
||||
required=False
|
||||
),
|
||||
'amount_type':fields.selection([
|
||||
('fix','Fixed Amount'),
|
||||
('per','Percentage'),
|
||||
('func','Function Calculation'),
|
||||
],'Amount Type', select=True),
|
||||
'contribute_per':fields.float('Contribution', digits=(16, 4), help='Define Company contribution ratio 1.00=100% contribution.'),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'active':fields.boolean('Active', required=False),
|
||||
'note': fields.text('Description'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'amount_type': lambda *a:'fix',
|
||||
'active': lambda *a:True,
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
}
|
||||
|
||||
def _execute_function(self, cr, uid, id, value, context=None):
|
||||
"""
|
||||
self: pointer to self object
|
||||
cr: cursor to database
|
||||
uid: user id of current executer
|
||||
"""
|
||||
line_pool = self.pool.get('company.contribution.line')
|
||||
res = 0
|
||||
ids = line_pool.search(cr, uid, [('category_id','=',id), ('to_val','>=',value),('from_val','<=',value)], context=context)
|
||||
if not ids:
|
||||
ids = line_pool.search(cr, uid, [('category_id','=',id), ('from','<=',value)], context=context)
|
||||
if not ids:
|
||||
res = 0
|
||||
else:
|
||||
res = line_pool.browse(cr, uid, ids, context=context)[0].value
|
||||
return res
|
||||
|
||||
def compute(self, cr, uid, id, value, context=None):
|
||||
contrib = self.browse(cr, uid, id, context=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):
|
||||
"""
|
||||
Company contribution lines
|
||||
"""
|
||||
|
||||
_name = 'company.contribution.line'
|
||||
_description = 'Allowance Deduction Category'
|
||||
_order = 'sequence'
|
||||
_columns = {
|
||||
'contribution_id':fields.many2one('company.contribution', 'Contribution', required=False),
|
||||
'name':fields.char('Name', size=64, required=False, readonly=False),
|
||||
'from_val': fields.float('From', digits=(16, 4)),
|
||||
'to_val': fields.float('To', digits=(16, 4)),
|
||||
'amount_type':fields.selection([
|
||||
('fix','Fixed Amount'),
|
||||
],'Amount Type', select=True),
|
||||
'sequence':fields.integer('Sequence'),
|
||||
'value': fields.float('Value', digits=(16, 4)),
|
||||
}
|
||||
company_contribution_line()
|
||||
hr_salary_head()
|
||||
|
||||
class hr_holidays_status(osv.osv):
|
||||
|
||||
_inherit = "hr.holidays.status"
|
||||
_columns = {
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'type':fields.selection([
|
||||
('paid','Paid Holiday'),
|
||||
('unpaid','Un-Paid Holiday'),
|
||||
('halfpaid','Half-Pay Holiday')
|
||||
], string='Payment'),
|
||||
'head_id': fields.many2one('hr.allounce.deduction.categoty', 'Payroll Head', domain=[('type','=','deduction')]),
|
||||
'code': fields.related('head_id','code', type='char', relation='hr.allounce.deduction.categoty', string='Code'),
|
||||
# 'code':fields.char('Code', size=64, required=False, readonly=False),
|
||||
}
|
||||
_defaults = {
|
||||
'type': lambda *args: 'unpaid',
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
'code':fields.char('Code', size=64, required=False, readonly=False, help="It is used to define the code for Leave Type which will then be used in Salary Rules."),
|
||||
}
|
||||
hr_holidays_status()
|
||||
|
||||
|
@ -607,25 +394,19 @@ class hr_payslip(osv.osv):
|
|||
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'):
|
||||
elif line.amount_type in ('fix'):
|
||||
amount = line.amount
|
||||
cd = line.category_id.code.lower()
|
||||
obj[cd] = amount
|
||||
contrib = 0.0
|
||||
if line.type == 'allowance':
|
||||
if line.type.name == 'allowance':
|
||||
allow += amount
|
||||
others += contrib
|
||||
amount -= contrib
|
||||
elif line.type == 'deduction':
|
||||
elif line.type.name == 'deduction':
|
||||
deduct += amount
|
||||
others -= contrib
|
||||
amount += contrib
|
||||
elif line.type == 'advance':
|
||||
others += amount
|
||||
elif line.type == 'loan':
|
||||
others += amount
|
||||
elif line.type == 'otherpay':
|
||||
others += amount
|
||||
slip_line_obj.write(cr, uid, [line.id], {'total':amount}, context=context)
|
||||
|
||||
record = {
|
||||
|
@ -733,7 +514,7 @@ class hr_payslip(osv.osv):
|
|||
return True
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context=None):
|
||||
register_pool = self.pool.get('company.contribution')
|
||||
# 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):
|
||||
|
@ -1399,12 +1180,12 @@ class hr_payslip_line(osv.osv):
|
|||
def onchange_category(self, cr, uid, ids, category_id):
|
||||
res = {}
|
||||
if category_id:
|
||||
category = self.pool.get('hr.allounce.deduction.categoty').browse(cr, uid, category_id)
|
||||
category = self.pool.get('hr.salary.head').browse(cr, uid, category_id)
|
||||
res.update({
|
||||
'sequence':category.sequence,
|
||||
'name':category.name,
|
||||
'code':category.code,
|
||||
'type':category.type
|
||||
'type':category.type.id
|
||||
})
|
||||
return {'value':res}
|
||||
|
||||
|
@ -1417,75 +1198,77 @@ class hr_payslip_line(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'slip_id':fields.many2one('hr.payslip', 'Pay Slip', required=False),
|
||||
'function_id':fields.many2one('hr.payroll.structure', 'Function', 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),
|
||||
'base':fields.char('Formula', size=1024, required=False, readonly=False),
|
||||
'code':fields.char('Code', size=64, required=False, readonly=False),
|
||||
'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Category', required=True),
|
||||
'type':fields.selection([
|
||||
('allowance','Allowance'),
|
||||
('deduction','Deduction'),
|
||||
('leaves','Leaves'),
|
||||
('advance','Advance'),
|
||||
('loan','Loan'),
|
||||
('installment','Loan Installment'),
|
||||
('otherpay','Other Payment'),
|
||||
('otherdeduct','Other Deduction'),
|
||||
],'Type', select=True, required=True),
|
||||
#TODO: link type to the category_id instead of define again
|
||||
#'type': fields.related('category_id','type', type='selection', size=64, relation='hr.allounce.deduction.categoty', string='Type', store=True),
|
||||
'category_id':fields.many2one('hr.salary.head', 'Category', required=True),
|
||||
'type':fields.many2one('hr.salary.head.type', 'Type', required=True),
|
||||
'amount_type':fields.selection([
|
||||
('per','Percentage (%)'),
|
||||
('fix','Fixed Amount'),
|
||||
('func','Function Value'),
|
||||
('code','Python Code'),
|
||||
],'Amount Type', select=True, required=True),
|
||||
'amount': fields.float('Amount / Percentage', digits=(16, 4)),
|
||||
'total': fields.float('Sub Total', readonly=True, digits_compute=dp.get_precision('Account')),
|
||||
'company_contrib': fields.float('Company Contribution', readonly=True, digits=(16, 4)),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'note':fields.text('Description'),
|
||||
'line_ids':fields.one2many('hr.payslip.line.line', 'slipline_id', 'Calculations', required=False)
|
||||
}
|
||||
_order = 'sequence'
|
||||
_defaults = {
|
||||
'amount_type': lambda *a: 'per'
|
||||
}
|
||||
|
||||
def execute_function(self, cr, uid, id, value, context=None):
|
||||
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
|
||||
|
||||
res = line_pool.browse(cr, uid, ids, context=context)[-1].value
|
||||
return res
|
||||
|
||||
hr_payslip_line()
|
||||
|
||||
class hr_payslip_line_line(osv.osv):
|
||||
'''
|
||||
Function Line
|
||||
'''
|
||||
class hr_salary_rule(osv.osv):
|
||||
|
||||
_name = 'hr.payslip.line.line'
|
||||
_description = 'Function Line'
|
||||
_order = 'sequence'
|
||||
_inherit = 'hr.payslip.line'
|
||||
_name = 'hr.salary.rule'
|
||||
_columns = {
|
||||
'slipline_id':fields.many2one('hr.payslip.line', 'Slip Line', required=False),
|
||||
'name':fields.char('Name', size=64, required=False, readonly=False),
|
||||
'from_val': fields.float('From', digits=(16, 4)),
|
||||
'to_val': fields.float('To', digits=(16, 4)),
|
||||
'amount_type':fields.selection([
|
||||
('fix','Fixed Amount'),
|
||||
],'Amount Type', select=True),
|
||||
'sequence':fields.integer('Sequence'),
|
||||
'value': fields.float('Value', digits=(16, 4)),
|
||||
'appears_on_payslip': fields.boolean('Appears on Payslip', help="Used for the display of rule on payslip"),
|
||||
'condition_range_min': fields.float('Minimum Range', required=False, help="The minimum amount, applied for this rule."),
|
||||
'condition_range_max': fields.float('Maximum Range', required=False, help="The maximum amount, applied for this rule."),
|
||||
'sal_rule_id':fields.many2one('hr.salary.rule', 'Parent Salary Structure', select=True),
|
||||
'child_depend':fields.boolean('Children Rule'),
|
||||
'child_ids':fields.one2many('hr.salary.rule', 'sal_rule_id', 'Child Salary Sructure'),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'register_id':fields.property(
|
||||
'hr.contibution.register',
|
||||
type='many2one',
|
||||
relation='hr.contibution.register',
|
||||
string="Contribution Register",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="Contribution register based on company",
|
||||
required=False
|
||||
),
|
||||
'gratuity':fields.boolean('Use for Gratuity ?', required=False),
|
||||
'computational_expression':fields.text('Computational Expression', required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
|
||||
'conditions':fields.char('Condition', size=1024, required=True, readonly=False, help='Applied this head for calculation if condition is true'),
|
||||
'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'),
|
||||
'active':fields.boolean('Active', required=False),
|
||||
}
|
||||
_defaults = {
|
||||
'conditions': 'True',
|
||||
'computational_expression': 'basic',
|
||||
'sequence': 5,
|
||||
'appears_on_payslip': True,
|
||||
'active': True,
|
||||
}
|
||||
|
||||
hr_salary_rule()
|
||||
|
||||
class hr_payroll_structure(osv.osv):
|
||||
|
||||
_inherit = 'hr.payroll.structure'
|
||||
_columns = {
|
||||
'rule_ids':fields.many2many('hr.salary.rule', 'hr_structure_salary_rule_rel', 'struct_id', 'rule_id', 'Salary Rules', readonly=False),
|
||||
}
|
||||
hr_payslip_line_line()
|
||||
|
||||
hr_payroll_structure()
|
||||
|
||||
class hr_employee(osv.osv):
|
||||
'''
|
||||
|
@ -1495,13 +1278,13 @@ class hr_employee(osv.osv):
|
|||
_inherit = 'hr.employee'
|
||||
_description = 'Employee'
|
||||
|
||||
|
||||
_columns = {
|
||||
'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),
|
||||
'otherid': fields.char('Other Id', size=64),
|
||||
# 'basic': fields.function(_calculate_salary, method=True, multi='dc', type='float', string='Basic Salary', digits=(14,2)),
|
||||
#FIXME the function has to make the sum of basic field of all the hr.contract for this employee that have date_start < now() and now() < date_stop or not date_stop
|
||||
# 'emp_sal_rule_ids':fields.many2many('hr.salary.rule', 'hr_emp_salary_rule_rel', 'employee_id', 'rule_id', 'Salary Rules', readonly=False),
|
||||
}
|
||||
hr_employee()
|
||||
|
||||
|
|
|
@ -1,119 +1,130 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="HRA" model="hr.allounce.deduction.categoty">
|
||||
|
||||
<record id="AL" model="hr.salary.head.type">
|
||||
<field name="name">Allowance</field>
|
||||
<field name="code">ALW</field>
|
||||
</record>
|
||||
|
||||
<record id="DED" model="hr.salary.head.type">
|
||||
<field name="name">Deduction</field>
|
||||
<field name="code">DED</field>
|
||||
</record>
|
||||
|
||||
<record id="HRA" model="hr.salary.head">
|
||||
<field name="code">HRA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="name">House Rent Allowance</field>
|
||||
<field name="sequence" eval="5"/>
|
||||
</record>
|
||||
|
||||
<record id="CA" model="hr.allounce.deduction.categoty">
|
||||
<record id="CA" model="hr.salary.head">
|
||||
<field name="code">CA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="name">Conveyance Allowance</field>
|
||||
<field name="sequence" eval="10"/>
|
||||
</record>
|
||||
|
||||
<record id="MA" model="hr.allounce.deduction.categoty">
|
||||
<record id="MA" model="hr.salary.head">
|
||||
<field name="code">MA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="name">Medical Allowance</field>
|
||||
<field name="sequence" eval="15"/>
|
||||
</record>
|
||||
|
||||
<record id="TELA" model="hr.allounce.deduction.categoty">
|
||||
<record id="TELA" model="hr.salary.head">
|
||||
<field name="code">TELA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="name">Telephone Allowance</field>
|
||||
<field name="sequence" eval="20"/>
|
||||
</record>
|
||||
|
||||
<record id="LTA" model="hr.allounce.deduction.categoty">
|
||||
<record id="LTA" model="hr.salary.head">
|
||||
<field name="code">LTA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="name">Leave Travel Allowance</field>
|
||||
<field name="sequence" eval="25"/>
|
||||
</record>
|
||||
|
||||
<record id="NA" model="hr.allounce.deduction.categoty">
|
||||
<record id="NA" model="hr.salary.head">
|
||||
<field name="code">NA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="name">Newspaper Allowance</field>
|
||||
<field name="sequence" eval="30"/>
|
||||
</record>
|
||||
|
||||
<record id="TA" model="hr.allounce.deduction.categoty">
|
||||
<record id="TA" model="hr.salary.head">
|
||||
<field name="code">TA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="name">Traveling Allowance</field>
|
||||
<field name="sequence" eval="35"/>
|
||||
</record>
|
||||
|
||||
<record id="FA" model="hr.allounce.deduction.categoty">
|
||||
<record id="FA" model="hr.salary.head">
|
||||
<field name="code">FA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="name">Food Allowance</field>
|
||||
<field name="sequence" eval="40"/>
|
||||
</record>
|
||||
|
||||
<record id="DA" model="hr.allounce.deduction.categoty">
|
||||
<record id="DA" model="hr.salary.head">
|
||||
<field name="code">DA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="name">Dearness Allowance</field>
|
||||
<field name="sequence" eval="45"/>
|
||||
</record>
|
||||
|
||||
<record id="PF" model="hr.allounce.deduction.categoty">
|
||||
<record id="PF" model="hr.salary.head">
|
||||
<field name="code">PF</field>
|
||||
<field name="type">deduction</field>
|
||||
<field name="type" ref="DED"/>
|
||||
<field name="name">Provident Fund</field>
|
||||
<field name="sequence" eval="50"/>
|
||||
</record>
|
||||
|
||||
<record id="PT" model="hr.allounce.deduction.categoty">
|
||||
<record id="PT" model="hr.salary.head">
|
||||
<field name="code">PT</field>
|
||||
<field name="type">deduction</field>
|
||||
<field name="type" ref="DED"/>
|
||||
<field name="name">Professional Tax</field>
|
||||
<field name="sequence" eval="55"/>
|
||||
</record>
|
||||
|
||||
<record id="WF" model="hr.allounce.deduction.categoty">
|
||||
<record id="WF" model="hr.salary.head">
|
||||
<field name="code">WF</field>
|
||||
<field name="type">deduction</field>
|
||||
<field name="type" ref="DED"/>
|
||||
<field name="name">Welfare</field>
|
||||
<field name="sequence" eval="60"/>
|
||||
</record>
|
||||
|
||||
<record id="TDS" model="hr.allounce.deduction.categoty">
|
||||
<record id="TDS" model="hr.salary.head">
|
||||
<field name="code">TDS</field>
|
||||
<field name="type">deduction</field>
|
||||
<field name="type" ref="DED"/>
|
||||
<field name="name">Tax Deduct at Source</field>
|
||||
<field name="sequence" eval="65"/>
|
||||
</record>
|
||||
|
||||
<record id="LWP" model="hr.allounce.deduction.categoty">
|
||||
<record id="LWP" model="hr.salary.head">
|
||||
<field name="code">LWP</field>
|
||||
<field name="type">deduction</field>
|
||||
<field name="type" ref="DED"/>
|
||||
<field name="name">Leave without pay</field>
|
||||
<field name="sequence" eval="70"/>
|
||||
</record>
|
||||
|
||||
<record id="FC" model="hr.allounce.deduction.categoty">
|
||||
<record id="FC" model="hr.salary.head">
|
||||
<field name="code">FC</field>
|
||||
<field name="type">deduction</field>
|
||||
<field name="type" ref="DED"/>
|
||||
<field name="name">Food Coupons</field>
|
||||
<field name="sequence" eval="75"/>
|
||||
</record>
|
||||
|
||||
<record id="ESI" model="hr.allounce.deduction.categoty">
|
||||
<record id="ESI" model="hr.salary.head">
|
||||
<field name="code">ESI</field>
|
||||
<field name="type">deduction</field>
|
||||
<field name="type" ref="DED"/>
|
||||
<field name="name">Employee's State Insurance</field>
|
||||
<field name="sequence" eval="80"/>
|
||||
</record>
|
||||
|
||||
<record id="OTHERD" model="hr.allounce.deduction.categoty">
|
||||
<!-- <record id="OTHERD" model="hr.allounce.deduction.categoty">
|
||||
<field name="code">OTHERD</field>
|
||||
<field name="type">otherdeduct</field>
|
||||
<field name="name">Other Deduction</field>
|
||||
|
@ -125,7 +136,7 @@
|
|||
<field name="type">otherpay</field>
|
||||
<field name="name">Other Taxable Allowance</field>
|
||||
<field name="sequence" eval="90"/>
|
||||
</record>
|
||||
</record>-->
|
||||
|
||||
<!-- Contract Wage Types -->
|
||||
<record id="hr_contract_monthly_basic" model="hr.contract.wage.type">
|
||||
|
|
|
@ -2,57 +2,61 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Payroll Structure -->
|
||||
<record id="structure_001" model="hr.payroll.structure">
|
||||
<field name="code">ME</field>
|
||||
<field name="name">Marketing Executive</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<!-- Salary Rules -->
|
||||
|
||||
<record id="hr_payslip_line_houserantallowance1" model="hr.payslip.line">
|
||||
<record id="hr_payslip_line_houserantallowance1" model="hr.salary.rule">
|
||||
<field name="amount_type">per</field>
|
||||
<field eval="5" name="sequence"/>
|
||||
<field eval="0.4" name="amount"/>
|
||||
<field name="code">HRA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="category_id" ref="hr_payroll.HRA"/>
|
||||
<field name="function_id" ref="hr_payroll.structure_001"/>
|
||||
<!-- <field name="function_id" ref="hr_payroll.structure_001"/>-->
|
||||
<field name="name">House Rent Allowance</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payslip_line_convanceallowance1" model="hr.payslip.line">
|
||||
<record id="hr_payslip_line_convanceallowance1" model="hr.salary.rule">
|
||||
<field name="amount_type">fix</field>
|
||||
<field eval="10" name="sequence"/>
|
||||
<field eval="800.0" name="amount"/>
|
||||
<field name="code">CA</field>
|
||||
<field name="type">allowance</field>
|
||||
<field name="type" ref="AL"/>
|
||||
<field name="category_id" ref="hr_payroll.CA"/>
|
||||
<field name="function_id" ref="hr_payroll.structure_001"/>
|
||||
<!--<field name="function_id" ref="hr_payroll.structure_001"/>-->
|
||||
<field name="name">Conveyance Allowance</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payslip_line_professionaltax1" model="hr.payslip.line">
|
||||
<record id="hr_payslip_line_professionaltax1" model="hr.salary.rule">
|
||||
<field name="amount_type">fix</field>
|
||||
<field eval="15" name="sequence"/>
|
||||
<field eval="200.0" name="amount"/>
|
||||
<field name="code">PT</field>
|
||||
<field name="type">deduction</field>
|
||||
<field name="type" ref="DED"/>
|
||||
<field name="category_id" ref="hr_payroll.PT"/>
|
||||
<field name="function_id" ref="hr_payroll.structure_001"/>
|
||||
<!-- <field name="function_id" ref="hr_payroll.structure_001"/>-->
|
||||
<field name="name">Professional Tax</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payslip_line_providentfund1" model="hr.payslip.line">
|
||||
<record id="hr_payslip_line_providentfund1" model="hr.salary.rule">
|
||||
<field name="amount_type">per</field>
|
||||
<field eval="20" name="sequence"/>
|
||||
<field eval="0.125" name="amount"/>
|
||||
<field name="code">PF</field>
|
||||
<field name="type">deduction</field>
|
||||
<field name="type" ref="DED"/>
|
||||
<field name="category_id" ref="hr_payroll.PF"/>
|
||||
<field name="function_id" ref="hr_payroll.structure_001"/>
|
||||
<!-- <field name="function_id" ref="hr_payroll.structure_001"/>-->
|
||||
<field name="name">Provident Fund</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Salary Structure -->
|
||||
|
||||
<record id="structure_001" model="hr.payroll.structure">
|
||||
<field name="code">ME</field>
|
||||
<field name="name">Marketing Executive</field>
|
||||
<field eval="[(6, 0, [ref('hr_payslip_line_houserantallowance1'), ref('hr_payslip_line_convanceallowance1'),ref('hr_payslip_line_professionaltax1'),ref('hr_payslip_line_providentfund1')])]" name="rule_ids"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<!-- Employee -->
|
||||
<record id="hr_employee_bonamy0" model="hr.employee">
|
||||
<field eval="0" name="manager"/>
|
||||
|
@ -64,7 +68,7 @@
|
|||
</record>
|
||||
|
||||
<!-- Employee Contract -->
|
||||
<record id="hr_contract_firstcontract1" model="hr.contract">
|
||||
<!-- <record id="hr_contract_firstcontract1" model="hr.contract">
|
||||
<field name="wage_type_id" ref="hr_contract.hr_contract_monthly_gross"/>
|
||||
<field name="name">First Contract</field>
|
||||
<field name="type_id" ref="hr_contract.hr_contract_type_emp"/>
|
||||
|
@ -76,9 +80,9 @@
|
|||
<field eval="4000.0" name="wage"/>
|
||||
<field eval="5" name="working_days_per_week"/>
|
||||
</record>
|
||||
|
||||
-->
|
||||
<!-- Payslip -->
|
||||
<record id="hr_payslip_salaryslipofbonamyforjune0" model="hr.payslip">
|
||||
<!-- <record id="hr_payslip_salaryslipofbonamyforjune0" model="hr.payslip">
|
||||
<field name="number">SLIP/001</field>
|
||||
<field name="deg_id" ref="hr_payroll.structure_001"/>
|
||||
<field name="employee_id" ref="hr_employee_bonamy0"/>
|
||||
|
@ -86,6 +90,6 @@
|
|||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="date" eval="time.strftime('%Y-%m')+'-5'"/>
|
||||
<field name="name" eval="'Salary Slip of Bonamy for June-'+time.strftime('%Y')"/>
|
||||
</record>
|
||||
</record>-->
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
<!--<xpath expr="/form/notebook/page[@string='Categories']" position="after">
|
||||
<page string="Salary Rules">
|
||||
<field name="emp_sal_rule_ids" nolabel="1" widget="one2many_list"/>
|
||||
</page>
|
||||
</xpath>-->
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -61,7 +66,7 @@
|
|||
<tree string="Employee Function">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="line_ids"/>
|
||||
<field name="rule_ids"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
@ -76,49 +81,13 @@
|
|||
<group col="6" colspan="4">
|
||||
<field name="name" colspan="4" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Salary Structure">
|
||||
<field name="line_ids" nolabel="1" colspan="4">
|
||||
<form string="Payslip Line">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" colspan="4" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Calculations"/>
|
||||
<field name="category_id" on_change="onchange_category(category_id)"/>
|
||||
<field name="type"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="amount" on_change="onchange_amount(amount, amount_type)" attrs="{'readonly':[('amount_type','=','func')]}"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Company contribution"/>
|
||||
<field name="company_contrib"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Function">
|
||||
<field name="line_ids" colspan="4" nolabel="1" attrs="{'readonly':[('amount_type','!=','func')]}">
|
||||
<tree string="Function Arguments" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
<field name="from_val"/>
|
||||
<field name="to_val"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="value"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Description">
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Salary Rules">
|
||||
<field colspan="4" name="rule_ids" nolabel="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -154,10 +123,7 @@
|
|||
</group>
|
||||
<group colspan="2">
|
||||
<separator colspan="2" string="Payroll Configurtion"/><newline/>
|
||||
<field name="type"/><newline/>
|
||||
<field name="head_id"/><newline/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection" select="2"/><newline/>
|
||||
<field name="code" readonly="True"/>
|
||||
<field name="code" />
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
|
@ -207,18 +173,6 @@
|
|||
<field name="company_contrib"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Function">
|
||||
<field name="line_ids" colspan="4" nolabel="1" attrs="{'readonly':[('amount_type','!=','func')]}">
|
||||
<tree string="Function Arguments" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
<field name="from_val"/>
|
||||
<field name="to_val"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="value"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Description">
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
|
@ -290,18 +244,6 @@
|
|||
<field name="company_contrib"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Function">
|
||||
<field name="line_ids" colspan="4" nolabel="1" attrs="{'readonly':[('amount_type','!=','func')]}">
|
||||
<tree string="Function Arguments" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
<field name="from_val"/>
|
||||
<field name="to_val"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="value"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Description">
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
|
@ -319,7 +261,6 @@
|
|||
<field name="basic"/>
|
||||
<field name="allounce"/>
|
||||
<field name="deduction"/>
|
||||
<field name="other_pay"/>
|
||||
<field name="grows"/>
|
||||
<field name="net"/>-->
|
||||
<field name="total_pay"/>
|
||||
|
@ -395,91 +336,39 @@
|
|||
<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>
|
||||
<field name="model">hr.allounce.deduction.categoty</field>
|
||||
<record id="hr_salary_head_form" model="ir.ui.view">
|
||||
<field name="name">hr.salary.head.form</field>
|
||||
<field name="model">hr.salary.head</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Salary Heads">
|
||||
<group col="6" colspan="6">
|
||||
<group col="3" colspan="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="type" select="1"/>
|
||||
<group col="2" colspan="4">
|
||||
<separator colspan="4" string="Based on"/>
|
||||
<field name="base" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Dynamic Computation"/>
|
||||
<field name="condition"/>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
<field name="dispaly_payslip_report"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Description">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Contribution">
|
||||
<field name="contribute_ids" colspan="4" nolabel="1" height="300">
|
||||
<form string="Company Contribution">
|
||||
<group col="6" colspan="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Contributions"/>
|
||||
<field name="amount_type" attrs="{'required': [('contribute','=',True)]}"/>
|
||||
<field name="contribute_per" attrs="{'required': [('contribute','=',True)], 'readonly':[(('amount_type','=','func'))]}"/>
|
||||
<field name="register_id" attrs="{'required': [('contribute','=',True)]}"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Other Information"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Function" attrs="{'readonly': [('amount_type','!=','func')]}">
|
||||
<field name="line_ids" colspan="4" nolabel="1">
|
||||
<tree string="Function Arguments" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="from_val"/>
|
||||
<field name="to_val"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="value"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Description">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="hr_allounce_deduction_categoty_tree" model="ir.ui.view">
|
||||
<field name="name">hr.allounce.deduction.categoty.tree</field>
|
||||
<field name="model">hr.allounce.deduction.categoty</field>
|
||||
<record id="hr_salary_head_tree" model="ir.ui.view">
|
||||
<field name="name">hr.salary.head.tree</field>
|
||||
<field name="model">hr.salary.head</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Salary Heads">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="type"/>
|
||||
<field name="base"/>
|
||||
<field name="condition"/>
|
||||
<field name="sequence"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_allounce_deduction_categoty_filter" model="ir.ui.view">
|
||||
<field name="name">hr.allounce.deduction.categoty.select</field>
|
||||
<field name="model">hr.allounce.deduction.categoty</field>
|
||||
<record id="view_hr_salary_head_filter" model="ir.ui.view">
|
||||
<field name="name">hr.salary.head.select</field>
|
||||
<field name="model">hr.salary.head</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Salary Heads">
|
||||
|
@ -491,193 +380,26 @@
|
|||
<field name="type"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="4" groups="base.group_extended">
|
||||
<filter string="Based" icon="terp-go-month" domain="[]" context="{'group_by':'base'}"/>
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_allounce_deduction_tree" model="ir.actions.act_window">
|
||||
<record id="action_hr_salary_head" model="ir.actions.act_window">
|
||||
<field name="name">Salary Heads</field>
|
||||
<field name="res_model">hr.allounce.deduction.categoty</field>
|
||||
<field name="res_model">hr.salary.head</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="hr_allounce_deduction_categoty_tree"/>
|
||||
<field name="search_view_id" ref="view_allounce_deduction_categoty_filter"/>
|
||||
<field name="view_id" ref="hr_salary_head_tree"/>
|
||||
<field name="search_view_id" ref="view_hr_salary_head_filter"/>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_hr_allounce_deduction_tree"
|
||||
action="hr_allounce_deduction_tree"
|
||||
id="menu_hr_salary_head"
|
||||
action="action_hr_salary_head"
|
||||
parent="payroll_configure"
|
||||
/>
|
||||
<!-- End Payment Heads -->
|
||||
|
||||
<!-- Company Contribution -->
|
||||
<record id="hr_company_contribution_form" model="ir.ui.view">
|
||||
<field name="name">company.contribution.form</field>
|
||||
<field name="model">company.contribution</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Company Contribution">
|
||||
<group col="6" colspan="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="category_id"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Contributions"/>
|
||||
<field name="amount_type" attrs="{'required': [('contribute','=',True)]}"/>
|
||||
<field name="contribute_per" attrs="{'required': [('contribute','=',True)], 'readonly':[(('amount_type','=','func'))]}"/>
|
||||
<field name="register_id" attrs="{'required': [('contribute','=',True)]}"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Other Information"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Function" attrs="{'readonly': [('amount_type','!=','func')]}">
|
||||
<field name="line_ids" colspan="4" nolabel="1">
|
||||
<tree string="Function Arguments" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="from_val"/>
|
||||
<field name="to_val"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="value"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Description">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="hr_company_contribution_tree" model="ir.ui.view">
|
||||
<field name="name">company.contribution.tree</field>
|
||||
<field name="model">company.contribution</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Company Contribution">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="contribute_per"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="register_id"/>
|
||||
<field name="category_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<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>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Company Contribution">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-document-new" string="Fixed Amount" domain="[('amount_type','=','fix')]" help="Draft Slip"/>
|
||||
<filter icon="terp-camera_test" string="Function Calculation" domain="[('amount_type','=','func')]" help="Posted Slip"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="contribute_per"/>
|
||||
<field name="register_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group col="8" colspan="4" expand="0" string="Group By...">
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" name="amount_type" context="{'group_by':'amount_type'}"/>
|
||||
<filter string="Category" name="category_id" icon="terp-stock_symbol-selection" context="{'group_by':'category_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_hr_company_contribution_tree" model="ir.actions.act_window">
|
||||
<field name="name">Company Contributions</field>
|
||||
<field name="res_model">company.contribution</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="hr_company_contribution_tree"/>
|
||||
<field name="search_view_id" ref="view_hr_company_contribution_filter"/>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_hr_company_contribution_tree"
|
||||
action="action_hr_company_contribution_tree"
|
||||
parent="payroll_configure"
|
||||
/>
|
||||
<!-- End Company Contribution -->
|
||||
|
||||
<record id="view_hr_bank_advice_tree" model="ir.ui.view">
|
||||
<field name="name">hr.payroll.advice.tree</field>
|
||||
<field name="model">hr.payroll.advice</field>
|
||||
<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="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_bank_advice_form" model="ir.ui.view">
|
||||
<field name="name">hr.payroll.advice.form</field>
|
||||
<field name="model">hr.payroll.advice</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Bank Advice">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" colspan="4" select="1"/>
|
||||
<field name="number" select="1"/>
|
||||
<field name="register_id"/>
|
||||
<field name="bank_id"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Paymeny Lines">
|
||||
<field name="line_ids" colspan="4" nolabel="1">
|
||||
<tree string="Payment Lines" editable="bottom">
|
||||
<field name="employee_id" on_change="onchange_employee_id(parent.date, employee_id)"/>
|
||||
<field name="name"/>
|
||||
<field name="amount"/>
|
||||
<field name="bysal"/>
|
||||
<field name="flag"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Letter Content">
|
||||
<group colspan="4" col="6">
|
||||
<field name="company_id" on_change="onchange_company_id(company_id)" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="chaque_nos"/>
|
||||
<field name="date" select="1"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Letter Details"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="6" colspan="6">
|
||||
<field name="state"/>
|
||||
<button name="cancel_sheet" string="Cancel Sheet" states="draft" icon="gtk-cancel" type="object"/>
|
||||
<button name="confirm_sheet" icon="gtk-apply" string="Confirm Sheet" states="draft" type="object"/>
|
||||
<button name="set_to_draft" string="Set to Draft" icon="gtk-convert" states="cancel,confirm" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_view_hr_bank_advice_tree" model="ir.actions.act_window">
|
||||
<field name="name">Payment Advice</field>
|
||||
<field name="res_model">hr.payroll.advice</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_hr_bank_advice_tree"/>
|
||||
</record>
|
||||
<menuitem
|
||||
action="action_view_hr_bank_advice_tree"
|
||||
id="hr_menu_payment_advice"
|
||||
parent="menu_hr_root_payroll"
|
||||
/>
|
||||
|
||||
<record id="view_hr_payroll_register_tree" model="ir.ui.view">
|
||||
<field name="name">hr.payroll.register.tree</field>
|
||||
<field name="model">hr.payroll.register</field>
|
||||
|
@ -843,6 +565,120 @@
|
|||
id="act_hr_employee_payslip_list"
|
||||
groups="base.group_hr_manager"/>
|
||||
|
||||
<!-- Salary Rules -->
|
||||
|
||||
<record id="hr_salary_rule_tree" model="ir.ui.view">
|
||||
<field name="name">hr.salary.rule.tree</field>
|
||||
<field name="model">hr.salary.rule</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Salary Rules">
|
||||
<field name="category_id"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="type"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="amount"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="hr_salary_rule_form" model="ir.ui.view">
|
||||
<field name="name">hr.salary.rule.form</field>
|
||||
<field name="model">hr.salary.rule</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Salary Rules">
|
||||
<group col="6" colspan="6">
|
||||
<field name="name"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="active"/>
|
||||
<field name="sequence" />
|
||||
<field name="company_id"/>
|
||||
<field name="appears_on_payslip"/>
|
||||
</group>
|
||||
<group col="6" colspan="6">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Calculations"/>
|
||||
<field name="category_id" on_change="onchange_category(category_id)"/>
|
||||
<field name="type"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="condition_range_min"/>
|
||||
<field name="condition_range_max"/>
|
||||
<field name="amount" on_change="onchange_amount(amount, amount_type)" attrs="{'readonly':[('amount_type','=','func')]}"/>
|
||||
|
||||
<field name="conditions"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Company contribution"/>
|
||||
<field name="register_id"/>
|
||||
<field name="company_contrib"/>
|
||||
</group>
|
||||
<group col="2" colspan="4">
|
||||
<separator colspan="4" string="Computational Expression"/>
|
||||
<field name="computational_expression" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Child Rules" groups="base.group_extended">
|
||||
<separator colspan="4" string="Children definition"/>
|
||||
<field name="child_depend"/>
|
||||
<field colspan="4" name="child_ids" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Description">
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_salary_rule_form" model="ir.actions.act_window">
|
||||
<field name="name">Salary Rules</field>
|
||||
<field name="res_model">hr.salary.rule</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="hr_salary_rule_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_action_hr_salary_rule_form" action="action_salary_rule_form" parent="payroll_configure"/>
|
||||
|
||||
<!-- Salary Head Type -->
|
||||
<record id="salary_head_type_tree" model="ir.ui.view">
|
||||
<field name="name">salary.head.type.tree</field>
|
||||
<field name="model">hr.salary.head.type</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Salary Head Type">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="salary_head_type_form" model="ir.ui.view">
|
||||
<field name="name">salary.head.type.form</field>
|
||||
<field name="model">hr.salary.head.type</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Salary Head Type">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_salary_head_type" model="ir.actions.act_window">
|
||||
<field name="name">Salary Head Type</field>
|
||||
<field name="res_model">hr.salary.head.type</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="salary_head_type_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_action_salary_head_type" action="action_salary_head_type" parent="payroll_configure"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_hr_user",1,1,1,1
|
||||
"access_hr_payroll_register","hr.payroll.register","model_hr_payroll_register","base.group_hr_user",1,1,1,1
|
||||
"access_hr_payroll_advice","hr.payroll.advice","model_hr_payroll_advice","base.group_hr_user",1,1,1,1
|
||||
"access_hr_payroll_advice_line","hr.payroll.advice.line","model_hr_payroll_advice_line","base.group_hr_user",1,1,1,1
|
||||
"access_hr_contibution_register","hr.contibution.register","model_hr_contibution_register","base.group_hr_user",1,1,1,1
|
||||
"access_hr_contibution_register_line","hr.contibution.register.line","model_hr_contibution_register_line","base.group_hr_user",1,1,1,1
|
||||
"access_hr_allounce_deduction_category","hr.allounce.deduction.category","model_hr_allounce_deduction_categoty","base.group_hr_user",1,1,1,1
|
||||
"access_company_contribution","company.contribution","model_company_contribution","base.group_hr_user",1,1,1,1
|
||||
"access_company_contribution_line","company.contribution.line","model_company_contribution_line","base.group_hr_user",1,1,1,1
|
||||
"access_hr_salary_head","hr.salary.head","model_hr_salary_head","base.group_hr_user",1,1,1,1
|
||||
"access_hr_payslip","hr.payslip","model_hr_payslip","base.group_hr_user",1,1,1,1
|
||||
"access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","base.group_hr_user",1,1,1,1
|
||||
"access_hr_payslip_line_line","hr.payslip.line.line","model_hr_payslip_line_line","base.group_hr_user",1,1,1,1
|
||||
"access_res_partner_payroll","res.partner.payroll","base.model_res_partner","base.group_hr_user",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
|
||||
|
|
|
Loading…
Reference in New Issue