From c2918c139b8f1026b57a257fbb74570d7a224c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Thu, 13 Aug 2020 16:26:35 +0000 Subject: [IMP] web, *: improve mock server and replace most mail mockRPC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve mock server: - add support for mocked `fetch` - add support for `active_test` - add support for x2m `in` in domains - add support for default values computed from a function - implement a more natural "next id" compute - allow initial data without ids - ensure write and x2m commands integrity - improve bad data/bad commands error messages - always warn for failing RPC, not only in debug mode - fix all existing tests that had inconsistency data Other changes done in mail (or dependents) that are not just related to tests: - remove `direct_partner` from formatter result ->`correspondent` can be computed from other keys, especially `members` - fix `livechat_visitor` convertData -> only process if there is value - add `current_partner` and `current_user_id` as `init_messaging` result -> easier to mock than session - remove usage of `need_moderation` -> that was just a search indirection to `moderation_status` - adapt `partner_id` -> `res_partner_id` key in `_notification_format` -> to be consistent with field name - add name in result of `mail_partner_format` -> sometimes display_name is not the same - remove usage of `is_moderator` -> that was just an indirection to `moderation_channel_ids` Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523 task-2287171 closes odoo/odoo#55854 X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d Related: odoo/enterprise#12391 Signed-off-by: Sébastien Theys (seb) --- addons/web/static/tests/fields/basic_fields_tests.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'addons/web/static/tests/fields/basic_fields_tests.js') diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 965a98e973b..76783a90d31 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -89,8 +89,8 @@ QUnit.module('basic_fields', { qux: false, selection: 'done', }, - {id: 3, bar: true, foo: "gnap", int_field: 80, qux: -3.89859, m2o: 1, m2m: []}, - {id: 5, bar: false, foo: "blop", int_field: -4, qux: 9.1, m2o: 1, m2m: [1], currency_id: 1}], + {id: 3, bar: true, foo: "gnap", int_field: 80, qux: -3.89859}, + {id: 5, bar: false, foo: "blop", int_field: -4, qux: 9.1, currency_id: 1}], onchanges: {}, }, product: { @@ -117,6 +117,7 @@ QUnit.module('basic_fields', { }, currency: { fields: { + digits: { string: "Digits" }, symbol: {string: "Currency Sumbol", type: "char", searchable: true}, position: {string: "Currency Position", type: "char", searchable: true}, }, @@ -4458,7 +4459,7 @@ QUnit.module('basic_fields', { { id: 5, datetime: '2017-10-05 04:00:00' }, // - 3 days { id: 6, datetime: '2018-02-08 04:00:00' }, // + 4 months (diff >= 100 days) { id: 7, datetime: '2017-06-08 04:00:00' }, // - 4 months (diff >= 100 days) - { id: 6, datetime: false }, + { id: 8, datetime: false }, ]; const list = await createView({ -- cgit v1.2.3