[MERGE] merge with mtr's branch
bzr revid: psi@tinyerp.co.in-20110314090226-f9ut7cqf5l0r1xud
This commit is contained in:
commit
d7e626ff76
|
@ -921,12 +921,10 @@ class hr_payslip(osv.osv):
|
|||
|
||||
lines = []
|
||||
rules = []
|
||||
if function:
|
||||
for struct in sal_structure:
|
||||
func = func_pool.read(cr, uid, struct, ['rule_ids'], context=context)
|
||||
lines = salary_rule_pool.browse(cr, uid, func['rule_ids'], context=context)
|
||||
for rl in lines:
|
||||
rules.append(rl)
|
||||
for struct in sal_structure:
|
||||
lines = func_pool.browse(cr, uid, struct, context=context).rule_ids
|
||||
for rl in lines:
|
||||
rules.append(rl)
|
||||
|
||||
ad = []
|
||||
total = 0.0
|
||||
|
@ -999,7 +997,7 @@ class hr_payslip(osv.osv):
|
|||
}
|
||||
if line.appears_on_payslip:
|
||||
if line.condition_range_min or line.condition_range_max:
|
||||
if not((line.amount < line.condition_range_min) or (line.amount > line.condition_range_max)):
|
||||
if not ((line.amount < line.condition_range_min) or (line.amount > line.condition_range_max)):
|
||||
update['value']['line_ids'].append(vals)
|
||||
else:
|
||||
update['value']['line_ids'].append(vals)
|
||||
|
@ -1281,13 +1279,16 @@ class hr_employee(osv.osv):
|
|||
Employee
|
||||
'''
|
||||
|
||||
_inherit = 'hr.employee'
|
||||
_description = 'Employee'
|
||||
|
||||
def _calculate_basic(self, cr, uid, ids, name, args, context):
|
||||
if not ids: return {}
|
||||
vals = {}
|
||||
res = {}
|
||||
current_date = datetime.now().strftime('%Y-%m-%d')
|
||||
for employee in self.browse(cr, uid, ids, context=context):
|
||||
if not employee.contract_id:
|
||||
vals[employee.id] = {'basic': 0.0}
|
||||
if not employee.contract_ids:
|
||||
res[employee.id] = {'basic': 0.0}
|
||||
continue
|
||||
cr.execute( 'SELECT SUM(wage) '\
|
||||
'FROM hr_contract '\
|
||||
|
@ -1296,19 +1297,15 @@ class hr_employee(osv.osv):
|
|||
'AND (date_end > %s OR date_end is NULL)',
|
||||
(employee.id, current_date, current_date))
|
||||
result = dict(cr.dictfetchone())
|
||||
vals[employee.id] = {
|
||||
'basic': result['sum']
|
||||
}
|
||||
return vals
|
||||
|
||||
_inherit = 'hr.employee'
|
||||
_description = 'Employee'
|
||||
res[employee.id] = {'basic': result['sum']}
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'line_ids':fields.one2many('hr.payslip.line', 'employee_id', 'Salary Structure', required=False),
|
||||
# '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),
|
||||
'basic': fields.function(_calculate_basic, method=True, multi='dc', type='float', string='Basic Salary', digits_compute=dp.get_precision('Account')),
|
||||
}
|
||||
|
||||
hr_employee()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -20,7 +20,7 @@
|
|||
<field name="bank_account_id" context="{'display_partner':True, 'partner_id':partner_id}"/>
|
||||
<field name="place_of_birth"/>
|
||||
<field name="children"/>
|
||||
<field name="basic" invisible="1"/>
|
||||
<field name="basic" invisible="0"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Job Info" colspan="2"/>
|
||||
|
@ -31,11 +31,6 @@
|
|||
</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>
|
||||
|
@ -571,7 +566,7 @@
|
|||
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>
|
||||
|
@ -645,14 +640,14 @@
|
|||
</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" sequence="12"/>
|
||||
|
||||
<!-- Salary Head Type -->
|
||||
|
@ -667,7 +662,7 @@
|
|||
</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>
|
||||
|
@ -679,16 +674,16 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_salary_head_type" model="ir.actions.act_window">
|
||||
<field name="name">Salary Head Types</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" sequence="10"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
|
Loading…
Reference in New Issue