[IMP] mail, sms, snailmail: rename notification group model

Rename javascript model `mail.notification_group` to `NotificationGroup`
in order to distinguish javascript models from python models.

Part of task-2701674.

closes odoo/odoo#81405

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Louis Wicket (wil)
2021-12-15 11:12:42 +00:00
parent 512d19896c
commit b024377742
7 changed files with 8 additions and 8 deletions
@@ -24,10 +24,10 @@ export class NotificationGroup extends Component {
//--------------------------------------------------------------------------
/**
* @returns {mail.notification_group}
* @returns {NotificationGroup}
*/
get group() {
return this.messaging && this.messaging.models['mail.notification_group'].get(this.props.notificationGroupLocalId);
return this.messaging && this.messaging.models['NotificationGroup'].get(this.props.notificationGroupLocalId);
}
/**
@@ -91,7 +91,7 @@ export class NotificationList extends Component {
});
let notifications = threadNeedactionNotifications.concat(threadNotifications);
if (this.props.filter === 'all') {
notifications = Object.values(this.messaging.models['mail.notification_group'].all())
notifications = Object.values(this.messaging.models['NotificationGroup'].all())
.sort((group1, group2) => group1.sequence - group2.sequence)
.map(notificationGroup => {
return {
@@ -41,7 +41,7 @@ registerModel({
}
const inboxCounter = this.messaging.inbox ? this.messaging.inbox.counter : 0;
const unreadChannelsCounter = this.pinnedAndUnreadChannels.length;
const notificationGroupsCounter = this.messaging.models['mail.notification_group'].all().reduce(
const notificationGroupsCounter = this.messaging.models['NotificationGroup'].all().reduce(
(total, group) => total + group.notifications.length,
0
);
@@ -143,7 +143,7 @@ registerModel({
message: many2one('mail.message', {
inverse: 'notifications',
}),
notificationGroup: many2one('mail.notification_group', {
notificationGroup: many2one('NotificationGroup', {
compute: '_computeNotificationGroup',
inverse: 'notifications',
}),
@@ -6,7 +6,7 @@ import { clear, insert, unlink } from '@mail/model/model_field_command';
import { OnChange } from '@mail/model/model_onchange';
registerModel({
name: 'mail.notification_group',
name: 'NotificationGroup',
identifyingFields: ['res_model', 'res_id', 'notification_type'],
recordMethods: {
/**
@@ -4,7 +4,7 @@ import { patchRecordMethods } from '@mail/model/model_core';
// ensure that the model definition is loaded before the patch
import '@mail/models/notification_group/notification_group';
patchRecordMethods('mail.notification_group', {
patchRecordMethods('NotificationGroup', {
/**
* @override
*/
@@ -4,7 +4,7 @@ import { patchRecordMethods } from '@mail/model/model_core';
// ensure that the model definition is loaded before the patch
import '@mail/models/notification_group/notification_group';
patchRecordMethods('mail.notification_group', {
patchRecordMethods('NotificationGroup', {
/**
* @override
*/