summaryrefslogtreecommitdiff
path: root/odoo/addons/base/tests/test_view_validation.py
AgeCommit message (Collapse)Author
2019-12-09[REV] web: reverts update to fontawesome 5.11.2Kevin Baptiste
This reverts commit ff1c35513aecef5fbc30f7c2f3834450e719714e. closes odoo/odoo#41480 X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc Related: odoo/enterprise#7110 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28[IMP] web: update to fontawesome 4.7.0 to 5.11.2Kevin Baptiste
FontAwesome 5 introduced new names for some icons as described on https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes This commit replaces the old names to the new ones. closes odoo/odoo#35826 Taskid: 2050241 Related: odoo/enterprise#5180 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-13[REF] base: refactor check_xml and read_combinedXavier-Do
View creation/edition represent a important part of an install and a lot of possible view errors are not detected, like fields used in domain filters. Some part of the code a difficult to maintain, and view checks are splitted in multiple places. This commit aims at refactoring view validation by regrouping most part of the logic in ir_ui_view and trying to optimize the overall process. Since most of the lines were touched, this task was also an opportunity to modernize the API. Main changes on method `check_xml`: - extract node processign and validation to individual postprocessor - add validation for filter node, buttons, ... - fix accessibility checks (and improve their performance) - move xpath check to specific Python node validator - clarify error messages (wip to continue) Main changes on method `read_combined`: - optimize the search for inheriting views in a single query doing the whole recursive search Indeed, after removing xpath validations, `get_inheriting_views_arch` was the most expensive method in `check_xml`, spending most of the time in `search` because of recursive calls to retrieve children views. The view Backend Assets is a good example of the latter point, since a line is added in the view for almost every module. 70 views (community) are added at first level, `get_inheriting_views_arch` is efficient and returns all 70 views. Then at the second level, the method `get_inheriting_views_arch` is called 70 times for nothing. 70 calls to `search` (squared/2 since each view is checked independently) are almost useless. The same case applies to the settings view. As a result, the average module installation time is 25% faster, and the average time spent in `read_combined` is almost divided by 2.
2019-10-30[FIX] core: remove broken time consuming checksfw-bot
The two method valid valid_alternative_icon_text and valid_title_icon represent ~13% of an install all. Rewriting them in master with in #36373 is the main reason of the performance improvement. Those two method logic were broken, because `xpath += '[not(//*[' + valid_attrs_xpath + '])]'` will actually search for valid_attrs_xpath from view root, not from fa- node. -since this check will only log a warning and so only impact bugfix, no impact on user editing views, -since a new check is added in master with the corresponding fix in views, -since this check doesn't really test what it is suppose to check, -since fa accessibility is great, but not critical ->removing those check will slightly speed up build without major impact on views quality closes odoo/odoo#39566 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-11[IMP] core: improve test_tagsXavier-Do
Add the support to be able to specify exlicitely module, class and method name in test_tags Before this commit, there is no distinction between module tag and test tag. Meaning that --test-tag module_name will replace the default +standard tag and execute all test of the module. This commit tries to keep the initial behaviour, while addind new features, like explicit modules tag with /module_name, as well as class (:class) and method (.method) Some usage examples: --test_tags /module will execute all standard test of module --test_tags :class will execute all standard test with class name 'class' --test_tags .method will execute all standard test with method name 'method' --test_tags external/module will execute all external test of module --test_tags */module will execute all tests of module, --test_tags */module,-standard will execute all non standard tests of module, --test_tags -/website:TestUiTranslate.test_admin_tour_rte_translator will disable only rte translator test closes odoo/odoo#34756 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2018-07-04[FIX] Syntax of icons (#25577)kujiu
Description of the issue/feature this PR addresses: Accessibility improvements forbids the use of the syntax `<i class="fa fa-check"/> Some text` to create a labelled icon. But, by this, some fonts are changed. Desired behavior after PR is merged: The old syntax can be used.
2018-06-22[IMP] Improve compatibility with screen readers (accessibility) (#24574)kujiu
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable. This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader. * [IMP] Labels must have a for attribute. Improve accessibility. * [IMP] Better error message when trying to read a missing cached value * [FIX] Add some aria-label and title attributes for screen readers. * [FIX] Template name is not included in the error message in case of SyntaxError in QWeb * [FIX] Improve the Tour failed at step error message to be more explicit. * [IMP] Add aria-labels * [FIX] Add missing aria-label on failing test * [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all. * [IMP] Color names on kanban views and many2many tags * [IMP] Add some checks on views for accessibility. * [IMP] Add `alt` attribute on `img` tags. * [IMP] Add aria-label and title on non-described icons * [IMP] Add button role to widgets with btn class * [IMP] Translate aria and formatted attributes. * [IMP] Remove wrong aria-labelledby * [IMP] Add menu role on dropdowns * [IMP] Buttons must be focusable * [IMP] Add aria attributes on progress bars * [IMP] Improve accessibility of basic widgets * [IMP] Change main layout to more semantic tags * [IMP] Add menuitem role when missing * [IMP] Remove wrong role='presentation' * [IMP] Improve accessibility of tab panels * [IMP] Add aria-invalid on invalid fields * [IMP] Add aria-sort on ordered columns * [IMP] Add role on alerts * [IMP] Use dialog role, header, main and footer tags for modals * [IMP] Add labels on o_status * [IMP] Improve accessibility of kanban view with feeds and articles * [IMP] Add alerts in case of new messages * [IMP] Add widget, navigation or img role to aria-labelled items
2018-01-18[IMP] tests: Add the possibility to tag testsChristophe Monniez
Purpose: When running tests, all the tests for the installed/updated files are done. This commit adds a 'tagged' decorator that can be used to tag tests. Combined with a new 'test-tags' CLI option, it adds the ability to filter which tests are executed. For example, @tagged('slow') will add a tag 'slow' to the test. The CLI option 'test-tags="slow"' will only run tests tagged 'slow'. One can use prefixes to select cases with tags. '+' or no prefix means that the tests tagged with this tag are selected for execution. '-' prefix will exclude the tests tagged with this tag. Exclusion takes precedence over inclusion. Also, by default, all Odoo tests cases are tagged 'standard' and with the technical name of the module. This means that when selecting tests with the 'test-tags' parameter, if '-standard' is not specified, all tests tags are going to be executed. When tagging tests, one can remove such automatic tag by prefixing the tag name with '-'. E.g. @tagged('-standard') will remove the standard tag from the test. Another example, if one wants to test the 'sale' module alone, even without adding any 'tagged' decorator thos tests can be selected like that: --test-tags="sale" Tests are selected or deselected using a TagsSelector. When instanciated, a string is passed with comma separated tests selectors like '+slow,-standard'. When the 'check' method is called with a test as argument, it returns True or False if the test has to be executed or not.
2017-08-20[FIX] P3: fix base64 and StringIO usesXavier Morel
* StringIO removed from stdlib, replace with io * try to correctly handle BytesIO/StringIO (one is for bytes the other is for text) * fix base64: Python 3 removed bytes-encoding and bytes-bytes codecs (via #encode) so replace all calls to str.encode('base64'), also b64encode is a bytes->bytes conversion so attempt to properly handle that issue #8530
2017-04-28[FIX] Various P3-related import changesxmo-odoo
* LDAP import: python-ldap is not python3-compatible, pyldap is Warning: only supported from debian Stretch (current testing)? https://packages.debian.org/search?searchon=names&keywords=pyldap * implicitly relative imports * imports of moved or removed stdlib modules issue #8530
2016-09-02[REF] openerp: move `openerp` to `odoo`Raphael Collet