from odoo import models


class ResUsers(models.Model):
    _inherit = 'res.users'

    def _get_xeno_default_home_action(self):
        return self.env.ref('xeno_theme_slate.action_xeno_app_dashboard', raise_if_not_found=False)

    def default_get(self, fields_list):
        res = super().default_get(fields_list)
        if 'action_id' in fields_list and not res.get('action_id'):
            action = self._get_xeno_default_home_action()
            if action:
                res['action_id'] = action.id
        return res
