summaryrefslogtreecommitdiff
path: root/odoo/tools/view_validation.py
AgeCommit message (Collapse)Author
2019-04-02[IMP] web,base: put buttons in list group headersMartin Geubelle
It is now possible to put buttons in the list view group headers. When the view is grouped by a many2one field, those buttons appear next to the header title when the group is opened. The buttons are specified in the views in a <groupby> tag in the list arch, with the following structure: <groupby name="groupedField"> <!-- must be a many2one --> <button type="object" name="my_method" string="Button1"/> </groupby> It is also possible to add `field`, inside the `groupby` which can be used for modifiers. These fields thus belong on the many2one comodel, like: <groupby name="partner_id"> <field name="name"/> <!-- name of partner_id --> <button type="object" name="my_method" string="Button1" attrs="{'invisible': [('name', '=', 'Georges')]}"/> </groupby> These extra fields are fetched in batch when grouping on the field. Part of task 1915702
2018-07-17[IMP] web: add control + create tags to customize "add a line"Sébastien Theys
The default "add a line" button creates a new line with the default values from the model. Sometimes we want to create a new line with different default values (or more generally a customized context), which is possible with this commit. Moreover it is possible to create multiple buttons for multiple default values/contexts. This works both for in-line creation ("editable=") and dialog creation. The new tags are: <control> defines custom controls for the current view. Does not support any attribute, but can have children: <create> adds a button to create a new element on the current list. This makes sense when the parent tree view is inside a One2many field. If any create is defined, it will overwrite the default "add a line" button. For more information and example, have a look at the Views documentation. Technically, the commit will: - parse the new XML tags (+ add appropriate validation) - display the buttons based on the XML - on button click/keyboard: pull up the additional context information from the button event up to the default_get - add unit tests - add documentation PR #25209
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
2017-09-14[IMP] base: improve view rng validation (#17902)Mitali Patel
Split big universal RNG into view-specific schemas and moved rng based view validation into view_validation.py file. Adapt old views, and remove deprecated tag `version="7.0"` from views.
2016-09-02[REF] openerp: move `openerp` to `odoo`Raphael Collet