19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:27 +01:00
parent d1963a3c3a
commit 2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-inherit="mail.ChannelPreviewView" t-inherit-mode="extension">
<xpath expr="//*[hasclass('o_ChannelPreviewView_messageBody')]" position="replace">
<t t-if="channelPreviewView.isRating">
<span class="o_ChannelPreviewView_ratingText">Rating:</span>
<img class="o_ChannelPreviewView_ratingImage ms-2" t-att-src="channelPreviewView.thread.lastMessage.rating.ratingImageUrl" t-att-alt="channelPreviewView.thread.lastMessage.rating.ratingText"/>
</t>
<t t-else="">$0</t>
</xpath>
</t>
</templates>

View file

@ -1,4 +0,0 @@
.o_ThreadNeedactionPreview_ratingImage {
height: $font-size-base;
width: $font-size-base;
}

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-inherit="mail.ThreadNeedactionPreview" t-inherit-mode="extension">
<xpath expr="//*[hasclass('o_ThreadNeedactionPreview_messageBody')]" position="replace">
<t t-if="threadNeedactionPreviewView.isRating">
<span class="o_ThreadNeedactionPreview_ratingText">Rating:</span>
<img class="o_ThreadNeedactionPreview_ratingImage ms-2" t-att-src="threadNeedactionPreviewView.thread.lastNeedactionMessageAsOriginThread.rating.ratingImageUrl" t-att-alt="threadNeedactionPreviewView.thread.lastNeedactionMessageAsOriginThread.rating.ratingText"/>
</t>
<t t-else="">$0</t>
</xpath>
</t>
</templates>

View file

@ -0,0 +1,16 @@
declare module "models" {
import { Rating as RatingClass } from "@rating/core/common/rating_model";
export interface Rating extends RatingClass {}
export interface Message {
rating_id: Rating;
}
export interface Store {
"rating.rating": StaticMailRecord<Rating, typeof RatingClass>;
}
export interface Models {
"rating.rating": Rating;
}
}

View file

@ -0,0 +1,19 @@
import { Message } from "@mail/core/common/message_model";
import { fields } from "@mail/core/common/record";
import { patch } from "@web/core/utils/patch";
patch(Message.prototype, {
setup() {
super.setup(...arguments);
this.rating_id = fields.One("rating.rating");
},
computeIsEmpty() {
return super.computeIsEmpty() && !this.rating_id && !this.rating_value;
},
get removeParams() {
return { ...super.removeParams, rating_value: false };
},
});

View file

@ -0,0 +1,16 @@
import { Record } from "@mail/core/common/record";
export class Rating extends Record {
static _name = "rating.rating";
static id = "id";
/** @type {number} */
id;
/** @type {number} */
rating;
/** @type {string} */
rating_image_url;
/** @type {string} */
rating_text;
}
Rating.register();

View file

@ -1,4 +1,4 @@
.o_ChannelPreviewView_ratingImage {
.o-rating-preview-image {
height: $font-size-base;
width: $font-size-base;
}

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-inherit="mail.MessagingMenu.content" t-inherit-mode="extension">
<xpath expr="//t[@name='threads']/NotificationItem" position="attributes">
<attribute name="rating">message?.rating_id</attribute>
</xpath>
</t>
</templates>

View file

@ -0,0 +1,3 @@
import { NotificationItem } from "@mail/core/public_web/notification_item";
NotificationItem.props = [...NotificationItem.props, "rating?"];

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-inherit="mail.NotificationItem" t-inherit-mode="extension">
<xpath expr="//*[@name='notificationBody']" position="replace">
<t t-if="props.rating">
<span>Rating:</span>
<img class="o-rating-preview-image ms-2" t-att-src="props.rating.rating_image_url" t-att-alt="props.rating.rating_text"/>
</t>
<t t-else="">$0</t>
</xpath>
</t>
</templates>

View file

@ -0,0 +1,34 @@
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="310.000000pt" height="120.000000pt" viewBox="0 0 310.000000 120.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,120.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path fill="#7C6576" d="M1420 1177 c-170 -51 -284 -160 -344 -326 -18 -51 -20 -87 -24 -444
-3 -372 -3 -389 15 -385 10 2 32 25 49 51 48 73 64 87 100 87 34 0 42 -8 105
-97 23 -34 35 -43 59 -43 24 0 36 9 59 43 63 90 71 97 106 97 39 0 53 -12 100
-86 29 -45 40 -54 64 -54 30 0 41 10 102 97 23 34 35 43 58 43 46 0 58 -8 92
-63 33 -52 56 -77 72 -77 4 0 7 173 5 393 -4 371 -5 395 -25 449 -63 167 -194
282 -367 322 -89 21 -136 19 -226 -7z m100 -392 c25 -13 60 -60 60 -79 0 -3
-13 -3 -30 0 -35 8 -60 -9 -60 -40 0 -28 18 -46 47 -46 34 0 29 -27 -9 -51
-49 -30 -120 -22 -161 20 -28 28 -32 38 -32 87 0 51 3 58 37 90 30 27 46 34
78 34 23 0 54 -7 70 -15z m340 0 c31 -16 60 -51 60 -72 0 -9 -9 -11 -30 -7
-35 8 -60 -9 -60 -40 0 -30 18 -46 53 -46 36 0 32 -17 -13 -47 -106 -72 -243
44 -185 157 34 65 109 89 175 55z"/>
<path d="M2500 1159 c-95 -15 -270 -115 -270 -155 0 -23 27 -16 79 21 26 19
75 47 107 62 53 25 70 28 169 28 94 0 117 -3 162 -24 90 -40 153 -127 153
-212 0 -58 -30 -126 -71 -164 -63 -57 -99 -68 -236 -73 -110 -4 -123 -6 -123
-22 0 -16 13 -18 133 -22 141 -4 201 -21 255 -71 59 -55 87 -173 62 -262 -14
-51 -76 -127 -124 -152 -151 -78 -373 -47 -515 71 -48 40 -59 43 -68 21 -13
-35 134 -132 242 -160 76 -19 204 -19 280 0 85 22 161 77 199 145 29 51 31 62
31 150 0 82 -4 102 -25 144 -30 60 -79 101 -144 122 l-49 17 51 24 c227 107
172 437 -83 501 -62 16 -155 20 -215 11z"/>
<path d="M167 1153 c-11 -10 -8 -511 2 -518 6 -3 41 10 78 29 86 44 136 55
244 56 156 0 249 -47 304 -154 38 -76 41 -174 6 -251 -42 -94 -166 -183 -307
-219 -70 -18 -209 -36 -276 -36 -41 0 -48 -3 -48 -20 0 -18 7 -20 73 -20 144
0 334 45 435 102 72 42 119 87 153 150 32 59 34 69 34 158 -1 117 -24 178 -94
243 -71 66 -142 90 -271 90 -106 1 -171 -12 -240 -48 -59 -30 -60 -26 -60 184
0 104 3 196 6 205 5 14 42 16 305 16 292 0 299 0 299 20 0 20 -7 20 -318 20
-175 0 -322 -3 -325 -7z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -1,20 +0,0 @@
/** @odoo-module **/
import { registerPatch } from '@mail/model/model_core';
import { attr } from '@mail/model/model_field';
registerPatch({
name: 'ChannelPreviewView',
fields: {
isEmpty: {
compute() {
return this.isRating || this._super();
},
},
isRating: attr({
compute() {
return Boolean(this.thread.lastMessage && this.thread.lastMessage.rating);
},
}),
},
});

View file

@ -1,25 +0,0 @@
/** @odoo-module **/
import { registerPatch } from '@mail/model/model_core';
import { one } from '@mail/model/model_field';
registerPatch({
name: 'Message',
modelMethods: {
/**
* @override
*/
convertData(data) {
const data2 = this._super(data);
if ('rating' in data) {
data2.rating = data.rating;
}
return data2;
},
},
fields: {
rating: one('Rating', {
isCausal: true,
}),
},
});

View file

@ -1,19 +0,0 @@
/** @odoo-module **/
import { registerModel } from '@mail/model/model_core';
import { attr } from '@mail/model/model_field';
registerModel({
name: 'Rating',
fields: {
id: attr({
identifying: true,
}),
ratingImageUrl: attr({
readonly: true,
}),
ratingText: attr({
readonly: true,
}),
},
});

View file

@ -1,20 +0,0 @@
/** @odoo-module **/
import { registerPatch } from '@mail/model/model_core';
import { attr } from '@mail/model/model_field';
registerPatch({
name: 'ThreadNeedactionPreviewView',
fields: {
isEmpty: {
compute() {
return this.isRating || this._super();
},
},
isRating: attr({
compute() {
return Boolean(this.thread.lastNeedactionMessageAsOriginThread && this.thread.lastNeedactionMessageAsOriginThread.rating);
},
}),
},
});

View file

@ -1,13 +1,5 @@
.o_kanban_renderer .o_rating_rating_kanban {
.o_rating_rating_kanban .o_kanban_renderer {
.o_kanban_record {
width: 350px;
}
.o_rating_kanban_left {
min-width: 80px;
.o_rating_value {
font-size: 4rem;
}
}
}

View file

@ -1,3 +1,7 @@
.o_rating_page_thank_you {
min-height: 80vh;
}
/* Rating feedback */
.o_rating_page_submit {
@ -7,6 +11,7 @@
}
.o_rating_label {
opacity: 0.5;
border: none !important;
&:hover {
transform: scale(1.1);
}