You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.0 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2019-2020 Elouan Le Bars <elouan@coopiteasy.be>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from openerp import fields, models, api
  5. class ShiftConfigSettings(models.TransientModel):
  6. _name = "beesdoo.shift.config.settings"
  7. _inherit = "res.config.settings"
  8. default_task_type_id = fields.Many2one(
  9. "beesdoo.shift.type",
  10. string="Default Task Type",
  11. help="Default task type for shifts added on an attendance sheet.",
  12. )
  13. @api.multi
  14. def set_params(self):
  15. self.ensure_one()
  16. value = self.default_task_type_id.id
  17. parameters = self.env["ir.config_parameter"]
  18. parameters.set_param("beesdoo_shift.default_task_type_id", value)
  19. @api.multi
  20. def get_default_task_type_id(self):
  21. return {
  22. "default_task_type_id": int(
  23. self.env["ir.config_parameter"].get_param(
  24. "beesdoo_shift.default_task_type_id"
  25. )
  26. )
  27. }