23 lines
738 B
Python
23 lines
738 B
Python
from odoo import _, models
|
|
|
|
|
|
class ResUsers(models.Model):
|
|
_inherit = "res.users"
|
|
|
|
def action_open_timeline(self):
|
|
self.ensure_one()
|
|
action = self.env["ir.actions.act_window"]._for_xml_id(
|
|
"user_timelines.action_user_timeline_entries"
|
|
)
|
|
action["name"] = _("Timeline: %s", self.name)
|
|
action["domain"] = [("user_id", "=", self.id)]
|
|
action["context"] = {
|
|
"search_default_group_employee": 0,
|
|
"search_default_group_user": 0,
|
|
"search_default_group_project": 0,
|
|
"search_default_public_holidays_remove": 1,
|
|
"default_is_public_holiday": 0,
|
|
"timeline_focus_user_id": self.id,
|
|
}
|
|
return action
|