summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/views/sample_server_tests.js
AgeCommit message (Collapse)Author
2021-02-17[FIX] web: do not display cover images in sample dataMohammed Shekha
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#66350 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-01-04[FIX] web: SampleServer: fix randomly failing testAaron Bohy
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#64008 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-12-21[FIX] web: SampleServer: round float valuesMohammed Shekha
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#55987 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Kamesh Patel <kat@odoo.com>
2020-08-12[IMP] web: sample data in reporting views (preparatory work)Mathieu Duckerts-Antoine
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-07-07[FIX] web: Make sample server tests deterministicJulien Mougenot
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-06-22[IMP] web: add support of "sample" attribute in viewsJérémy Hennecart
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>