diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/im_livechat/static/tests/helpers/mock_models.js | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/im_livechat/static/tests/helpers/mock_models.js')
| -rw-r--r-- | addons/im_livechat/static/tests/helpers/mock_models.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/addons/im_livechat/static/tests/helpers/mock_models.js b/addons/im_livechat/static/tests/helpers/mock_models.js new file mode 100644 index 00000000..db18e8f7 --- /dev/null +++ b/addons/im_livechat/static/tests/helpers/mock_models.js @@ -0,0 +1,42 @@ +odoo.define('im_livechat/static/tests/helpers/mock_models.js', function (require) { +'use strict'; + +const MockModels = require('mail/static/tests/helpers/mock_models.js'); + +MockModels.patch('im_livechat/static/tests/helpers/mock_models.js', T => + class extends T { + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + /** + * @override + */ + static generateData() { + const data = super.generateData(...arguments); + Object.assign(data, { + 'im_livechat.channel': { + fields: { + user_ids: { string: "Operators", type: 'many2many', relation: 'res.users' } + }, + records: [], + } + }); + Object.assign(data['mail.channel'].fields, { + anonymous_name: { string: "Anonymous Name", type: 'char' }, + country_id: { string: "Country", type: 'many2one', relation: 'res.country' }, + livechat_active: { string: "Is livechat ongoing?", type: 'boolean', default: false }, + livechat_channel_id: { string: "Channel", type: 'many2one', relation: 'im_livechat.channel' }, + livechat_operator_id: { string: "Operator", type: 'many2one', relation: 'res.partner' }, + }); + Object.assign(data['res.users'].fields, { + livechat_username: { string: 'Livechat Username', type: 'string' }, + }); + return data; + } + + } +); + +}); |
