diff --git a/sale_planner_calendar/models/calendar_event.py b/sale_planner_calendar/models/calendar_event.py
index bbf13aaca37..ec91cfed9f6 100644
--- a/sale_planner_calendar/models/calendar_event.py
+++ b/sale_planner_calendar/models/calendar_event.py
@@ -87,6 +87,14 @@ class CalendarEvent(models.Model):
sanitized_partner_mobile = fields.Char(compute="_compute_sanitized_partner_mobile")
location_url = fields.Char(compute="_compute_location_url")
categ_icons = fields.Char(compute="_compute_categ_icons")
+ sale_planner_rating = fields.Selection(
+ [
+ ("1", "Bad"),
+ ("3", "Fair"),
+ ("5", "Good"),
+ ],
+ required=True,
+ )
@api.depends("recurrence_id", "recurrence_id.calendar_event_ids")
def _compute_is_base_recurrent_event(self):
@@ -363,6 +371,19 @@ def action_open_issue(self):
def action_apply_issue(self):
pass
+ def action_open_rating(self):
+ action = self.env["ir.actions.act_window"]._for_xml_id(
+ "sale_planner_calendar.action_sale_planner_calendar_rating"
+ )
+ action["res_id"] = self.id
+ return action
+
+ def action_set_sale_planner_rating(self):
+ rating = self.env.context.get("rating_value")
+ if rating:
+ self.sale_planner_rating = rating
+ self.action_done()
+
def _get_hour_tz_offset(self):
timezone = self._context.get("tz") or self.env.user.partner_id.tz or "UTC"
self_tz = self.with_context(tz=timezone)
diff --git a/sale_planner_calendar/static/img/rating_1.png b/sale_planner_calendar/static/img/rating_1.png
new file mode 100644
index 00000000000..e2919617942
Binary files /dev/null and b/sale_planner_calendar/static/img/rating_1.png differ
diff --git a/sale_planner_calendar/static/img/rating_1.svg b/sale_planner_calendar/static/img/rating_1.svg
new file mode 100644
index 00000000000..1a03ef19299
--- /dev/null
+++ b/sale_planner_calendar/static/img/rating_1.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/sale_planner_calendar/static/img/rating_3.png b/sale_planner_calendar/static/img/rating_3.png
new file mode 100644
index 00000000000..69942a2e20a
Binary files /dev/null and b/sale_planner_calendar/static/img/rating_3.png differ
diff --git a/sale_planner_calendar/static/img/rating_3.svg b/sale_planner_calendar/static/img/rating_3.svg
new file mode 100644
index 00000000000..5cee881f2ab
--- /dev/null
+++ b/sale_planner_calendar/static/img/rating_3.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/sale_planner_calendar/static/img/rating_5.png b/sale_planner_calendar/static/img/rating_5.png
new file mode 100644
index 00000000000..015baac529b
Binary files /dev/null and b/sale_planner_calendar/static/img/rating_5.png differ
diff --git a/sale_planner_calendar/static/img/rating_5.svg b/sale_planner_calendar/static/img/rating_5.svg
new file mode 100644
index 00000000000..9ac69427d39
--- /dev/null
+++ b/sale_planner_calendar/static/img/rating_5.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/sale_planner_calendar/views/sale_planner_calendar_event_view.xml b/sale_planner_calendar/views/sale_planner_calendar_event_view.xml
index fc9df94acbe..3731e8ea25d 100644
--- a/sale_planner_calendar/views/sale_planner_calendar_event_view.xml
+++ b/sale_planner_calendar/views/sale_planner_calendar_event_view.xml
@@ -267,6 +267,106 @@
}
+
+ sale.planner.calendar.rating.form
+ calendar.event
+
+
+
+
+
+
+
+ Sale planner calendar rating
+ calendar.event
+ form
+ new
+
+ {'form_view_ref': 'sale_planner_calendar.view_sale_planner_calendar_rating_form'}
+
+
+
sale.planner.calendar.event.kanban
calendar.event
@@ -318,8 +418,22 @@
+