Deliberately not setting company_id in hr_payroll_rate

This is intended to make instances of 'hr_payroll_rate' more like configuration for the modules that create them.
Additional test and sorting makes it possible to 'prefer' to have company set to allow effectively per-company overrides.
This commit is contained in:
Jared Kipe
2019-01-08 19:32:44 -08:00
parent 3e4dcbb868
commit 58028e65b2
3 changed files with 13 additions and 3 deletions

View File

@@ -64,6 +64,16 @@ class TestPayrollRate(common.TransactionCase):
rate = self.payslip.get_rate('TEST')
self.assertEqual(rate, test_rate)
test_rate_more_specific = self.env['hr.payroll.rate'].create({
'name': 'Test Rate Specific',
'code': 'TEST',
'rate': 1.65,
'date_from': '2018-01-01',
'company_id': self.payslip.company_id.id,
})
rate = self.payslip.get_rate('TEST')
self.assertEqual(rate, test_rate_more_specific)
def test_payroll_rate_newer(self):
test_rate_old = self.env['hr.payroll.rate'].create({
'name': 'Test Rate',