Commit Graph
59 Commits
Author SHA1 Message Date
Bruno Boi b4b834c0a9 [REF] web: simplify popover hook usage
**Before this commit**
Almost all of the use cases of the `usePopover` hook are dealing
with an abnormal amount of complexity:
- they have to store the closing function of the popover, and sometimes
  keep track to its opening state,
- you can find a duplication of a useUniquePopover hook, which is
  anyway the behavior that is always wanted for popover users.

This is due to the fact that usePopover is just some kind of wrapper
to the lower level popover service.

**After the commit**
- The usePopover now has a new API, which simplifies its usage.
- The useUniquePopover hook implementations have been removed and
  this "unique" behavior is now merged into usePopover
  and has become the standard one (not configurable).
- All of the use cases have been adapted, even the cases where
  components used directly the popover service (through `useService()`).

See the adapted jsDoc around the hook in popover_hook.js

closes odoo/odoo#118066

Related: odoo/enterprise#39654
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-04-13 16:40:19 +02:00
Jurgen (jugj) a0b256e41f [IMP] hr_employee : make UX improvements
task - 3203838

closes odoo/odoo#114677

X-original-commit: dbb6ad44d2bf027f1fae34f616fa39e614ac8e8e
Related: odoo/enterprise#37908
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-20 16:51:06 +01:00
Kevin Baptiste 8c1ab1f47c [IMP] data_recycle,hr_*: JS improvements
*: hr_attendance, hr_org_chart

Apply recommendations from odoo/odoo#104975 to HR apps.

task-3069138

closes odoo/odoo#114208

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-02 18:18:56 +01:00
Michael (mcm) 9f4622492c [REF] *: register field descriptors instead of components
Before this commit, the field's description was stored on the
component and this component was then registered.

Now, an object describing the field is used on registration the same way
as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671.
This split the component's description (props, template, ...) of
the field's description (displayName, supportedTypes, ...) and makes
it clearer.

closes odoo/odoo#112498

Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-16 14:13:32 +01:00
Adesh Jolhe eee988bc89 [IMP] hr_org_chart: fix the traceback when we click on See All of the Organization Chart
Steps to reproduce:
- Go to Employee
- Open the Employee profile and click on Work information.
- In the Organization Chart Below the hierarchy See All button is visible.
- Click on the 'See All' button.

Currently, when we click on the ``see all'' button of the organization chart, the traceback
comes. Fixed it in this commit.

task-3133047

closes odoo/odoo#110476

X-original-commit: 9f4e1fa80dc75900fb8a2c979568c3ab8f65a635
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-20 09:40:49 +01:00
Malay Khamar 5333fe2acc [FIX] hr_org_chart: fix the hr ORG chart parent employee redirection issue
closes odoo/odoo#103726

X-original-commit: 1fb8fa16ab7dc298d54f089d7163fb556dbc5fcc
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-21 11:09:22 +02:00
William Braeckman 90c035b70e [FIX] hr_org_chart: fix data not being reloaded
This commit fixes an issue with the org chart since it was converted to
owl, the data would not be reloaded when changing from record to record.
Instead it would always show the data from the first record it ever
loaded.

closes odoo/odoo#99618

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-07 11:25:48 +02:00
Yannick Tivisse 4400bd15ba [IMP] hr_org_chart: Migrate widget to owl 2022-08-24 09:23:01 +02:00
Romeo Fragomeli cf4f23d484 [FIX] web,*: adapt old BS4 classes
*: hr_org_chart,l10n_gcc_invoice_stock_account,mail,point_of_sale,
   purchase,website,website_sale,website_sale_autocomplete,
   website_slides_survey

Some commit have added old Bootstrap 4 classes after the merge of
Bootstrap 5.

Note that it's not possible anymore as the merge bot is now able to
detect it.

closes odoo/odoo#98349

Related: odoo/enterprise#30551
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-18 16:47:30 +02:00
stefanorigano (SRI) a75530c323 [IMP] hr: review and optimize SCSS
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2865713

closes odoo/odoo#93049

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-08-08 10:50:48 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 9b5c9484fe [REF] *: BS5: adapt changes in media query mixin
> Media query mixins parameters have changed for a more logical approach

> media-breakpoint-down() uses the breakpoint itself instead of the next
> breakpoint (e.g., media-breakpoint-down(lg) instead of
> media-breakpoint-down(md) targets viewports smaller than lg).
> Similarly, the second parameter in media-breakpoint-between() also
> uses the breakpoint itself instead of the next breakpoint (e.g.,
> media-between(sm, lg) instead of media-breakpoint-between(sm, md)
> targets viewports between sm and lg).

https://getbootstrap.com/docs/5.1/migration/#sass

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 23c3a31a0d [REF] *: BS5: removal of .media class
https://getbootstrap.com/docs/5.1/migration/#grid-updates
https://getbootstrap.com/docs/5.1/utilities/flex/#media-object
https://github.com/twbs/bootstrap/pull/28265

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:19 +02:00
Kevin Baptiste 93ed43bcb3 [IMP] hr_org_chart: use flexbox
Use flex on the popover header to better handle long names.

closes odoo/odoo#94236

Taskid: 2888199
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-23 09:00:31 +02:00
Jorge Pinna Puissant bc20eb4790 [IMP] test_lint, *: enable no-unused-vars rule
Part-of: odoo/odoo#85569
2022-03-02 13:05:42 +00:00
William Braeckman bccd62a54d [FIX] hr_org_chart: remove res_id from the widget's action
On the employee view there is a possibility to open a list of all the
employees managed by the current employee however the action contains
the key 'res_id' which makes both create and open action invalid. (the
manager is opened either way instead of the right action)

The action now also has a proper name instead of displaying `unnamed`,
aswell as containing the context necessary to default the manager as
expected. and the triple dots displayed when there are too many
employees has been replaced with `See All`.

TaskId-2648133

closes odoo/odoo#76905

X-original-commit: 2fe87bcfbf0c9b1f08cc2c38f0881de3738af537
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
2021-09-21 16:08:47 +00:00
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
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-28 10:05:12 +00:00
Lucas Lefèvre f33e7b851d [FIX] hr_org_chart: Position subordinate popover with rtl lang
With a Right to Left lang.
Go to an employee form view.
Click on the small pill with the number of subordinates (in the org chart).
The popover opens but on the right side of the window instead of next to the
pill.

Fixes #38722

closes odoo/odoo#38873

X-original-commit: 292d4e7ba6bde6970382c816e092892f64e58c73
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2019-10-16 11:52:23 +00:00
Kevin Baptiste c48648a7a5 [FIX] hr_org_chart: prevent line from appearing on transparent image
Before this commit, the tree line of the org chart was appearing under
images with a transparent background.

closes odoo/odoo#37212

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-20 14:36:32 +00:00
Sébastien Theys 1e9772889b [IMP] *: use image.mixin when appropriate
The following models are already using big images, or they might need big images
in the future:

- partner
- hr employee
- shop category
- lunch product
- gamification badge and karma rank

PR: #34925
2019-08-02 16:47:58 +00:00
Kevin Baptiste e9d9898276 [IMP] hr: Review the UX for 'My Profile' view
1/ web: adapt formatDate to handle NaN values
DashboardRenderer might return NaN for `Date` or `DateTime` fields if
their original value is null or incorrect.

2/ hr: add job_title in demo data

3/ hr_recruitment: link employee in the chatter for new recruits

4/ hr: remove employee documents in the model

5/ hr_attendance: improve resiliency of relative_time

6/ hr: display manager on res_users

7/ hr: change Address Book to Employee Directory

TaskID: 2009111

closes odoo/odoo#34180

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-18 10:27:50 +00:00
Mohammed Shekha 37a82e62a2 [FIX] hr_org_chart: Render org chart even if no data
currently if no data given to hr_org_chart it throws traceback
because hr_org_chart template always expect that there will be
managers and children key in qweb rendering context, always pass
managers and children in qweb context if _getOrgData method returns
nothing still hr_org_chart should be rendered and should not throw
traceback

task-2000269

closes odoo/odoo#34152

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-25 08:04:32 +00:00
RomainLibert d09d5c2e8a [IMP] hr_org_chart: Adapt module with new hr.employee.public model 2019-05-31 10:21:20 +02:00
Yannick Tivisse a5b6f31cf2 [IMP] base: Contextualize the multi company
Purpose
=======

Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.

It is confusing for users to see the records from the company he is connected to
and the records of the children companies.

Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.

/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.

Specifications
==============

1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.

2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.

3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.

4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.

5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.

6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.

7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids

8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.

9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.

10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.

11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624

12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.

13/ Introduce a res.group to enable/disable the multi company per tab
feature.

14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.

15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.

16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.

17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.

TaskID: 1960971

closes odoo/odoo#32341

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-13 08:57:49 +00:00
934f054e4c [REF] hr_org_chart: adapt code after jQuery update
Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:17 +01:00
Lucas Lefèvre d77ce4c2a9 [IMP] hr_*: introduce the employee profile
General Purpose
===============

We want an 'Employee profile' gathering every data about an employee.
The main form view is modified to become this employee profile.
A user can also see his own profile through the Preferences menu.
The new profile replaces the current Preferences view if the hr module is installed
and the current user is linked to an employee.

A user should be able to see and edit his own profile.

*Problem*:
Many fields on hr.employee are protected by groups="hr.group_hr_user".
Therefore, a regular user cannot see or edit those fields.

This protection must be bypassed to allow read/write access
to the regular user's own data.
A similar mechanism already exists for res.users (for Preferences)

The better (least worst) solution found is to reuse this mechanism by adding related fields on res.users.

Pros:
- Don't change security access on hr.employee
- Don't implement yet another custom security layer, risking to add new security breaches
- A lot of fields are added by other modules on hr.employee.
  It would have required to integrate them with the custom security layer.
- Fields added by other modules on the user's preferences view (normal view, not the profile)
  are automatically included in the employee's profile view.
- Allow the hr.employee form view to be different than the user profile accessible
  through the Preferences menu.
  E.g. add custom buttons only relevant to the logged in user such as "Request a leave".
Cons:
- Each field from hr.employee that you want to appear on its profile
  must be added as a related field on res.users
- Those related fields must be added to user's preferences view (duplicate views)
- They also must be added to SELF_[READABLE | WRITABLE]_FIELDS

Note:
When the front-end loads the views it gets the list of available fields
for the user (according to its access rights). Later, when the front-end wants to
populate the view with data, it only asks to read those available fields.
However, in this case, we want the user to be able to read/write its own data,
even if they are protected by groups (groups are kept on the related fields on res.users).
The front-end need to be made  aware of those fields by sending all field definitions.

hr_attendance
=============

This commit integrate attendance in the new employee profile.
It also adds a stat button to this employee profile showing
the number of hours worked last month.

Remove the boolean computed field 'manual_attendance'.
This field is just a shortcut to add/remove the employee's user
in the "Manual Attendance" group.
The checkbox is confusing on the employee's form and this should
be done through the normal group management screens.

hr_presence
===========

Display the presence status on the employee kanban template.
The status is a colored chip which can be green (present),
orange (to define) or red (absent).

Currently, the presence status is only computed when accessing
the report view. As this commits displays it on the employee kanban,
it should be updated more frequently.
The state should not be updated every time the kanban view is loaded
since the computation is a bit heavy. Instead: add a cron to update
status every 15 minutes.
-> The status is accurate on the report view (status is still updated
   when loading the view)
-> The status in accurate at 15 minutes on the kanban view

[ADD] hr_attendance_presence
============================

Bridge module between hr_attendance and hr_presence.

This commit integrates hr_presence module in the employee
profile and adds the presence status on the employee kanban view.
But hr_attendance adds at the same place a similar status icon for
checkin/checkout.
This bridge module makes the status from hr_presence invisible as
hr_attendance should be the main presence control mechanism.

Also, this commit adds the ability (through a new setting option)
for hr_presence to take into account checkin/checkout to determine
the presence status.

l10n_be_hr_payroll
==================
integration with employee profile
2019-02-14 16:28:54 +01:00
Christophe Simonis a337b9ec92 [MERGE] forward port branch 12.0 up to f854e01a98 2019-01-18 14:26:33 +01:00
Christophe Simonis 378b283c02 [MERGE] forward port branch saas-11.3 up to 83cc046e9a 2019-01-16 17:02:34 +01:00
Jorge Pinna Puissant 6c47c68eb7 [FIX] hr_org_chart: undefined manager name in breadcrumbs
Before this commit, in the organization chart, when a manager that have too many
subordinates, and we want to view all the subordinates clicking the '...' button. There was
an error in the breadcrumbs, the text 'Undefined' was shown in the place of the manager's
name.

Now, the breadcrumbs shows the name of the manager.

OPW-1923990

closes odoo/odoo#30231
2019-01-16 09:35:35 +00:00
lul-odoo 48254cc8a1 [IMP] hr_org_chart: Allow recursion in hierarchy
Employees can appear multiple times in the org chart

Purpose
=======

Allow recursive hierarchy (an employee can be its own manager; e.g. the CEO is manager of everyone
but is also member of a department managed by the CTO who is himself managed by the CEO).
This means an employee might appear in multiple place in the organisational chart.

The button to see more of the hierarchy in the organisation chart opens all employees under the N+2 of the
current employee being displayed but does not open the view of the N+2.

Specification
=============

Add 'subordinates_ids' computed field on 'hr.employee' to get all subordinates (direct and indirect).

closes odoo/odoo#27900
2018-12-06 13:56:45 +00:00
Christophe Simonis ce4cc24621 [MERGE] forward port branch 12.0 up to 82a1e1dcc3 2018-11-29 20:06:16 +01:00
qsm-odoo 1f37ec3b0b [REF] account, hr_org_chart: use correct sub-assets
Some variables were placed at the beginning of the backend helper.
While it was working, the normal convention is to place them at the
end of the variables helper.

closes odoo/odoo#28203
2018-10-26 14:13:41 +00:00
Nicolas Lempereur e942c3520b [FIX] hr_org_chart: 3 level num subordinate right
On the third level of a organization chart, the number of subordinates
on the right but over the container boundary.

For the second level there was already a special case:

  padding-left: $tmp-gap-base;

So for the third a fix could have been:

  padding-left: $tmp-gap-base*2;

But this changeset replaces margin by padding so invisible content does
not create a horizontal scrollbar (since we had 100% width with
margin-left that busted it out of its container).

opw-1912437
closes #29043
2018-11-28 12:39:14 +00:00
David Beguin 6d141a1ab9 [FIX] hr_org_chart : Fix width of organisation chart
Task ID 1881825
Closes PR #27087
2018-09-20 09:56:14 +02:00
qsm-odoo c120eb3a29 [FIX] hr_org_chart: BS4, restore most of the hr_org_chart feature
With BS4, the popover and the chart design were broken. This is now
restored but could still use a bit of redesigning.
2018-08-02 09:55:20 +02:00
qsm-odoo 98c0fef0af [REF] *: BS4, review the 'media' structure
Only two classes remain to declare a media structure:
'media' and 'media-body'. 'media-left/right' are guessed by their
position using the flex layout.

Also, the 'media-list' class has been dropped but <ul/> element
should use the 'list-unstyled' class instead.

Like all other components, spacing between medias are now to be
handled explicitely thanks the spacing utility classes.
2018-07-27 12:36:54 +02:00
qsm-odoo d48b8593dd [REF] *: BS4, 'pull-left/right' -> 'float-left/right' 2018-07-27 12:36:54 +02:00
qsm-odoo 7285e152c1 [REF] *: BS4, adapt the badge component structure
The '.badge' elements must now also use the 'badge-pill' class to get
the same style as before as '.badge' elements without it are meant to
replace the old 'label' component.
2018-07-27 12:36:54 +02:00
qsm-odoo 6e223b9273 [REF] *: BS4, adapt tables (and list view)
`table-condensed` -> `table-sm`

Also SCSS variables were renamed.
Also restore list view design.
2018-07-27 12:36:54 +02:00
qsm-odoo 443735949e [REF] *: BS4, replace img-rounded/img-circle classes
'img-rounded' -> 'rounded'
'img-circle' -> 'rounded-circle'
2018-07-27 12:36:54 +02:00
qsm-odoo 59237ea819 [REF] *: BS4, review panel and well structure
Panels and wells were dropped and replaced by the "Card" component.
2018-07-27 12:36:54 +02:00
qsm-odoo d8c217a67d [REF] *: BS4, review color system
Odoo used to declare two main colors: primary and optional (which are
purple and turquoise in enterprise). Those were respectively assigned
to the 'primary' bootstrap variable and the 'btn-primary' bootstrap
variable.

BS4, however, does not allow to have a different primary color for
buttons. Instead, the 'primary' color is used for all 'primary' related
components and utility classes, same as for all other colors. So, if we
want to keep our enterprise buttons green, our 'optional' colors had to
become our 'primary' color. The old odoo primary is then renamed to the
'odoo' color.

The palette of grays is now larger by default and is numbered from 100 to
900 alongside the $black and $white variables. The equivalence for older
variables and the way we used them is:

$gray-darker          ->  gray 900 (unused before)
$gray-dark            ->  gray 900
$gray                 ->  gray 700
$gray-light           ->  gray 600
$gray-lighter-darker  ->  gray 400 (the old variable was created by us)
$gray-lighter-dark    ->  gray 300 (the old variable was created by us)
$gray-lighter         ->  gray 200

Fortunately, the 'lighter' variations we created fit well in the default
BS4 system ! Unfortunately, our $gray-lighter which carried the same
function as $gray-200 (see above) is very close to the new default
$gray-100 and quite distant from the new $gray-200. This will be handled
in the next commit.
2018-07-27 12:36:54 +02:00
qsm-odoo 3467a90c00 [REF] *: BS4, the $text-color variable was renamed to $body-color 2018-07-27 12:36:54 +02:00
qsm-odoo ea7c3f4a69 [REF] *: BS4, get rid of the removed 'square' mixin 2018-07-27 12:36:54 +02:00
qsm-odoo 0ca6d39777 [REF] *: BS4, adapt media queries
media queries that target a specific screen size handled by bootstrap
have now a more convenient way to be defined:

```
@​media (min-width: $screen-sm-min) { ... }
->
@​include media-breakpoint-up(sm) { ... }
```

```
@​media (max-width: $screen-sm-max) { ... }
->
@​include media-breakpoint-down(sm) { ... }
```

```
@​media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { ... }
->
@​include media-breakpoint-only(sm) { ... }
```

```
@​media (min-width: $screen-sm-min) and (max-width: $screen-md-max) { ... }
->
@​include media-breakpoint-between(sm, md) { ... }
```

Also, bootstrap has changed the values for its default screen sizes:

------------------
     | BS3 | BS4 |
------------------
0    | XS  | XS  | -> Portrait Mobile
576  | /   | SM  | -> Landscape Mobile
768  | SM  | MD  | -> Portrait Tablet
992  | MD  | LG  | -> Landscape Tablet / Small Desktop
1200 | LG  | XL  | -> Desktop
------------------

While it is possible to configure BS variables to behave as BS3, we took
the decision to keep the BS4 variables untouched. BS4 system seems
indeed better and having the purest bootstrap possible is better for
Odoo to be used as a framework.
2018-07-27 12:36:54 +02:00
qsm-odoo 2d5595fcba [REF] web, *: BS4, adapt use of tooltip/popover.js 2018-07-27 12:36:54 +02:00
qsm-odoo 770aec399c [REF] *: get rid of vendor prefixes
BS4 do not provide vendor prefixes scss mixins anymore as it is meant
to be used with the 'autoprefixer' library. As we only support the last
version of every major browsers in Odoo, we took the decision to not
use the library as it was also complex to integrate in Odoo. We decided
to do the library's work by hand if it ever become necessary.
2018-07-27 12:36:54 +02:00
kujiu 9de1bc0eef [IMP] Improve compatibility with screen readers (accessibility) (#24574)
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-06-22 21:22:21 +02:00