delete hr.payroll.structure.type previous records
parent
b5bf565e2b
commit
9879f53881
@ -1,6 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<function model="ir.config_parameter" name="set_param">
|
|
||||||
<value eval="'gn_payroll.first_installation'" />
|
|
||||||
<value eval="'True'" />
|
|
||||||
</function>
|
|
||||||
</odoo>
|
|
@ -1,14 +0,0 @@
|
|||||||
from odoo import models, api
|
|
||||||
|
|
||||||
class HrPayrollStructureType(models.Model):
|
|
||||||
_name = 'hr.payroll.structure.type'
|
|
||||||
|
|
||||||
@api.model
|
|
||||||
def init(self):
|
|
||||||
super(HrPayrollStructureType, self).init()
|
|
||||||
first_install = self.env['ir.config_parameter'].sudo().get_param('gn_payroll.first_installation')
|
|
||||||
if first_install:
|
|
||||||
# Delete pre-existing records
|
|
||||||
self.env['hr.payroll.structure.type'].search([]).unlink()
|
|
||||||
# Reset the flag
|
|
||||||
self.env['ir.config_parameter'].sudo().set_param('gn_payroll.first_installation', 'False')
|
|
Loading…
Reference in New Issue