You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys, im trying to make a diferent use of the event _prepare_calendar_event i want that if the field person_id that is the person assigned to do the work of that fieldservice in the clock menu should appear to him not the calendar team leader, i tried but im not able to do that any clues?
def _prepare_calendar_event(self):
model_id = self.env.ref("fieldservice.model_fsm_order").id
vals = {
"name": self.name,
"description": self.description,
"start": self.scheduled_date_start,
"stop": self.scheduled_date_end,
"allday": False,
"res_model_id": model_id, # link back with "Document" button
"res_id": self.id, # link back with "Document" button
"location": self._serialize_location(),
"user_id": self.team_id.calendar_user_id.id,
}
vals["partner_ids"] = [(4, self.team_id.calendar_user_id.partner_id.id, False)]
I tried this
if self.person_id :
vals = {
"name": self.name,
"description": self.description,
"start": self.scheduled_date_start,
"stop": self.scheduled_date_end,
"allday": False,
"res_model_id": model_id, # link back with "Document" button
"res_id": self.id, # link back with "Document" button
"location": self._serialize_location(),
"user_id": self.person_id.partner_id.id,
}
vals["partner_ids"] = [(4, self.person_id.partner_id.id, False)]
return vals
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: