Skip to content

Commit

Permalink
Merge PR #3335 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 23, 2024
2 parents f32db33 + f0c895a commit 61f2cdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sale_planner_calendar/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def action_calendar_planner(self):
action["context"] = {
"default_target_partner_id": self.id,
"default_categ_ids": [(4, categ.id)],
"default_location": self._display_address(),
# Passing True omits the partner name, ensuring precise calculation of GPS location.
"default_location": self._display_address(True).replace("\n", " "),
"default_duration": categ.duration,
"default_name": categ.name,
"default_start": fields.Datetime.now(),
Expand Down
5 changes: 4 additions & 1 deletion sale_planner_calendar/tests/test_sale_planner_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ def test_create_calendar_planner_event(self):
event = self.planned_events[0]
self.assertTrue(event.user_id in self.commercial_users)
self.assertEqual(event.rrule_type, "weekly")
self.assertEqual(event.location, event.target_partner_id._display_address())
self.assertEqual(
event.location,
event.target_partner_id._display_address(True).replace("\n", " "),
)

def test_planner_calendar_wizard(self):
wiz_form = Form(self.env["sale.planner.calendar.wizard"])
Expand Down

0 comments on commit 61f2cdb

Please sign in to comment.