mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-17 10:19:09 +02:00
add new module
This commit is contained in:
31
hr_employee_updation/models/updation_config.py
Normal file
31
hr_employee_updation/models/updation_config.py
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user