mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-19 09:11:59 +02:00
Initial commit: Core packages
This commit is contained in:
commit
12c29a983b
9512 changed files with 8379910 additions and 0 deletions
|
|
@ -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');
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -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',
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -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);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -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',
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -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'
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -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',
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -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',
|
||||
}),
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue