Merge branch 'master-payslip-riddhi' into 'master'

[IMP] HR Payroll, round amounts based on currency rounding factor

See merge request flectra-hq/flectra!144
This commit is contained in:
Parthiv Patel 2018-10-08 12:31:57 +00:00
commit e6ce44b6a1

View File

@ -505,7 +505,12 @@ class HrPayslipLine(models.Model):
rate = fields.Float(string='Rate (%)', digits=dp.get_precision('Payroll Rate'), default=100.0) rate = fields.Float(string='Rate (%)', digits=dp.get_precision('Payroll Rate'), default=100.0)
amount = fields.Float(digits=dp.get_precision('Payroll')) amount = fields.Float(digits=dp.get_precision('Payroll'))
quantity = fields.Float(digits=dp.get_precision('Payroll'), default=1.0) quantity = fields.Float(digits=dp.get_precision('Payroll'), default=1.0)
total = fields.Float(compute='_compute_total', string='Total', digits=dp.get_precision('Payroll'), store=True) total = fields.Monetary(compute='_compute_total', string='Total',
digits=dp.get_precision('Payroll'), store=True,
currency_field='company_currency_id')
company_currency_id = fields.Many2one(
'res.currency', related='employee_id.company_id.currency_id',
string="Company Currency", readonly=True)
@api.depends('quantity', 'amount', 'rate') @api.depends('quantity', 'amount', 'rate')
def _compute_total(self): def _compute_total(self):