Skip to content

Commit

Permalink
[FIX] sale_planner_acalendar: Invalid field when user search events b…
Browse files Browse the repository at this point in the history
…y week day in reassign wizard

TT51485
  • Loading branch information
sergio-teruel authored and carlosdauden committed Oct 30, 2024
1 parent ff3f6b9 commit a60719d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
20 changes: 10 additions & 10 deletions sale_planner_calendar/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-29 13:41+0000\n"
"PO-Revision-Date: 2024-10-29 14:44+0100\n"
"Last-Translator: Carlos Dauden <carlos.dauden@tecnativa.com>\n"
"POT-Creation-Date: 2024-10-30 16:12+0000\n"
"PO-Revision-Date: 2024-10-30 17:12+0100\n"
"Last-Translator: Sergio Teruel <sergio.teruel@tecnativa.com>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -385,7 +385,7 @@ msgid "Forward months to create calendar events"
msgstr "Meses posteriores para crear eventos de calendario"

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__fr
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__fri
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__fri
msgid "Friday"
msgstr "Viernes"
Expand Down Expand Up @@ -580,7 +580,7 @@ msgid "Mobile"
msgstr "Móvil"

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__mo
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__mon
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__mon
msgid "Monday"
msgstr "Lunes"
Expand Down Expand Up @@ -949,7 +949,7 @@ msgid "Sanitized Partner Mobile"
msgstr "Móvil de contacto"

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__sa
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__sat
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__sat
msgid "Saturday"
msgstr "Sábado"
Expand Down Expand Up @@ -1028,7 +1028,7 @@ msgid "Subject"
msgstr "Asunto"

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__su
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__sun
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__sun
msgid "Sunday"
msgstr "Domingo"
Expand Down Expand Up @@ -1071,7 +1071,7 @@ msgstr ""
"Debes de realizar el cambio de comercial desde el asistente de reasignación"

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__th
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__thu
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__thu
msgid "Thursday"
msgstr "Jueves"
Expand Down Expand Up @@ -1113,7 +1113,7 @@ msgid "Totals"
msgstr "Totales"

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__tu
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__tue
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__tue
msgid "Tuesday"
msgstr "Martes"
Expand Down Expand Up @@ -1154,7 +1154,7 @@ msgid "Website communication history"
msgstr "Historial de comunicaciones del sitio web"

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__we
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__wed
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__wed
msgid "Wednesday"
msgstr "Miércoles"
Expand Down
18 changes: 9 additions & 9 deletions sale_planner_calendar/i18n/sale_planner_calendar.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-29 13:41+0000\n"
"PO-Revision-Date: 2024-10-29 13:41+0000\n"
"POT-Creation-Date: 2024-10-30 16:12+0000\n"
"PO-Revision-Date: 2024-10-30 16:12+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -377,7 +377,7 @@ msgid "Forward months to create calendar events"
msgstr ""

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__fr
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__fri
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__fri
msgid "Friday"
msgstr ""
Expand Down Expand Up @@ -566,7 +566,7 @@ msgid "Mobile"
msgstr ""

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__mo
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__mon
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__mon
msgid "Monday"
msgstr ""
Expand Down Expand Up @@ -935,7 +935,7 @@ msgid "Sanitized Partner Mobile"
msgstr ""

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__sa
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__sat
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__sat
msgid "Saturday"
msgstr ""
Expand Down Expand Up @@ -1010,7 +1010,7 @@ msgid "Subject"
msgstr ""

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__su
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__sun
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__sun
msgid "Sunday"
msgstr ""
Expand Down Expand Up @@ -1050,7 +1050,7 @@ msgid ""
msgstr ""

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__th
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__thu
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__thu
msgid "Thursday"
msgstr ""
Expand Down Expand Up @@ -1091,7 +1091,7 @@ msgid "Totals"
msgstr ""

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__tu
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__tue
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__tue
msgid "Tuesday"
msgstr ""
Expand Down Expand Up @@ -1132,7 +1132,7 @@ msgid "Website communication history"
msgstr ""

#. module: sale_planner_calendar
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__we
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_reassign_wiz__week_list__wed
#: model:ir.model.fields.selection,name:sale_planner_calendar.selection__sale_planner_calendar_wizard__week_list__wed
msgid "Wednesday"
msgstr ""
Expand Down
16 changes: 8 additions & 8 deletions sale_planner_calendar/wizard/sale_planner_calendar_reassign.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ class SalePlannerCalendarReassignWiz(models.TransientModel):
)
week_list = fields.Selection(
[
("MO", "Monday"),
("TU", "Tuesday"),
("WE", "Wednesday"),
("TH", "Thursday"),
("FR", "Friday"),
("SA", "Saturday"),
("SU", "Sunday"),
("mon", "Monday"),
("tue", "Tuesday"),
("wed", "Wednesday"),
("thu", "Thursday"),
("fri", "Friday"),
("sat", "Saturday"),
("sun", "Sunday"),
],
string="Weekday",
)
Expand Down Expand Up @@ -73,7 +73,7 @@ def action_get_lines(self):
if self.event_type_id:
domain.append(("categ_ids", "in", self.event_type_id.ids))
if self.week_list:
domain.append((self.week_list.lower(), "=", True))
domain.append((self.week_list, "=", True))

Check warning on line 76 in sale_planner_calendar/wizard/sale_planner_calendar_reassign.py

View check run for this annotation

Codecov / codecov/patch

sale_planner_calendar/wizard/sale_planner_calendar_reassign.py#L76

Added line #L76 was not covered by tests
calendar_events = self.env["calendar.event"].search(domain)
self.line_ids = False
for calendar_event in calendar_events:
Expand Down
16 changes: 8 additions & 8 deletions sale_planner_calendar/wizard/sale_planner_calendar_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ class SalePlannerCalendarWizard(models.TransientModel):
)
week_list = fields.Selection(
[
("MON", "Monday"),
("TUE", "Tuesday"),
("WED", "Wednesday"),
("THU", "Thursday"),
("FRI", "Friday"),
("SAT", "Saturday"),
("SUN", "Sunday"),
("mon", "Monday"),
("tue", "Tuesday"),
("wed", "Wednesday"),
("thu", "Thursday"),
("fri", "Friday"),
("sat", "Saturday"),
("sun", "Sunday"),
],
string="Weekday",
)
Expand All @@ -50,7 +50,7 @@ def _compute_calendar_event_ids(self):
if rec.event_type_id:
domain.append(("categ_ids", "in", rec.event_type_id.ids))
if rec.week_list:
domain.append(("recurrence_id." + rec.week_list.lower(), "=", True))
domain.append(("recurrence_id." + rec.week_list, "=", True))

Check warning on line 53 in sale_planner_calendar/wizard/sale_planner_calendar_wizard.py

View check run for this annotation

Codecov / codecov/patch

sale_planner_calendar/wizard/sale_planner_calendar_wizard.py#L53

Added line #L53 was not covered by tests
rec.calendar_event_ids = (
self.env["calendar.event"].search(domain).sorted("hour")
)
Expand Down

0 comments on commit a60719d

Please sign in to comment.