summaryrefslogtreecommitdiff
path: root/hr_employee_updation/models/updation_config.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
commit1ca3b3df3421961caec3b747a364071c80f5c7da (patch)
tree6778a1f0f3f9b4c6e26d6d87ccde16e24da6c9d6 /hr_employee_updation/models/updation_config.py
parentb57188be371d36d96caac4b8d65a40745c0e972c (diff)
initial commit
Diffstat (limited to 'hr_employee_updation/models/updation_config.py')
-rw-r--r--hr_employee_updation/models/updation_config.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/hr_employee_updation/models/updation_config.py b/hr_employee_updation/models/updation_config.py
new file mode 100644
index 0000000..34a958d
--- /dev/null
+++ b/hr_employee_updation/models/updation_config.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models, api
+
+
+class JournalConfig(models.TransientModel):
+ _inherit = ['res.config.settings']
+
+ notice_period = fields.Boolean(string='Notice Period')
+ no_of_days = fields.Integer()
+
+ def set_values(self):
+ super(JournalConfig, self).set_values()
+ self.env['ir.config_parameter'].sudo().set_param("hr_resignation.notice_period",
+ self.notice_period)
+ self.env['ir.config_parameter'].sudo().set_param("hr_resignation.no_of_days",
+ self.no_of_days)
+
+ @api.model
+ def get_values(self):
+ res = super(JournalConfig, self).get_values()
+ get_param = self.env['ir.config_parameter'].sudo().get_param
+ res['notice_period'] = get_param('hr_resignation.notice_period')
+ res['no_of_days'] = int(get_param('hr_resignation.no_of_days'))
+ return res
+
+ # @api.onchange('service_expense_journal')
+ # def onchange_accounts(self):
+ # self.service_credit_account = self.service_expense_journal.default_credit_account_id.id
+ # self.service_debit_account = self.service_expense_journal.default_debit_account_id.id