[MERGE] branch merged with trunk-payroll
bzr revid: mtr@mtr-20110412045612-7bny7k331a0y2ree bzr revid: mtr@mtr-20110412052754-7q392mf48cv0xg9b bzr revid: mtr@mtr-20110413060140-nhu313xpavd5sv2m
This commit is contained in:
@@ -51,10 +51,20 @@ class hr_payroll_structure(osv.osv):
|
||||
'note': fields.text('Description'),
|
||||
'parent_id':fields.many2one('hr.payroll.structure', 'Parent'),
|
||||
}
|
||||
|
||||
def _get_parent(self, cr, uid, context=None):
|
||||
obj_model = self.pool.get('ir.model.data')
|
||||
res = False
|
||||
data_id = obj_model.search(cr, uid, [('model', '=', 'hr.payroll.structure'), ('name', '=', 'structure_base')])
|
||||
if data_id:
|
||||
res = obj_model.browse(cr, uid, data_id[0], context=context).res_id
|
||||
return res
|
||||
|
||||
_defaults = {
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
'parent_id': _get_parent,
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
@@ -68,10 +78,12 @@ class hr_payroll_structure(osv.osv):
|
||||
|
||||
@return: returns a id of newly created record
|
||||
"""
|
||||
default = {
|
||||
if not default:
|
||||
default = {}
|
||||
default.update({
|
||||
'code': self.browse(cr, uid, id, context=context).code + "(copy)",
|
||||
'company_id': self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
|
||||
}
|
||||
})
|
||||
return super(hr_payroll_structure, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def get_all_rules(self, cr, uid, structure_ids, context=None):
|
||||
@@ -135,7 +147,7 @@ class contrib_register(osv.osv):
|
||||
Contribution Register
|
||||
'''
|
||||
|
||||
_name = 'hr.contibution.register'
|
||||
_name = 'hr.contribution.register'
|
||||
_description = 'Contribution Register'
|
||||
|
||||
_columns = {
|
||||
@@ -177,6 +189,21 @@ class hr_salary_head(osv.osv):
|
||||
|
||||
hr_salary_head()
|
||||
|
||||
class one2many_mod2(fields.one2many):
|
||||
|
||||
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if not values:
|
||||
values = {}
|
||||
res = {}
|
||||
for id in ids:
|
||||
res[id] = []
|
||||
ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id,'in',ids), ('appears_on_payslip', '=', True)], limit=self._limit)
|
||||
for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
|
||||
res[r[self._fields_id]].append( r['id'] )
|
||||
return res
|
||||
|
||||
class hr_payslip(osv.osv):
|
||||
'''
|
||||
Pay Slip
|
||||
@@ -185,37 +212,18 @@ class hr_payslip(osv.osv):
|
||||
_name = 'hr.payslip'
|
||||
_description = 'Pay Slip'
|
||||
|
||||
#TODO unused for now, cause the field is commented but we want to put it back
|
||||
# def _get_salary_rules(self, cr, uid, ids, field_names, arg=None, context=None):
|
||||
# structure_obj = self.pool.get('hr.payroll.structure')
|
||||
# contract_obj = self.pool.get('hr.contract')
|
||||
# res = {}
|
||||
# rules = []
|
||||
# contracts = []
|
||||
# structures = []
|
||||
# rule_ids = []
|
||||
# sorted_salary_heads = []
|
||||
# for record in self.browse(cr, uid, ids, context=context):
|
||||
# if record.contract_id:
|
||||
# contracts.append(record.contract_id.id)
|
||||
# else:
|
||||
# contracts = self.get_contract(cr, uid, record.employee_id, record.date, context=context)
|
||||
# for contract in contracts:
|
||||
# structures = contract_obj.get_all_structures(cr, uid, [contract], context)
|
||||
# res[record.id] = {}
|
||||
# for struct in structures:
|
||||
# rule_ids = structure_obj.get_all_rules(cr, uid, [struct], context=None)
|
||||
# for rl in rule_ids:
|
||||
# if rl[0] not in rules:
|
||||
# rules.append(rl[0])
|
||||
# cr.execute('''SELECT sr.id FROM hr_salary_rule as sr, hr_salary_head as sh
|
||||
# WHERE sr.category_id = sh.id AND sr.id in %s ORDER BY sh.sequence''',(tuple(rules),))
|
||||
# for x in cr.fetchall():
|
||||
# sorted_salary_heads.append(x[0])
|
||||
# for fn in field_names:
|
||||
# if fn == 'details_by_salary_head':
|
||||
# res[record.id] = {fn: sorted_salary_heads}
|
||||
# return res
|
||||
def _get_lines_salary_head(self, cr, uid, ids, field_names, arg=None, context=None):
|
||||
result = {}
|
||||
if not ids: return result
|
||||
cr.execute('''SELECT pl.slip_id, pl.id FROM hr_payslip_line AS pl \
|
||||
LEFT JOIN hr_salary_head AS sh on (pl.category_id = sh.id) \
|
||||
WHERE pl.slip_id in %s \
|
||||
GROUP BY pl.slip_id, sh.sequence, pl.sequence, pl.id ORDER BY sh.sequence, pl.sequence''',(tuple(ids),))
|
||||
res = cr.fetchall()
|
||||
for r in res:
|
||||
result.setdefault(r[0], [])
|
||||
result[r[0]].append(r[1])
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'struct_id': fields.many2one('hr.payroll.structure', 'Structure', help='Defines the rules that have to be applied to this payslip, accordingly to the contract chosen. If you let empty the field contract, this field isn\'t mandatory anymore and thus the rules applied will be all the rules set on the structure of all contracts of the employee valid for the chosen period'),
|
||||
@@ -238,36 +246,39 @@ class hr_payslip(osv.osv):
|
||||
\n* It is confirmed by the accountant and the state set to \'Confirm Sheet\'.\
|
||||
\n* If the salary is paid then state is set to \'Paid Salary\'.\
|
||||
\n* The \'Reject\' state is used when user cancel payslip.'),
|
||||
'line_ids': fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
# 'line_ids': fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'line_ids': one2many_mod2('hr.payslip.line', 'slip_id', 'Payslip Line',readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'input_line_ids': fields.one2many('hr.payslip.input', 'payslip_id', 'Payslip Inputs', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'paid': fields.boolean('Made Payment Order ? ', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'note': fields.text('Description'),
|
||||
'contract_id': fields.many2one('hr.contract', 'Contract', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
#TODO put me back
|
||||
# 'details_by_salary_head': fields.function(_get_salary_rules, method=True, type='one2many', relation='hr.salary.rule', string='Details by Salary Head', multi='details_by_salary_head'),
|
||||
'details_by_salary_head': fields.function(_get_lines_salary_head, method=True, type='one2many', relation='hr.payslip.line', string='Details by Salary Head'),
|
||||
'credit_note': fields.boolean('Credit Note', help="Indicates this payslip has a refund of another"),
|
||||
}
|
||||
_defaults = {
|
||||
'date_from': lambda *a: time.strftime('%Y-%m-01'),
|
||||
'date_to': lambda *a: str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10],
|
||||
'state': 'draft',
|
||||
'credit_note': False,
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default = {}
|
||||
company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
|
||||
default = {
|
||||
default.update({
|
||||
'line_ids': [],
|
||||
'move_ids': [],
|
||||
'move_line_ids': [],
|
||||
'move_payment_ids': [],
|
||||
'company_id': company_id,
|
||||
'period_id': False,
|
||||
'basic_before_leaves': 0.0,
|
||||
'basic_amount': 0.0
|
||||
}
|
||||
})
|
||||
return super(hr_payslip, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def cancel_sheet(self, cr, uid, ids, context=None):
|
||||
@@ -282,6 +293,34 @@ class hr_payslip(osv.osv):
|
||||
def process_sheet(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'paid': True, 'state': 'done'}, context=context)
|
||||
|
||||
def refund_sheet(self, cr, uid, ids, context=None):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
id_copy = self.copy(cr, uid, id, {'credit_note': True}, context=context)
|
||||
self.compute_sheet(cr, uid, [id_copy], context=context)
|
||||
wf_service.trg_validate(uid, 'hr.payslip', id_copy, 'verify_sheet', cr)
|
||||
wf_service.trg_validate(uid, 'hr.payslip', id_copy, 'final_verify_sheet', cr)
|
||||
wf_service.trg_validate(uid, 'hr.payslip', id_copy, 'process_sheet', cr)
|
||||
|
||||
form_id = mod_obj.get_object_reference(cr, uid, 'hr_payroll', 'view_hr_payslip_form')
|
||||
form_res = form_id and form_id[1] or False
|
||||
tree_id = mod_obj.get_object_reference(cr, uid, 'hr_payroll', 'view_hr_payslip_tree')
|
||||
tree_res = tree_id and tree_id[1] or False
|
||||
return {
|
||||
'name':_("Refund Payslip"),
|
||||
'view_mode': 'tree, form',
|
||||
'view_id': False,
|
||||
'view_type': 'form',
|
||||
'res_model': 'hr.payslip',
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'current',
|
||||
'domain': "[('id', 'in', %s)]" % [id_copy],
|
||||
'views': [(tree_res, 'tree'), (form_res, 'form')],
|
||||
'context': {}
|
||||
}
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context=None):
|
||||
#TODO clean me: this function should create the register lines accordingly to the rules computed (run the compute_sheet first)
|
||||
# holiday_pool = self.pool.get('hr.holidays')
|
||||
@@ -440,7 +479,8 @@ class hr_payslip(osv.osv):
|
||||
localdict['heads'][head.code] = head.code in localdict['heads'] and localdict['heads'][head.code] + amount or amount
|
||||
return localdict
|
||||
|
||||
result = []
|
||||
#we keep a dict with the result because a value can be overwritten by another rule with the same code
|
||||
result_dict = {}
|
||||
blacklist = []
|
||||
payslip = self.pool.get('hr.payslip').browse(cr, uid, payslip_id, context=context)
|
||||
worked_days = {}
|
||||
@@ -458,16 +498,22 @@ class hr_payslip(osv.osv):
|
||||
employee = contract.employee_id
|
||||
localdict.update({'employee': employee, 'contract': contract})
|
||||
for rule in self.pool.get('hr.salary.rule').browse(cr, uid, sorted_rule_ids, context=context):
|
||||
key = rule.code + '-' + str(contract.id)
|
||||
localdict['result'] = None
|
||||
#check if the rule can be applied
|
||||
if self.pool.get('hr.salary.rule').satisfy_condition(cr, uid, rule.id, localdict, context=context) and rule.id not in blacklist:
|
||||
#compute the amount of the rule
|
||||
amount = self.pool.get('hr.salary.rule').compute_rule(cr, uid, rule.id, localdict, context=context)
|
||||
#check if there is already a rule computed with that code
|
||||
previous_amount = rule.code in localdict['rules'] and localdict['rules'][rule.code] or 0.0
|
||||
#set/overwrite the amount computed for this rule in the localdict
|
||||
localdict['rules'][rule.code] = amount
|
||||
#sum the amount for its salary head
|
||||
localdict = _sum_salary_head(localdict, rule.category_id, amount)
|
||||
vals = {
|
||||
localdict = _sum_salary_head(localdict, rule.category_id, amount - previous_amount)
|
||||
#create/overwrite the rule in the temporary results
|
||||
result_dict[key] = {
|
||||
'salary_rule_id': rule.id,
|
||||
'contract_id': contract.id,
|
||||
'name': rule.name,
|
||||
'code': rule.code,
|
||||
'category_id': rule.category_id.id,
|
||||
@@ -487,10 +533,10 @@ class hr_payslip(osv.osv):
|
||||
'total': amount,
|
||||
'employee_id': contract.employee_id.id,
|
||||
}
|
||||
result.append(vals)
|
||||
else:
|
||||
#blacklist this rule and its children
|
||||
blacklist += [id for id, seq in self.pool.get('hr.salary.rule')._recursive_search_of_rules(cr, uid, [rule], context=context)]
|
||||
result = [value for code, value in result_dict.items()]
|
||||
return result
|
||||
|
||||
def onchange_employee_id(self, cr, uid, ids, date_from, date_to, employee_id=False, contract_id=False, context=None):
|
||||
@@ -615,9 +661,9 @@ class hr_salary_rule(osv.osv):
|
||||
'amount_percentage_base':fields.char('Percentage based on',size=1024, required=False, readonly=False, help='result will be affected to a variable'), #old name = expressiont
|
||||
'child_ids':fields.one2many('hr.salary.rule', 'parent_rule_id', 'Child Salary Rule'),
|
||||
'register_id':fields.property(
|
||||
'hr.contibution.register',
|
||||
'hr.contribution.register',
|
||||
type='many2one',
|
||||
relation='hr.contibution.register',
|
||||
relation='hr.contribution.register',
|
||||
string="Contribution Register",
|
||||
method=True,
|
||||
view_load=True,
|
||||
@@ -733,12 +779,13 @@ class hr_payslip_line(osv.osv):
|
||||
_name = 'hr.payslip.line'
|
||||
_inherit = 'hr.salary.rule'
|
||||
_description = 'Payslip Line'
|
||||
_order = 'sequence'
|
||||
_order = 'contract_id, sequence'
|
||||
|
||||
_columns = {
|
||||
'slip_id':fields.many2one('hr.payslip', 'Pay Slip', required=True),
|
||||
'salary_rule_id':fields.many2one('hr.salary.rule', 'Rule', required=True),
|
||||
'employee_id':fields.many2one('hr.employee', 'Employee', required=True),
|
||||
'contract_id':fields.many2one('hr.contract', 'Contract', required=True),
|
||||
'total': fields.float('Amount', digits_compute=dp.get_precision('Account')),
|
||||
'company_contrib': fields.float('Company Contribution', readonly=True, digits_compute=dp.get_precision('Account')),
|
||||
}
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
<field name="code">NET</field>
|
||||
</record>
|
||||
|
||||
<record id="COMP" model="hr.salary.head">
|
||||
<field name="name">Company Contribution</field>
|
||||
<field name="code">COMP</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="HRA" model="hr.salary.head">
|
||||
<field name="code">HRA</field>
|
||||
<field name="parent_id" ref="AL"/>
|
||||
@@ -182,7 +187,7 @@
|
||||
<field name="category_id" ref="hr_payroll.NET"/>
|
||||
<field name="condition_select">none</field>
|
||||
<field name="amount_select">code</field>
|
||||
<field name="amount_python_compute">result = heads['BASIC'] + ('ALW' in heads and heads['ALW'] or 0.0) - ('DED' in heads and heads['DED'] or 0.0)</field>
|
||||
<field name="amount_python_compute">result = heads['BASIC'] + ('ALW' in heads and heads['ALW'] or 0.0) + ('DED' in heads and heads['DED'] or 0.0)</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<record id="hr_payslip_line_professionaltax1" model="hr.salary.rule">
|
||||
<field name="amount_select">fix</field>
|
||||
<field eval="15" name="sequence"/>
|
||||
<field eval="150" name="sequence"/>
|
||||
<field eval="-200.0" name="amount_fix"/>
|
||||
<field name="code">PT</field>
|
||||
<field name="category_id" ref="hr_payroll.DED"/>
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
<record id="hr_payslip_line_providentfund1" model="hr.salary.rule">
|
||||
<field name="amount_select">percentage</field>
|
||||
<field eval="20" name="sequence"/>
|
||||
<field eval="120" name="sequence"/>
|
||||
<field eval="-12.5" name="amount_percentage"/>
|
||||
<field name="amount_percentage_base">contract.wage</field>
|
||||
<field name="code">PF</field>
|
||||
@@ -42,6 +42,23 @@
|
||||
<field name="name">Provident Fund</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_salary_rule_ca_paolino" model="hr.salary.rule">
|
||||
<field name="amount_select">fix</field>
|
||||
<field eval="600.0" name="amount_fix"/>
|
||||
<field name="code">CA</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="name">Conveyance Allowance For Paolino</field>
|
||||
<field name="sequence" eval="15"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_salary_rule_meal_voucher" model="hr.salary.rule">
|
||||
<field name="amount_select">code</field>
|
||||
<field name="amount_python_compute">result = worked_days['WORK100']['number_of_days'] * 1</field>
|
||||
<field name="code">MA</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="name">Meal Voucher</field>
|
||||
<field name="sequence" eval="16"/>
|
||||
</record>
|
||||
<!-- Salary Structure -->
|
||||
|
||||
<record id="structure_001" model="hr.payroll.structure">
|
||||
@@ -49,6 +66,15 @@
|
||||
<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"/>
|
||||
<field name="parent_id" ref="structure_base"/>
|
||||
</record>
|
||||
|
||||
<record id="structure_002" model="hr.payroll.structure">
|
||||
<field name="code">MEQP</field>
|
||||
<field name="name">Marketing Executive for Quentin Paolino</field>
|
||||
<field eval="[(6, 0, [ref('hr_salary_rule_ca_paolino'), ref('hr_salary_rule_meal_voucher')])]" name="rule_ids"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="parent_id" ref="structure_001"/>
|
||||
</record>
|
||||
|
||||
<!-- Employee -->
|
||||
@@ -63,7 +89,7 @@
|
||||
|
||||
<!-- Employee Contract -->
|
||||
<record id="hr_contract_firstcontract1" model="hr.contract">
|
||||
<field name="name">First Contract</field>
|
||||
<field name="name">Marketing Executive Contract</field>
|
||||
<field name="type_id" ref="hr_contract.hr_contract_type_emp"/>
|
||||
<field name="date_start" eval="time.strftime('%Y-%m')+'-1'"/>
|
||||
<field name="date_end" eval="time.strftime('%Y')+'-12-31'"/>
|
||||
@@ -74,5 +100,18 @@
|
||||
<field eval="5" name="working_days_per_week"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_contract_quentin_paolino" model="hr.contract">
|
||||
<field name="name">Contract For Quentin Paolino</field>
|
||||
<field name="type_id" ref="hr_contract.hr_contract_type_emp"/>
|
||||
<field name="date_start" eval="time.strftime('%Y-%m')+'-1'"/>
|
||||
<field name="date_end" eval="time.strftime('%Y')+'-12-31'"/>
|
||||
<field name="struct_id" ref="hr_payroll.structure_002"/>
|
||||
<field name="employee_id" ref="hr.employee2"/>
|
||||
<field name="notes">This is Quentin Paolino's contract</field>
|
||||
<field eval="5000.0" name="wage"/>
|
||||
<field eval="5" name="working_days_per_week"/>
|
||||
<field name="working_hours" ref="resource.timesheet_group1"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -71,6 +71,21 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_payroll_structure_filter" model="ir.ui.view">
|
||||
<field name="name">hr.payroll.structure.select</field>
|
||||
<field name="model">hr.payroll.structure</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Payroll Structures">
|
||||
<group col="8" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
</group>
|
||||
<newline/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_employee_grade_form" model="ir.ui.view">
|
||||
<field name="name">hr.payroll.structure.form</field>
|
||||
<field name="model">hr.payroll.structure</field>
|
||||
@@ -122,6 +137,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Salary Structure" editable="bottom">
|
||||
<field name="category_id"/>
|
||||
<field name="employee_id" invisible="1"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
@@ -165,6 +181,31 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_payslip_line_filter" model="ir.ui.view">
|
||||
<field name="name">hr.payslip.line.select</field>
|
||||
<field name="model">hr.payslip.line</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Payslip Lines">
|
||||
<group col="8" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="slip_id"/>
|
||||
<field name="amount_select"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group col="8" colspan="4" expand="0" string="Group By...">
|
||||
<filter string="Salary Head" icon="terp-camera_test" name="category_id" context="{'group_by':'category_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Amount Type" name="amount_select" icon="terp-stock_symbol-selection" context="{'group_by':'amount_select'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Employees" name="employee_id" icon="terp-personal" context="{'group_by':'employee_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_hr_payslip_tree" model="ir.ui.view">
|
||||
<field name="name">hr.payslip.tree</field>
|
||||
<field name="model">hr.payslip</field>
|
||||
@@ -196,10 +237,11 @@
|
||||
<field name="struct_id" groups="base.group_extended" attrs="{'required':[('contract_id','<>',False)]}"/>
|
||||
<field name="date_to"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="credit_note" readonly="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Salary Computation" >
|
||||
<field name="line_ids" colspan="4" nolabel="1" domain="[('appears_on_payslip','<>',False)]">
|
||||
<field name="line_ids" colspan="4" nolabel="1">
|
||||
<tree string="Salary Structure" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
@@ -236,17 +278,16 @@
|
||||
</field>
|
||||
</page>
|
||||
<!-- TODO: put me back -->
|
||||
<!-- <page string="Details By Salary Head">
|
||||
<field name="details_by_salary_head" nolabel="1">
|
||||
<tree string="Salary Rules">
|
||||
<page string="Details By Salary Head">
|
||||
<field name="details_by_salary_head" context="{'group_by':'category_id'}" domain="[('appears_on_payslip', '=', True)]" nolabel="1">
|
||||
<tree string="Payslip Lines">
|
||||
<field name="category_id"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="total"/>
|
||||
<field name="total"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>-->
|
||||
</page>
|
||||
|
||||
<page string="Worked Days">
|
||||
<field name="input_line_ids" colspan="4" nolabel="1" mode="tree">
|
||||
@@ -281,6 +322,7 @@
|
||||
<button string="Approve Sheet" icon="terp-camera_test" name="final_verify_sheet" states="hr_check"/>
|
||||
<button string="Pay Salary" icon="terp-dolar_ok!" name="process_sheet" states="confirm"/>
|
||||
<button string="Set to Draft" icon="terp-stock_effects-object-colorize" name="draft" states="cancel"/>
|
||||
<button string="Refund" icon="gtk-execute" name="refund_sheet" states="confirm,done" type='object'/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -360,15 +402,8 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Salary Heads">
|
||||
<filter icon="terp-document-new" string="Allowance" domain="[('type','=','allowance')]"/>
|
||||
<filter icon="terp-check" string="Deduction" domain="[('type','=','deduction')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="4" groups="base.group_extended">
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -391,9 +426,9 @@
|
||||
<!--
|
||||
Contribution Register
|
||||
-->
|
||||
<record id="hr_contibution_register_tree" model="ir.ui.view">
|
||||
<field name="name">hr.contibution.register.tree</field>
|
||||
<field name="model">hr.contibution.register</field>
|
||||
<record id="hr_contribution_register_tree" model="ir.ui.view">
|
||||
<field name="name">hr.contribution.register.tree</field>
|
||||
<field name="model">hr.contribution.register</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Contribution Registers">
|
||||
@@ -402,9 +437,20 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="hr_contibution_register_form" model="ir.ui.view">
|
||||
<field name="name">hr.contibution.register.form</field>
|
||||
<field name="model">hr.contibution.register</field>
|
||||
<record id="hr_contribution_register_filter" model="ir.ui.view">
|
||||
<field name="name">hr.contribution.register.search</field>
|
||||
<field name="model">hr.contribution.register</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Contribution Registers">
|
||||
<field name="name"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="hr_contribution_register_form" model="ir.ui.view">
|
||||
<field name="name">hr.contribution.register.form</field>
|
||||
<field name="model">hr.contribution.register</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Contribution">
|
||||
@@ -419,15 +465,15 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_contibution_register_form" model="ir.actions.act_window">
|
||||
<record id="action_contribution_register_form" model="ir.actions.act_window">
|
||||
<field name="name">Contribution Registers</field>
|
||||
<field name="res_model">hr.contibution.register</field>
|
||||
<field name="res_model">hr.contribution.register</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="hr_contibution_register_tree"/>
|
||||
<field name="view_id" ref="hr_contribution_register_tree"/>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_action_hr_contibution_register_form"
|
||||
action="action_contibution_register_form"
|
||||
id="menu_action_hr_contribution_register_form"
|
||||
action="action_contribution_register_form"
|
||||
parent="payroll_configure"
|
||||
sequence="14"
|
||||
/>
|
||||
@@ -530,12 +576,13 @@
|
||||
<search string="Search Salary Rule">
|
||||
<group col="8" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="category_id"/>
|
||||
<field name="condition_range_min"/>
|
||||
</group>
|
||||
<newline/>
|
||||
|
||||
<group col="8" colspan="4" expand="0" string="Group By...">
|
||||
<filter string="Name" icon="terp-folder-yellow" name="name" context="{'group_by':'name'}"/>
|
||||
<filter string="Head" icon="terp-folder-yellow" name="head" context="{'group_by':'category_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -552,6 +599,8 @@
|
||||
|
||||
<menuitem id="menu_action_hr_salary_rule_form" action="action_salary_rule_form" parent="payroll_configure" sequence="12"/>
|
||||
|
||||
<act_window domain="[('slip_id', '=', active_id)]" id="act_payslip_lines" name="Payslip Lines" res_model="hr.payslip.line" src_model="hr.payslip"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"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_contibution_register","hr.contibution.register","model_hr_contibution_register","base.group_hr_user",1,1,1,1
|
||||
"access_hr_contribution_register","hr.contribution.register","model_hr_contribution_register","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
|
||||
@@ -8,3 +8,5 @@
|
||||
"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_payslip_input ","hr.payslip.input","model_hr_payslip_input","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_salary_rule","hr.salary.rule","model_hr_salary_rule","base.group_hr_manager",1,1,1,1
|
||||
|
||||
|
Reference in New Issue
Block a user