From 3a9f6d73048fc08cd3ac230a1928e4d2ab3649ad Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Mon, 11 Nov 2024 10:00:43 +0100 Subject: [PATCH] [IMP] sale_planner_calendar: Add rating to calendar events TT51662 --- .../models/calendar_event.py | 21 ++++ sale_planner_calendar/static/img/rating_1.png | Bin 0 -> 1671 bytes sale_planner_calendar/static/img/rating_1.svg | 1 + sale_planner_calendar/static/img/rating_3.png | Bin 0 -> 1533 bytes sale_planner_calendar/static/img/rating_3.svg | 1 + sale_planner_calendar/static/img/rating_5.png | Bin 0 -> 1693 bytes sale_planner_calendar/static/img/rating_5.svg | 1 + .../sale_planner_calendar_event_view.xml | 116 +++++++++++++++++- 8 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 sale_planner_calendar/static/img/rating_1.png create mode 100644 sale_planner_calendar/static/img/rating_1.svg create mode 100644 sale_planner_calendar/static/img/rating_3.png create mode 100644 sale_planner_calendar/static/img/rating_3.svg create mode 100644 sale_planner_calendar/static/img/rating_5.png create mode 100644 sale_planner_calendar/static/img/rating_5.svg 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 0000000000000000000000000000000000000000..e291961794285059fd5cd81eb455514dde9e97ee GIT binary patch literal 1671 zcmV;226*|2P)VW>xzd0=6qzcZgz&DtA;DD8TO8^+cs*q@7lb~i+HlS6WnNvTyaC8AZ&z$@HSPRi}$fIhSYPC?RF&#eul zW*OUujlrZqI+h+)X+Xp>r`}uk>c%q>TBW8#SFAy#U`1IuR+9!~EyrF)YgODpZ6$K_ zIMfiyj3xzyl#YR9)9Z-w^x3odq};Az+KeK_Lx`T0+1UPr549>3q*rnQqKFA5#Y0F1 z{XLp=xB#iq6Z2WPC775XQaprgAR$L{!9!51V&zx>zJ&NQy`+HsQZTCblX5%D{5;v< zAV#bCr#`6;iISyNW^>AfXkdKz?D7TF%L^|laLl-~RKZU;d4QM=8|QVcip3yOpf=nv zH7QQf3t@(dv~deN8Al2nFm709r?ASz023%lwlfqENr5ZPjnw8P{g4#EtNqEE_zd%K z0GFh2oof(loGm8hc7a5d4N+PSNO4F>)}ZbM!6*9?p0J-3K_VKT{+$!x(Q;`y&;W@P zu4k(=TW$KlrR6KMqeX`l7#yJ-X=1Y=SuMC2e{+LEEf2^M2P8QjfoA#1G}%)l6TTYAcpm6 z!0w+n2n&EOQB9Z-(L;5BKVLg(HYuFtn9U_;a3ys*5V`vZA|<5L*930-MN&9oBqc=E zQdgj{`)KW9miiP#&pc zk%Hx0+od^jqk75vfkbh#k7D(4g?2ai={K`^Fk6aeN-b~(cuJ4)8G_Ak5fW9m|hAnhhYQDD}(ms%B1Y+??hWIR0gGkkTf zAstUK1GgEfBrnj;4#het^2i2W`R9^aZpaln{Kn!{QauJaKN+qWOw_F4pqLh%Y5YXY_R30I&B(w^tQ2*N`s}xItecoE80jtgOuxBvVy1E7pa;v$)$B3d1vQA ztoI?xVdq=zmQ#_0F{a Rmv;aF002ovPDHLkV1o3dAB6w_ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..69942a2e20a2d4deed35fd0958384ad55e081aa5 GIT binary patch literal 1533 zcmVkU$OjlOBx*SG@%_&m{_*zqM!#{6KgZ;w zOyeaH-3niwq9p%0!j#@|HAyMccuhoWkgy`6kBXn=MD$8T2lE#t`QZvv9hQ_bjW%c#oNbikuOSBxMoLdIDm7Uu)r#XKBsoDyDbv^x zu~m?9gnc*}5~3tOImTSU_Efg$lVU1QQIc={S8$GAq+sIDEfYTCn%*`5HtL>;{&rlJ znQL5xx1lpBnBcQRI)aKcyY~v@xK#DuD9LwS#_vQ*nZ`y$A1z-GMusqtCDisG+gzd~ zzxN&2o0Kw*jda`zU*!aYl44PtW0d6U zAr>$s$~4{yv5eJ0xFm)Dpg*At?xcxN#L3ogsKxVIi3WNqzW5*%u%Ry= z_!%iMJiJyhnGik@_nC2;SQvA2GS0xo>Sow^U#7Pgd!-Mi-ZK9M(HU+rYticBiNm3?tsoAoVjBZxdYE_v}uM_d_y5K?dxlS4cqHfiET zh=00bBamO98W^nB6SR{FLE0AXlR|eSVXOzlB$W*a-t{y{d)LreHAv`nkH&+$fJ=R5 zSBve5I!SDj!kOu6s=tr{R;4L%~FN2))Y>P38kB)Y_z15X?*I~*%%513Pl=X zI4NgZ!d)`YFD{C@5+EUC5<<4^3Jyzg{%qZ6q*y9a8cCT-My;s<@%0p(l#3lg^u+$h ze)yqn%M_KhG54Aenp&{1`+3pGBayPilV7-gI7e6>_+PwN+{w zZ?`t*(N=krjO)R3e`Pelj_f71>0FM4cs;R?%?)91UW4Ze(oCkFnh~qSfAnP{;E=Hu0n}&ip_+c9u$^HzCyHWY`j0rM9ztN4UMg z$U#`Jb+l)Ao$+a+@4-qb!D{0DP-V!zIpyKXFW9l{gx*JRTaKz#sA?9~@qD$nf<)XZ zPr?UL-;js3?=4A}grYi|Y$;GxXOg9sGuwDO^w;&?LJfMXAGW3{cJrKR2m~dg!eB3e zfaGjibiXSykTJ+hAO?R`2&8AzIG*1{f(qE9y{}E`f~&u2r|}}0RZAb+PuQKSzhLI~ j>xTpc>ty<6Kt%roNHw6TI \ 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 0000000000000000000000000000000000000000..015baac529b011a3ee77f038a0c93e8e3c6516f2 GIT binary patch literal 1693 zcmV;O24eY%P)-U=x(ZwVMiyz`s5YdC;u`Lnph-gDZ>r0WA28o7U5z(@m z9_ES0J413(vNAWSFd?Eb5q(ZN_$iJ=WQcjLriWe1fs>KqkTGc~6)x?Xe+6ze#E+}#Vbl6uZApOZ2QUZiTzqk)% zW&Z4u8e?aM+WFmS=N2I3pK5v-y*DBBD?Ko3{S}_b#RI&f3Mxr~%l%LIS8HR|C!kJi z!3e8tOd~0H!B62|S4oIPfSAU42T6f--w5IQRTE<2`9h6qeF=HTCYv%72zj{$Lg<%` z*}%rQ7{F6`;gyuE%uQ(hgI#{DriWpV>*xg@Ct)0fXnaGG!XG#yio8Wk5J$O~!93_l zfw$p-P%k0-C4g{&f1v}Ab-sQ{eX=s&Fw zBt{UsY}w@#6>1`-Q?=}h!GpJxb@Rb%1i$E`Eiqo@@# zS8gMX3Kcfws3iq@#giwsfkkZdoy9k1;!lVuI|Ji=FUZFe)rTX76pbP68t-VHkBPkb`f4YmE?kEISN0OP zW$UY5M7(1z1YIr`G3iK`%9|Rfr2i{a(pN(K(-uP^cOg^*lO?T5JDE(7hP@Z7pSzSb z7+V)X0B7H^NgZ`3Z|}kcd(Em-yaREMh>-f+TrIXEYJ269!kOu%Vp3OjT(W{!03{Vz)qW2fyP2{A4dTHvQOs9T{6#M9wJm|h@$tC$y54PJ*dDM z?|alb20X{>GADV}2`Qe6l$L$hnw#Wm-4`(qA#Mdu>lmbTz)uRm6SqfYMT;BiUWmb5 zxSA7MQ#IgU@}hBv5Gurzx<Fd?xHxh#C-T+L^(!yYM!;2+#Z4H(eZ|4m*4b=hJio zMBS$9X+T<;u1@j(04ctHw?;K$lbI(z;u5v_T)F7&Z*%@o-oW#%&WH3&yS$G0vFx zh(h_n$~S9gx|A|K9&``23C>wdicbt zyKQ}rPcerAZr<0P(c0d1Jyu@`kMvt4CBve( zAAoQQ*`b5gZLtLzy|lFU{!<~&$@8JYCirl4ehwg5he \ 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 @@ +