Files
odoo_source/addons/bus/static/tests/helpers/model_definitions_setup.js
T
Sébastien Theys 545d23888b [IMP] mail, im_livechat, *: add typing for guest and clean code
* = bus, hr_holidays, test_discuss_full

- use channel member instead of partner for typing
- use channel member instead of partner for all other return values from server
- remove temporary partner hack in livechat and keep public partner
- remove some obsolete convert data
- adapt format methods accordingly

task-2664853

closes odoo/odoo#98923

Related: odoo/enterprise#30760
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 20:21:58 +02:00

44 lines
1.8 KiB
JavaScript

/** @odoo-module **/
import { TEST_GROUP_IDS, TEST_USER_IDS } from '@bus/../tests/helpers/test_constants';
import {
addModelNamesToFetch,
insertModelFields,
insertRecords
} from '@bus/../tests/helpers/model_definitions_helpers';
//--------------------------------------------------------------------------
// Models
//--------------------------------------------------------------------------
addModelNamesToFetch([
'ir.attachment', 'ir.model', 'ir.model.fields', 'res.company', 'res.country',
'res.groups', 'res.partner', 'res.users'
]);
//--------------------------------------------------------------------------
// Insertion of fields
//--------------------------------------------------------------------------
insertModelFields('res.partner', {
description: { string: 'description', type: 'text' },
});
//--------------------------------------------------------------------------
// Insertion of records
//--------------------------------------------------------------------------
insertRecords('res.company', [{ id: 1 }]);
insertRecords('res.groups', [
{ id: TEST_GROUP_IDS.groupUserId, name: "Internal User" },
]);
insertRecords('res.users', [
{ display_name: "Your Company, Mitchell Admin", id: TEST_USER_IDS.currentUserId, name: "Mitchell Admin", partner_id: TEST_USER_IDS.currentPartnerId, },
{ active: false, display_name: "Public user", id: TEST_USER_IDS.publicUserId, name: "Public user", partner_id: TEST_USER_IDS.publicPartnerId, },
]);
insertRecords('res.partner', [
{ active: false, display_name: "Public user", id: TEST_USER_IDS.publicPartnerId, is_public: true },
{ display_name: "Your Company, Mitchell Admin", id: TEST_USER_IDS.currentPartnerId, name: "Mitchell Admin", },
{ active: false, display_name: "OdooBot", id: TEST_USER_IDS.partnerRootId, name: "OdooBot" },
]);