raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ') % (e))
if line.amount_type == 'per':
try:
- if line.parent_rule_id:
- for rul in [line.parent_rule_id]:
-# if rul.child_depend:
- val = rul.amount * amt
- amt = val
- value = line.amount * amt
- if line.condition_range_min or line.condition_range_max:
- if ((value < line.condition_range_min) or (value > line.condition_range_max)):
- value = 0.0
+ if line.child_depend == False:
+ if line.parent_rule_id:
+ for rul in [line.parent_rule_id]:
+ val = rul.amount * amt
+ amt = val
+ value = line.amount * amt
+ if line.condition_range_min or line.condition_range_max:
+ if ((value < line.condition_range_min) or (value > line.condition_range_max)):
+ value = 0.0
+ else:
+ value = value
else:
value = value
- else:
- value = value
except Exception, e:
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ') % (e))
+
elif line.amount_type == 'fix':
- if line.parent_rule_id:
+ if line.child_depend == False:
+ if line.parent_rule_id:
for rul in [line.parent_rule_id]:
-# if rul.child_depend:
value = value
- if line.condition_range_min or line.condition_range_max:
- if ((line.amount < line.condition_range_min) or (line.amount > line.condition_range_max)):
- value = value
+ if line.condition_range_min or line.condition_range_max:
+ if ((line.amount < line.condition_range_min) or (line.amount > line.condition_range_max)):
+ value = value
+ else:
+ value = line.amount
else:
value = line.amount
- else:
- value = line.amount
elif line.amount_type=='code':
localdict = {'basic':amt}
exec line.python_code in localdict
value = localdict['result']
total += value
+
vals = {
'category_id': line.category_id.id,
'name': line.name,
# 'function_id': False,
'base': line.computational_expression
}
- if line.appears_on_payslip and not line.parent_rule_id:
- if line.condition_range_min or line.condition_range_max:
- if not ((value < line.condition_range_min) or (value > line.condition_range_max)):
- update['value']['line_ids'].append(vals)
+ if line.appears_on_payslip:
+ if line.parent_rule_id:
+ for l in salary_rule_pool.browse(cr, uid, [line.parent_rule_id.id], context=context):
+ if l.display_child_rules == True:
+ update['value']['line_ids'].append(vals)
else:
- update['value']['line_ids'].append(vals)
+ if line.condition_range_min or line.condition_range_max:
+ if not ((value < line.condition_range_min) or (value > line.condition_range_max)):
+ update['value']['line_ids'].append(vals)
+ else:
+ update['value']['line_ids'].append(vals)
+
basic = contract.wage
number = sequence_obj.get(cr, uid, 'salary.slip')
update['value'].update({
'worked_days': working_day - leave,
'working_days': working_day,
})
+
return update
hr_payslip()
'active':fields.boolean('Active'),
'python_code': fields.text('Python code'),
'python_compute':fields.text('Python Code'),
+ 'display_child_rules': fields.boolean('Display Child Rules', help="Used for the display of Child Rules on payslip"),
}
_defaults = {
'python_compute': '''# basic\n\nresult = basic * 0.10''',