[IMP] hr_payroll: created decimal_precision for Payroll and improved dp in hr_payroll.py
bzr revid: mtr@mtr-20110603092555-tz8ajg8r578pw1zz
This commit is contained in:
parent
e41d251cdc
commit
3898cb05ae
|
@ -759,8 +759,8 @@ class hr_salary_rule(osv.osv):
|
|||
('fix','Fixed Amount'),
|
||||
('code','Python Code'),
|
||||
],'Amount Type', select=True, required=True, help="The computation method for the rule amount."),
|
||||
'amount_fix': fields.float('Fixed Amount', digits_compute=dp.get_precision('Account'),),
|
||||
'amount_percentage': fields.float('Percentage (%)', digits_compute=dp.get_precision('Account'), help='For example, enter 50.0 to apply a percentage of 50%'),
|
||||
'amount_fix': fields.float('Fixed Amount', digits_compute=dp.get_precision('Payroll'),),
|
||||
'amount_percentage': fields.float('Percentage (%)', digits_compute=dp.get_precision('Payroll'), help='For example, enter 50.0 to apply a percentage of 50%'),
|
||||
'amount_python_compute':fields.text('Python Code'),
|
||||
'amount_percentage_base':fields.char('Percentage based on',size=1024, required=False, readonly=False, help='result will be affected to a variable'),
|
||||
'child_ids':fields.one2many('hr.salary.rule', 'parent_rule_id', 'Child Salary Rule'),
|
||||
|
@ -920,10 +920,10 @@ class hr_payslip_line(osv.osv):
|
|||
'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),
|
||||
'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')),
|
||||
'quantity': fields.float('Quantity', digits_compute=dp.get_precision('Account')),
|
||||
'company_contrib': fields.float('Company Contribution', readonly=True, digits_compute=dp.get_precision('Account')),
|
||||
'total': fields.function(_calculate_total, method=True, type='float', string='Total', digits_compute=dp.get_precision('Account'),store=True ),
|
||||
'amount': fields.float('Amount', digits_compute=dp.get_precision('Payroll')),
|
||||
'quantity': fields.float('Quantity', digits_compute=dp.get_precision('Payroll')),
|
||||
'company_contrib': fields.float('Company Contribution', readonly=True, digits_compute=dp.get_precision('Payroll')),
|
||||
'total': fields.function(_calculate_total, method=True, type='float', string='Total', digits_compute=dp.get_precision('Payroll'),store=True ),
|
||||
}
|
||||
|
||||
hr_payslip_line()
|
||||
|
@ -965,7 +965,7 @@ class hr_employee(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'slip_ids':fields.one2many('hr.payslip', 'employee_id', 'Payslips', required=False, readonly=True),
|
||||
'total_wage': fields.function(_calculate_total_wage, method=True, type='float', string='Total Basic Salary', digits_compute=dp.get_precision('Account'), help="Sum of all current contract's wage of employee."),
|
||||
'total_wage': fields.function(_calculate_total_wage, method=True, type='float', string='Total Basic Salary', digits_compute=dp.get_precision('Payroll'), help="Sum of all current contract's wage of employee."),
|
||||
}
|
||||
|
||||
hr_employee()
|
||||
|
|
|
@ -72,5 +72,12 @@
|
|||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<!-- Decimal Precision -->
|
||||
|
||||
<record forcecreate="True" id="decimal_payroll" model="decimal.precision">
|
||||
<field name="name">Payroll</field>
|
||||
<field name="digits">2</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue