It has been decided to use Chart.js instead of nvd3 to render charts.
In this commit the graph view has been largely rewritten to benefit
from the options offered by Chart.js.
Task ID: 1946138
This commit extends the support of comparison mode for the graph view
and refine the tooltips and rendering in line mode.
The graph view code has also been slightly refactored.
Task ID: 1946138
The commit https://github.com/odoo/enterprise/commit/19a144d6af2974e964c6487170e6bca1b14d3898 has
modified how libraries are loaded at several places and has
introduced a bug in sale_subscription_dashboard where the
libraries are no longer loaded at all. We fix that situation
by calling super in the willStart method of AbstractAction
that inherits from Widget. Abstract actions can now also
benefit from the mechanism present in Widget willStart.
Before this commit, the 'on_attach_callback' method of a subwidget of
the form renderer would not be called when the renderer renders
itself but is already in the dom. This can cause problems when a
subwidget has to know if it is in the dom for its own rendering.
This commit fixes that situation.
Before this commit the value of a field (of date/datetime type)
used as a groupby was not correctly formatted in the test environment
when the granularity was 'quarter'. This commit fixes that situation.
Old subwidgets of a widget inhereriting from BasicRender were not
correctly destroyed. This was the cause of various problems when
cycling over this.widgets.
Task #1891970
Original p. configurator commit d3530eb
Purpose
=======
- The p. configurator now comes with a widget that is "o2m" like in the SO lines view.
The widget is only used on the added "product_template_id" field on the SO line.
This widget controls the opening of the configuration window and removes the need of a "Configure a product" button.
The "SectionAndNoteListRenderer" is now cleaned from p. configurator specific code.
The widget is also responsible for handling the configuration provided by the p. configurator form
and applying it on the SO line with a 'field_changed' event that updates all the necessary fields.
- Added support for 'MULTI' and 'DELETE_ALL' operations on X2Many fields in basic_model.js
- 'MULTI' allows to batch multiple operations at once
- 'DELETE_ALL' behaves like 'DELETE' with all the current data of the field
Spec
=======
- remove "configure a product" from sale order lines
When the product configurator is active, replace the product_product_id by a product_template_id
in the sale order line. When we select a template without variants, it sets the variant automatically,
but when we select a product template having variants, it opens the configurator dialog.
- add a widget to modify the product configuration in the sale order line (next to product template field)
- UX improvements:
- Invert image and configuration in the main screen
- If the product doesn't have an image, hide it instead of showing the placeholder (only for first screen?)
- new independent option in sales settings to activate product configurator.
(same in e-commerce)
- demo data: Change demo data to set Customizable Desk & Conference Chair as make to order
- If only one attribute value that is Custom, don't display radio, selection or even color box
The attribute is true by default, but when it is set to `false`
in a test, it was not correctly passed in the view.
Note that it has no impact currently in the tests.
closesodoo/odoo#32175
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This feature was already working in the actual version of Odoo but it is now tested. The following
features are supported:
- When the value of one widget is modified, the other ones change accordingly
- The modifiers 'invisible' and 'readonly' are applied correctly if they differ between widgets.
However, the modifiers 'required' must be equal for the several fields, otherwise the behavior
is not guaranteed.
closesodoo/odoo#32158
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Rev. odoo/odoo@5c6a7c9 made a change to reuse an old group datapoint when
performing a read_group, instead of restoring *some* properties of the old
group (so basically a `_.omit` instead of a `_.pick`).
This is a bad idea as some properties were bound to the new datapoint
(`evaluateModifiers` for example) so it doesn't make any sense to update
the old datapoint with theses properties.
closesodoo/odoo#31956
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
A fix attempt for the clickEveryWhere test was made in 39e71353c5.
Unfortunately, the last modification of the fix were not tested on the
runbot and introduced two new issues.
1) The click method on the home menu has been changed to use an enhanced
_click function. This function crash when the jquery element is empty.
As this menu does not exists in community, the test miserably fails.
2) A "focus" event was added in the _click function that simulates a real click.
But the "focus" event is not a mouse event and as nothing to do there.
With this commit, the _click function returns immediatly when the
element is empty.
Also, the "focus" event is removed from the _click
simulation but a focus method is used to give focus to the close button.
Giving the focus to the cancel button is itself a fix for the
DateTimePicker field (see 39e7135).
closesodoo/odoo#32082
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
During the clickEverywhere test, when a modal is opened, the hide method
is called to bypass it. This is not realistic and does not work in some
cases.
For example in Point of sale, menu "Reporting/Sales Details", a modal is
opened with a DateTimePicker (tempus dominus) already opened.
When hiding or closing the modal, the DateTimePicker needs to perform
some cleanup. If the modal is simply hidden, the DateTimePicker is not
cleanly destroyed.
With this commit, a modal is closed by clicking on its close button and
before that, the focus is set on the close button to let the
datepicker widget do its stuff on losing focus.
Also, a more realistic click is done by trigerring more events (code
adapted from tour helper).
closesodoo/odoo#32038
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Since odoo/enterprise@b830ea7ed2, the enterprise home menu is asynchrnonous.
Because of that, the clientActionCount variable is updated too late and
this counter is screwed up, making the test fail.
With this commit a setTimeout 0 is used to click on home menu in the
next tick and then update the current action count.
Also
* the test is adapted to stop immediately when an error is catched.
* the initial click on home menu is moved into debug manager because
the python test launcher uses the correct location already.
Thanks to @VincentSchippefilt and @aab-odoo
closesodoo/odoo#31949
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
When the user has not set any image, it now displays the default
user image placeholder instead of the image placeholder in livechat.
Task-ID 1924666
closesodoo/odoo#30821
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This error is there to help developpers realize their view has not
been loaded due to an error.
However, we have cases where we define actions containing views
that only exist in Enterprise to avoid creating an entire bridge
module just to add one view to an action.
The error was triggered in this case which resulted in a red build
for the click all runbot test, even though this was not really a
true error, as it was intended.
This commit changes the error to only appear in debug=assets such
that it will no longer put the click all runbot tour red while
still providing help for the developper trying to debug his view
since he will need to be in debug=assets to debug his view anyway.
closesodoo/odoo#31884
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Let's assume the following scenario on an action with two multi
records views (e.g. kanban and list). In the kanban view, activate
a domain or groupby, switch to list view, remove the domain or
groupby, switch back to kanban: the domain or groupby is still
applied (even though it's no longer displayed in the search view).
This is due to the jQuery update (ab56e637b7) and the use of
native Promises (always async) instead of old jQuery 1.11 Deferreds
(which where sync when already resolved). In the new version, the
domain/context/groupby were added to the params a 'tick too late',
so the view was updated without that information (and thus the old
domain/context/groupby were kept).
Issue reported on the jquery update pad.
closesodoo/odoo#31859
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
After the update of jQuery, crashes were no longer displayed (in
dialogs) on browsers using the unhandled-rejection-polyfill lib
(e.g. firefox). This was due to a bad conversion from ES6 to ES5.
Issue reported on the jquery update pad.
closesodoo/odoo#31767
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
*partner_autocomplete,test_main_flows
In jQuery 3, the active element in autocomplete dropdowns is no
longer identified with class 'ui-state-focus' on the <li/>, but
with class 'ui-state-active' is on its child <a/>. Moreover, the
background color of the active element is now set on the <a/>
instead of the <li/>.
This rev. adapts scss rules accordingly, and selectors in the
main_flow_tour.
Issue reported on the jquery update pad.
closesodoo/odoo#31693
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Following of https://github.com/odoo/odoo/pull/28457. Promises which
are rejected are acting the same way as exceptions and thus have to be
catched. The Odoo `guardedCatch` method is not stopping the exception
though. In the backend, unhandled promise rejections are catched by the
CatchManager, which then ignore them.
This commit makes the frontend act the same way regarding unhandled
promise rejections. We might want to share the crash manager behavior
someday.
Part of https://github.com/odoo/odoo/pull/31664closesodoo/odoo#31664
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
We had to manually convert the unhandled-rejection-polyfill lib,
and we forgot to replace this by self in two arrow functions.
This was causing crashes e.g. on Firefox.
We also forgot some uses of const, which is not really an issue as
const is supported on all browsers, but it is not ES5.
Issue reported on the jquery update pad.
closesodoo/odoo#31658
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
This commit adds a 'guardedCatch' function to the Promise API. This function
has to be used when we don't want to swallow real errors (crashes), like
'catch' does (i.e. basically all the time in Odoo). When the promise has
been rejected because of a real error, the rejected Promises chain bubbles
up to the top and triggers the 'unhandledrejection' event (triggered on
all browsers thanks to the unhandled-rejection-polyfill lib). We then add a
listener on that event to display real errors with the CrashManager.
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>
The Actions/Print dropdowns may overflow the screen in case of very long
lists of menu entries, when based solely on the default BS4 styles for
`dropdown-menu`.
The `o_dropdown_menu` class forces a vertical limit and a scrollbar when
this happens, and should be applied to those control-panel dropdowns to
prevent this UI glitch.
See also 1c1c0897e8 which adapted
dropdowns to BS4.
closesodoo/odoo#31251
1) Remove the total record tooltip from kanban group.
2) Remove progressbar help from kanban view.
3) Improvements in testcase since we have removed total record tooltip.
When evaluating js tests using the browser_js method, they are
considered a success when 'ok' is found in the console log and a failure
if 'error' is found instead.
This is not very robust and recently failed with this commit : 7410de111f
It adds a filter named 'Error' in a view, when the 'click_all' test
clicks on this filter, a message with the name of the filter is written
in the console, wrongly leading to a test failure.
With this commit, the browser_js method expects a log message in the
browser console with the explicit text "test successful".
On the other hand, any error in the console log will lead to a test
failure but a test can be forced to fail with the explicit error message
in the browser console "test failed".
As a bonus, the python logger should now also log browser js trace messages.
closesodoo/odoo#31158
Let's assume a form view with a clickable statusbar, in readonly.
When the user clicks on a status, the change is saved directly.
When the save fails (e.g. access rights), the statusbar widget
is in an inconsistent state and must be reloaded.
This rev. reloads the whole record and re-render the form when
this happens.
Related to Issue: #1915391closes#29519
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
Active currencies are given in session_info, in the page source.
When the user activated a new currency, he had to reload the page
to make the browser aware of that new currency (without reloading,
there was no currency symbol displayed next to the amounts).
This rev. forces a reload of the currencies each time a currency is
edited.
Task #1838654closesodoo/odoo#31192
Issue: wysiwyg asset slow down the loading of the website, error
inadvertently introduced: https://github.com/odoo/odoo/pull/29775
The assets are now loaded assynchroneously, when the editor is needed,
its assets will be loaded.
closesodoo/odoo#30700
[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. The Profile will show the employee of the current company.
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.
## Changed modules
### hr_attendance
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 hour.
-> The status is accurate on the report view (status is still updated
when loading the view)
-> The status in accurate at 1 hour on the kanban view
### [ADD] hr_attendance_presence
Bridge module between `hr_attendance` and `hr_presence`.
This PR 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
[ADD] hr_skills: Introduce a new module for employee resumé and skills
=======================================================
Purpose
-----------
Consultancy companies need resumé and skills of their consultants.
For big projects, they often need to send them to their customers.
These information are also useful to statistics.
Specification
-----------------
### New models
#### `hr.resume.line.type`
Types of resumé lines. e.g. *Experience*, *Education*, *Hobbies*
#### `hr.resume.line`
It is a line in the resumé of an employee.
#### `hr.skill`
Name of a skill. e.g *French*, *Python*, *Piano*
#### `hr.skill.type`
Skills can belongs to a particular type. A skill type has skill levels associated.
e.g. *Languages*, *Dev*, *Music*
#### `hr.skill.level`
Levels available for a particular skill type. Each level has a label
and a progress (between 0 and 100) associated.
e.g. *Intermediary (20%)*, *Advanced (85%)*, *Expert (100%)*
#### `hr.employee.skill`
These are skills which employees have. It links an employee with a particular skill
and level.
e.g. Mitchell has an *Intermediary* level in *Python*
### Access Rights
Only a `hr_user` can create/edit `hr.resume.line.type`, `hr.skill`, `hr.skill.level`, `hr.skill.type`.
If employees are allowed to edit their infos (setting), they can also create/edit `hr.resume.line`,
`hr.employee.skill` for themselves.
### UI
Resumé lines are displayed, grouped by type, in a new 'Resumé' tab in the employee
form. Resumé lines can be reordered (handle widget)
Emloyee skills are displayed in the Resumé tab, grouped by skill type.
[IMP] hr, hr_holidays, hr_expense: Change onchange parent_id behaviour
=========================================================
Purpose
-----------
When the manager (parent_id) of an employee changes, it doesn't always mean that other responsibles (Leave responsible, expense responsible, coach) should also change.
Specification
-----------------
When changing the employee's manager, the leave responsible, the expense responsible and the coach should be changed only if the field was not set or if the responsible is the previous manager. In that case, they should be set to the new manager. Otherwise, it means the field was most probably set manually and it should be left unchanged.
Task 1913089
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#30502
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
Before this rev., it was possible to specify default values for
categories (fields with attribute select="one") in the context
(e.g. searchpanel_default_fieldname: 5). It is now possible to
specify default values for filters (select="multi") as well
(e.g. searchpanel_default_fieldname: [1,2]).
closesodoo/odoo#31107
On IE11, in 10.0 up to master in some instance when creating a record
under some conditions the dropdown may be automatically opened and need
to be closed.
This has been pinpointed to 90c1af1151 so it seem that a combination of
fields/code/autocomplete and changing the placeholder at one time causes
the issue.
Since IE11 lie and say it is mozilla 11.0 we just apply the 90c1af1151
when the browser is chrome (we did no did this at first to have the same
behavior accross browsers).
note: there is an opened bug in chromium https://crbug.com/928305 if
solved the hack could be removed completely.
opw-1940592
closes#31271