Commit Graph
9 Commits
Author SHA1 Message Date
Mathieu Duckerts-Antoine bf2cc8d7d1 [FIX] web: SampleServer: many2many in mockReadGroup
closes odoo/odoo#119350

X-original-commit: e63f8206e9658c517743966bb9e24d110fa43508
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-22 05:52:16 +02:00
Mathieu Duckerts-Antoine d8e08067d4 [IMP] web: sample server: add test file
The new SampleServer class was introduced in c67b9f9907
without dedicated tests. We fix this oversight.

closes odoo/odoo#119188

X-original-commit: 693f7bd74066fa9854db4ecef751f13ec5c7e7a6
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-20 15:21:55 +02:00
Aaron Bohy 84a4859570 [REF] web,*: move legacy files
To prepare the rewriting of the webclient in owl, we move all
current js files of web in a legacy/ folder. This folder will
eventually be removed, as soon as each file it contains will be
converted to owl and moved to the proper place in the new file
structure.
2021-06-18 21:31:27 +02:00
Mohammed Shekha 8aecb15970 [FIX] web: do not display cover images in sample data
Before this commit, in sample mode, cover images might be displayed
in kanban views. It isn't what we want as those images are real
images from the database, not sample ones, but randomly linked to
the sample records (the id of many2one fields is randomly generated).

This commit tweaks the SampleServer to always set many2one fields
pointing to model 'ir.attachment' to false.

task-2368505

closes odoo/odoo#66381

X-original-commit: f7b2a5825e3786be53d04276af4c4c403b7a293e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-17 15:00:12 +00:00
Aaron Bohy 338e276fc9 [FIX] web: SampleServer: fix randomly failing test
Commit [1] recently tweaked the way floats are generated in the
SampleServer, as they are now rounded to 2 decimals. As a
consequence it sometimes generates integers for float fields (e.g.
5 for 5.00). This is also what the real server does, so it's fine.
However, a test was asserting that float fields were floats, so
this test sometimes failed and thus needed to be adapted.

[1] https://github.com/odoo/odoo/commit/81f2bc7

closes odoo/odoo#63992

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2021-01-04 10:37:54 +00:00
Mohammed ShekhaandKamesh Patel 81f2bc7b0a [FIX] web: SampleServer: round float values
before this commit: when field is float type it display too much decimal
precision value, it should be fixed to 2 precision for sample data.

after this commit: float field will display 2 decimal precision value.

task-2318503

closes odoo/odoo#63643

X-original-commit: 61f8ced67992b20edfac139c749ec00939f408a3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Kamesh Patel <kat@odoo.com>
2020-12-21 13:03:22 +00:00
Mathieu Duckerts-AntoineandAaron Bohy fd6182443f [IMP] web: sample data in reporting views (preparatory work)
The present commit brings the global changes necessary to have sample
data in the reporting views. This includes several modifications/
fixes of the sample server (many of them for better visual results).

Task ID: 2282196

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-08-12 08:52:20 +00:00
Julien Mougenot cd1d339763 [FIX] web: Make sample server tests deterministic
Before this commit, there were a few tests in the "sample server" suite
that asserted that every group resulting of a "read_group" would contain
at least one record, while there was actually a slight chance of it not
happening.

Now, the sample server used in the tests has been rendered deterministic
and these kind of issues are completely avoided.

closes odoo/odoo#54164

X-original-commit: a6d32ff46558b68ce3f19458f29c311ee5c658fd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-07-07 08:33:28 +00:00
c7964657ec [IMP] web: add support of "sample" attribute in views
With this commit, it is now possible to display sample (fake)
data in empty views, in the hope of easing user onboarding.
This can be enabled (in list and kanban views) with attribute
sample="1" on the arch root element. In this case, if there is
no data to display, sample data will be generated based on
heuristics (depending on field types and names). This can be
used in addition to the no content helper.

Task 2232801

X-original-commit: 7c8e627ff5029cb539d702705e5ce53d658c76ed
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Jérémy Hennecart <jeh@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-22 13:04:01 +00:00