Initial commit: Core packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:45 +02:00
commit 12c29a983b
9512 changed files with 8379910 additions and 0 deletions

View file

@ -0,0 +1,13 @@
/** @odoo-module **/
import { registerPatch } from '@mail/model/model_core';
registerPatch({
name: 'AutocompleteInputView',
recordMethods: {
onSource(req, res) {
this._super(req, res);
this.messaging.messagingBus.trigger('o-AutocompleteInput-source');
},
},
});

View file

@ -0,0 +1,14 @@
/** @odoo-module **/
import { registerPatch } from '@mail/model/model_core';
import { one } from '@mail/model/model_field';
registerPatch({
name: 'ClockWatcher',
fields: {
qunitTestOwner: one('QUnitTest', {
identifying: true,
inverse: 'clockWatcher',
}),
},
});

View file

@ -0,0 +1,101 @@
/** @odoo-module **/
import { registerPatch } from '@mail/model/model_core';
registerPatch({
name: 'EmojiRegistry',
recordMethods: {
async loadEmojiData() {
const dataEmojiCategories = [
{
"name": "Smileys & Emotion",
"title": "🤠",
"sortId": 1
},
{
"name": "People & Body",
"title": "🤟",
"sortId": 2
}];
const dataEmojis = [
{
"codepoints": "😀",
"name": "grinning face",
"shortcodes": [
":grinning:"
],
"emoticons": [],
"category": "Smileys & Emotion",
"keywords": [
"face",
"grin",
"grinning face"
]
},
{
"codepoints": "🤣",
"name": "rolling on the floor laughing",
"shortcodes": [
":rofl:"
],
"emoticons": [],
"category": "Smileys & Emotion",
"keywords": [
"face",
"floor",
"laugh",
"rofl",
"rolling",
"rolling on the floor laughing",
"rotfl"
]
},
{
"codepoints": "😊",
"name": "smiling face with smiling eyes",
"shortcodes": [
":smiling_face_with_smiling_eyes:"
],
"emoticons": [],
"category": "Smileys & Emotion",
"keywords": [
"blush",
"eye",
"face",
"smile",
"smiling face with smiling eyes"
]
},
{
"codepoints": "👋",
"name": "waving hand",
"shortcodes": [
":waving_hand:"
],
"emoticons": [],
"category": "People & Body",
"keywords": [
"hand",
"wave",
"waving"
]
},
{
"codepoints": "🤚",
"name": "raised back of hand",
"shortcodes": [
":raised_back_of_hand:"
],
"emoticons": [],
"category": "People & Body",
"keywords": [
"backhand",
"raised",
"raised back of hand"
]
},
];
this._populateFromEmojiData(dataEmojiCategories, dataEmojis);
},
},
});

View file

@ -0,0 +1,25 @@
/** @odoo-module **/
import { registerModel } from '@mail/model/model_core';
import { one } from '@mail/model/model_field';
registerModel({
name: 'QUnitTest',
fields: {
clockWatcher: one('ClockWatcher', {
inverse: 'qunitTestOwner',
}),
throttle1: one('Throttle', {
inverse: 'qunitTestOwner1',
}),
throttle2: one('Throttle', {
inverse: 'qunitTestOwner2',
}),
timer1: one('Timer', {
inverse: 'qunitTestOwner1',
}),
timer2: one('Timer', {
inverse: 'qunitTestOwner2',
}),
},
});

View file

@ -0,0 +1,66 @@
/** @odoo-module **/
import { registerModel } from '@mail/model/model_core';
import { attr, many, one } from '@mail/model/model_field';
registerModel({
name: 'TestAddress',
fields: {
id: attr({
identifying: true,
}),
addressInfo: attr(),
contact: one('TestContact', {
inverse: 'address',
}),
},
});
registerModel({
name: 'TestContact',
fields: {
id: attr({
identifying: true,
}),
address: one('TestAddress', {
inverse: 'contact',
}),
favorite: one('TestHobby', {
default: { description: 'football' },
}),
hobbies: many('TestHobby', {
default: [
{ description: 'hiking' },
{ description: 'fishing' },
],
}),
tasks: many('TestTask', {
inverse: 'responsible'
}),
},
});
registerModel({
name: 'TestHobby',
fields: {
description: attr({
identifying: true,
}),
},
});
registerModel({
name: 'TestTask',
fields: {
id: attr({
identifying: true,
}),
title: attr(),
difficulty: attr({
default: 1,
}),
responsible: one('TestContact', {
inverse: 'tasks'
}),
},
});

View file

@ -0,0 +1,29 @@
/** @odoo-module **/
import { registerPatch } from '@mail/model/model_core';
import { one } from '@mail/model/model_field';
registerPatch({
name: 'Throttle',
fields: {
duration: {
compute() {
if (this.qunitTestOwner1) {
return 0;
}
if (this.qunitTestOwner2) {
return 1000;
}
return this._super();
},
},
qunitTestOwner1: one('QUnitTest', {
identifying: true,
inverse: 'throttle1',
}),
qunitTestOwner2: one('QUnitTest', {
identifying: true,
inverse: 'throttle2',
}),
},
});

View file

@ -0,0 +1,29 @@
/** @odoo-module **/
import { registerPatch } from '@mail/model/model_core';
import { one } from '@mail/model/model_field';
registerPatch({
name: 'Timer',
fields: {
duration: {
compute() {
if (this.qunitTestOwner1) {
return 0;
}
if (this.qunitTestOwner2) {
return 1000 * 1000;
}
return this._super();
},
},
qunitTestOwner1: one('QUnitTest', {
identifying: true,
inverse: 'timer1',
}),
qunitTestOwner2: one('QUnitTest', {
identifying: true,
inverse: 'timer2',
}),
},
});