Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] sale_planner_calendar: Remove partner name from default location address #3335

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading