Commit Graph
144754 Commits
Author SHA1 Message Date
Thibault Delavallée 18b555bbf8 [IMP] survey: reorganize (and fix) demo data
Purpose is to clearly separate various available demo surveys, their user
inputs and input lines. It is easier to update and maintain those demo
data in several files than hidden in big files or CSV files. No change
should occur with this commit as this is only some data manipulation.

We also quickly cleanup some demo data in this commit. Notably

  * remove unnecessary user inputs;
  * improve passed / succeeded statistics by improving or adding right
    answers;
  * fix some typos;

Task-2634805
PR odoo/odoo#72298
2021-08-31 23:34:54 +00:00
ramandDavid Beguin 3d72a6a4d2 [FIX][IMP] web: fix ribbon CSS to allow its use on kanban
Adapt css to allow a nice display of ribbon widget on kanban.

Task-2634805
PR odoo/odoo#72298

Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Mariska Archielli <ram@odoo.com>
2021-08-31 23:34:54 +00:00
ramandDavid Beguin 740f981088 [IMP] web: allow kanban to pass xml attributes
The kanban view allows to instantiate widgets but not to give attributes as
options. Fine tuning some widgets require to be able to control them directly
from XML declaration using options and attributes.

Task-2634805
PR odoo/odoo#72298

Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Mariska Archielli <ram@odoo.com>
2021-08-31 23:34:54 +00:00
jpr-odoo 98857a72d1 [IMP] website_sale: show breadcrumb with current category selected
Show breadcrumb on the shop page if eCommerce Categories are enabled or not
enabled on the left, and there is one category selected visible in the URL.

task-2488865

closes odoo/odoo#72149

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-08-31 23:34:40 +00:00
jdoutreloux a8e6b57fef [IMP] resource,web : modifies the timezone_mismatch widget
This modifies the widget to allow a title option.

Task-2352428
Closes #67021

Related: odoo/upgrade#2223
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-08-31 19:54:19 +00:00
jdoutrelouxandLaurent Stukkens 96ff372034 [IMP] project_timesheet_holidays : generate timesheet entries for global time off
Generate timesheet entries for each employee when a  global time off is created
if module_project_timesheet_holidays is true.

This only impacts the employees with the corresponding resource calendar
The entries are linked to the project and task set in the settings.

The number of hours timesheeted corresponds to the timeframe during which both the global time off
and the working hours of the employee overlap (same behavior as for regular time off).

If the global time off is modified or deleted, the timesheet entry is adapted accordingly.

Task-2352428
Closes #67021

Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
Co-authored-by: jdoutreloux <jud@odoo.com>
2021-08-31 19:54:18 +00:00
Romain Derie 34ea4030b1 [FIX] web_editor: restore linked date field edition
4eafd78847 was not correctly adapted with new editor.
The `removeClass` and the css for that class was left in the code but the code
in charge of adding that class was just removed, breaking the behavior.

closes odoo/odoo#75786

X-original-commit: e59f91d74ad07430a4942efeeb479a538993c918
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-08-31 18:48:54 +00:00
Joseph Caburnay 92e70b8392 [IMP] point_of_sale,pos_*: refund orders thru POS UI
* Perform refunds in the POS UI.
* Select orderlines and quantity to refund.
* Add refund orderlines in the active order.

closes odoo/odoo#75322

Task-id: 2481561
Related: odoo/enterprise#20358
Related: odoo/upgrade#2753
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-08-31 17:11:56 +00:00
Joseph Caburnay a2ff6d5383 [IMP] point_of_sale,pos_*: combine ticket and management screens
We are referring to TicketScreen and OrderManagementScreen.
The two screens almost serves the same purpose. There is not much reason
to keep them separate. We combine the two in this commit. Basically,
we remove OrderManagementScreen and its components. Some are kept and
moved to the TicketScreen.

Task-id: 2481404
Part-of: odoo/odoo#75322
2021-08-31 17:11:56 +00:00
Joseph Caburnay 2c78ed1b27 [FIX] point_of_sale: negative accumulated bank payment
Revert the outstanding and destination accounts when the accumulated
bank payment amount is negative. We do this because account.payment
model doesn't accept negative amount.

Part-of: odoo/odoo#75322
2021-08-31 17:11:56 +00:00
std-odoo 4b3d75437b [FIX] mail: message_notify use the model and res_id arguments
Bug
===
The arguments model and res_id were declared on the method but never
used. This method was supposed to be callable from the model and not
from the records with those 2 parameters.

Make this possible.

Task-2599676

closes odoo/odoo#75779

X-original-commit: 07dbd96b3736efe84b670a7b4d45dd6cd07b14f9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-31 12:43:58 +00:00
William Braeckman b74960f571 [IMP] project: hide dependency change subtype if option is disabled
A recent commit allows mail subtypes to be hidden depending on the
record fields. This allows us to hide the dependency changed subtype if
the option is disabled.

Closes odoo/odoo#75749

Task-2628818

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-31 12:43:54 +00:00
qsm-odoo 014446f84b [FIX] web_editor, website: combine dataset "image" and "img" keys
Commit [1] introduced a new "image" option instead of fixing the "img"
option which already existed. Also it created a <img> tag with a "fa-fw"
class which does not make much sense. Also, our system with data-img
actually creates a <svg> tag so that the color of the icon is the one
decided in our SCSS instead of the one hardcoded in the image and so
that there is an hover effect.

[1]: https://github.com/odoo/odoo/commit/02ccad3200187724d5f133842032981fb91f7465

closes odoo/odoo#75743

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-31 10:01:20 +00:00
Jacky (trj) 5bb8b9de6f [FIX] point_of_sale: info button on empty orderline
Behavior before the commit: when clicking on the info button from the control buttons, if no orderline was selected, a traceback error happened.

After the commit: nothing happens when clicking on the product info button when there's no orderline.

Related task id: 2518884

closes odoo/odoo#75728

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-08-31 10:01:16 +00:00
Jacky (trj) 4e31e49c99 [FIX] point_of_sale: info button on product item is now clickable in mobile
Behavior before the commit: the product information popup could not be called by clicking on the info button from the product item in mobile version. This happens because of the border in the `active` css state of the product item. When clicked, the product item has a 50px border which hides the info button for a micro second.

After the commit: Product information popup can now be called from the product item.

Related task id: 2518884

Part-of: odoo/odoo#75728
2021-08-31 10:01:15 +00:00
Arnaud Joset 1f5c0fdc25 [FIX] google_calendar,microsoft_calendar: hide sync buttons on non calendae views
Before this commit, the sync buttons refactored in https://github.com/odoo/odoo/pull/68700 would appears in all calendar views (sale,time-off,...).
This commit only displays them in the calendar event view.

closes odoo/odoo#75702

Taskid: 2633415
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-31 10:01:10 +00:00
JF Aubert 1016bb25b5 [IMP] mrp: Improve MRP Planning features
Review Work Order pop up design:
- add mo reference and Components tab at first
Manufacturing Readiness:
- set 'When all components are available' as default

closes odoo/odoo#75675

Task: 2527408
Related: odoo/enterprise#20515
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-08-31 10:01:03 +00:00
bbh-odoo 2fb887225d [IMP] hr_timesheet: improved access rights
before this commit:
The approver can access all timesheets which is not coherent.

after this commit:
improved the labelling of the timesheet app's roles, modified the menu according
to role of User.Aprrover now can access his own timesheets only by click only
available option  'My timesheets'.

TaskID - 2531321

closes odoo/odoo#74242

Related: odoo/enterprise#19858
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-31 10:00:50 +00:00
stefanorigano (SRI) 9337562cca [REF] web_editor, *: review editor toolbar design
*: web, website

This commit redesigns the editor toolbar improving its visual appearance
and introducing substantial changes wherever it is rendered.

== "Into-sidebar" design
The grid layout has been refined, improving its components allocation.
For the sake of visual simplification, "list-type" buttons have been
unwrapped from their original dropdown. For the same reason the button
to create a new table has been removed (users will have to use the
command-bar to create a new table).
Table's options have been moved to a section "ad-hoc", visible only when
a table is selected.

== Floating design (backend only)
The toolbar is now white to match the command-bar design.
In order to simplify frontend inheritance, the floating toolbar now uses
grid layout.

== Colorpicker
The generic code necessary for each design has been moved from
'wysiwyg_snippets.scss' to 'wysiwyg.scss'.
The style is now controlled by css variables allowing to customize
critical design properties without the need of SCSS overrides.
By default the design is white(-ish) to match the floating toolbar,
while in 'wysiwyg_snippets.scss' the variables are customized to get the
typical sidebar's dark feel.

Note: despite the task main objective was just to improve/fix the
design, this aimed to simplify design inheritance and reduce the css
too. While inheritance has been improved reducing the amount of
overrides, the attempt to reduce the css partially failed (in the final
lines count must be considered that a new sidebar section has been
created).
The reason is that we currently suffer from a deep and complicated
inheritance structure for this component. The xml template uses default
bootstrap classes that are styled differently depending if loaded in a
community or enterprise environment. This approach leads to overrides
that must cover all the scenarios while further customization must be
taken in account too 'cause the toolbar can be rendered into the sidebar
with a totally different design.

A possible solution would be to detach from bootstrap directly in the
lib using custom classes names, and then @​extend these classes
differently according to the current environment but probably not a good
idea as we want the toolbar to use bootstrap for in-website editors (so
they can match the theme correctly) but this has to be reviewed as well
anyway. To be checked.

Part of https://github.com/odoo/odoo/pull/73565
task-2496339

closes odoo/odoo#73565

Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-31 10:00:46 +00:00
qsm-odoo 7c1c6ecc52 [IMP] web_editor: better show active entry in the text style dropdown
Replace the "¶" icon with the name of the current active text style
entry.

Part of https://github.com/odoo/odoo/pull/73565
task-2496339

Part-of: odoo/odoo#73565
2021-08-31 10:00:46 +00:00
stefanorigano (SRI) 2aea38467e [IMP] web_editor: review floating toolbar and its SCSS structure
The "floating" and the "into-sidebar" toolbar designs are visually very
different but share the same XML template.

Prior to this commit we relied on SCSS overrides to achieve the two
designs, meaning that any new rule added in wysiwyg.scss was supposed to
be followed by an override in wysiwyg_snippets.scss.

This approach led to glitches and undesired behaviors, especially
considering that all customizations we apply are already overrides of
the standalone OdooEditor lib (that, by the way, applies its own
overrides on top of bootstrap too...).

This commit will add the 'oe-floating' class by default, and will
remove it when the toolbar is rendered inside the sidebar.

This approach allows to target the floating design when needed only, and
consequentially will leave the '.oe-toolbar' selector for the code
shared between the two designs.

Part of https://github.com/odoo/odoo/pull/73565
task-2496339

Part-of: odoo/odoo#73565
2021-08-31 10:00:45 +00:00
Julien Banken 28960793da [FIX] auth_signup: fix signup email
A jinja marker is used as email_to but is actually not evaluated. Instead
we can set the right value directly.

Task-2573334

closes odoo/odoo#75770

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-31 08:47:27 +00:00
std-odoo 366cf243ac [FIX] mail_group: fix a traceback when a public user subscribe
When a public user subscribe to a mailing list, a traceback is raised.
Introduced with refactroring odoo/odoo@2d359b909b

Task-2599676

Part-of: odoo/odoo#75770
2021-08-31 08:47:27 +00:00
Romain Derie 23c88405a9 [FIX] base: restore delivery and shipping image on contact in kanban
Since c53724ebc3, the contact image in contact kanban view for a shipping
or delivery contact type would be the regular placeholder instead of the truck
or money image.

Now, by using the new avatar system, we restore that behavior.

+ we also use that new avatar system to cleanup some code in the kanban in the
  form view (`child_ids` field in `Contacts & Addresses` tab). That part was
   working fine but wasn't using the new system and needed extra code.

closes odoo/odoo#75709

X-original-commit: a97cbdd033391af75628bed50accfef11c73687c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-08-31 08:47:14 +00:00
Florent de Labarre 99f6bf96ea [FIX] delivery: is_all_service is False if you have a section line
If you create an sale order with a section line you see the button add delivery.

closes odoo/odoo#75570

X-original-commit: 1db92688d9e7bf0843edfd248ffef89c38bb66f0
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-08-31 08:47:10 +00:00
Mitul Shah 4450f8b093 [IMP] crm: allow sales users to access 'My Activities' menu
Currently, 'My Activities' menu (under CRM > Sales) is accessible only
by the sales manager. However, this menu should be accessible to the
sales user also. The existing records rules make sure that the menu
will display salespersons' own documents only and so there seems no
data leak in this case.

So with this commit, we make the 'CRM > Sales > My Activities' menu
available for the salesperson as well.

Task-2624721

closes odoo/odoo#75521

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-31 08:47:07 +00:00
Joseph Caburnay 26fd276c45 [FIX] point_of_sale: properly handler errors after wowl refactoring
* Refactor the use of Mutex. We remove the unnecessary resolves and
  rejects. The excess rejects trigger the unhandledrejection event
  handler.
* Make sure that the validation of order is not broken when the error
  is about connections (aborted or lost).
* In Chrome, we introduce a set of methods to handle
  "unexpected errors". Prior to wowl, POS just augments the CrashManager
  to show the right popup. But since CrashManager is no longer supported,
  we have to introduce a way to handle those unhandled errors.

closes odoo/odoo#73725

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-08-31 08:46:57 +00:00
Joseph Caburnay 63f09a6180 [FIX] point_of_sale: call the configureGui before calling start
The chrome.comp.start() call also involves iot device loading
which is dependent on Gui to show error when there is any.
In this fix, we call configureGui when the Chrome instance is
available and before calling start.

Part-of: odoo/odoo#73725
2021-08-31 08:46:56 +00:00
Touati Djamel (otd) 7ed01a437f [FIX] hr_holidays: fix time off allocation access right
Steps to reproduce the problem:
- Connect as admin
- Create a new employee, e.g: “Employee1” for company “My Company (San Francisco)”
- Create a new time off request for this employee, and select a time off type linked to the company "San Francisco"
- create a user and do not give him access to the company “San Francisco”, e.g: “user1”
- Log in as “user1”
- Go to time off > Managers > Allocations > remove default filter

Problem:
user1 is able to see the time off allocation of “Employee1”, even though he does not have access to My Company San Francisco.

Solution:
Add multi-company rules  for the “hr.leave_allocation” model to display only the time off allocations to which the current user has access

A rule has already been added for "hr.leave" model:
https://github.com/odoo/odoo/blob/0f3281e3b1dc943b81d79d2a8f82fca7b95b8186/addons/hr_holidays/security/hr_holidays_security.xml#L65-L70

opw-2535709

closes odoo/odoo#75211

closes odoo/odoo#75725

X-original-commit: 90ef15043c7d9c35a22dd7f3c10c78774b6e816a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-08-31 07:31:39 +00:00
alt-odoo 9339b0d685 [FIX] website_crm: allow salesman to see page views of a lead
Side effect of https://github.com/odoo/odoo/commit/69cc2911b52fd17b37fb71544574f63cf09dd17e.

On a lead, there is a smart button allowing to see his page views on the website.
In case we have many views, we are grouping them by page. Currently, the check on
the pages is made through field page_ids which is restricted to Website Editor
access group. We should allow a regular salesman to see page views without error,
and this can be achived by using field website_track_ids.page_id instead.

closes odoo/odoo#75761

X-original-commit: 76e1d609ad0e6d9a3dd2703185f4b87759823c70
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2021-08-31 02:33:48 +00:00
alt-odoo ad5f8e2eff [FIX] survey: No crash when getting stats of answers of a survey
If for any reason the initial linked question of one possible answer was
changed and if one existing survey has already been answered using that
possibility, we currently got an Internal Server Error while we should
simply just ignore these answers when getting the statistics of that
survey.

closes odoo/odoo#75758

X-original-commit: 87096c284872f9aa99f5ae9096cee92663c4933e
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2021-08-31 02:33:44 +00:00
JordiMForgeFlow 0b07210fe1 [FIX] stock_account: force company when getting computed account for move line
The parent method _get_computed_account in the account module it already forces
the company to get the correct account, but in the stock_account module the method
is overriden when dealing with anglo-saxon accounting. In the latter, the company
is not being forced, so it leads to multi-company errors.

The fix simply enforces the correct company to prevent the error.

closes odoo/odoo#75747

X-original-commit: beba7c5b377e5aaf5ccb1d52e6b8c3bcf49468d3
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-08-31 02:33:40 +00:00
Nasreddin Boulif (bon) 7a5146cc67 [FIX] account: parse sequence with date before year 2000
Steps to repodruce:

  - Install 'Accounting' module
  - Set user language to French
  - Create journal entry
  - Set a date before 2000. Example : 01/01/1999
  - Insert some journal items
  - Save the journal entry

Issue:

  Error message is raised :
  ```The journal entry cannot be saved : "The Date (01/01/1999) doesn't match the Numéro (OPD/1999/01/0001).```

Cause:

  Incomplete regex: parsing only years who begin with 20 or 21.
  https://github.com/odoo/odoo/commit/26a43f23ec2b2490aec0731e25568703729581f0#diff-67b6f8b23970c1b18fc5e7f82b7585ad82e7bace885cdd78274837a4876a6a9fL24-R25

Solution:

  Add 19 to regex to allow years like '19XX'.

opw-2616575

closes odoo/odoo#75755

X-original-commit: da9a2fab230c07cd0ce069bc7832ffcce4b8e988
Signed-off-by: William André (wan) <wan@odoo.com>
2021-08-31 00:12:10 +00:00
William Braeckman 96bd3e4dc9 [FIX] hr_timesheet: fix traceback in portal view
Opening the task portal view while having the timesheet encoding in days
and having no timesheets linked to the viewed task would cause a
traceback.

This was caused by an index out of range exception.
The function called has been changed to a `api.model` function instead
and all calls have been changed to be compliant with that change.

Closes: odoo/odoo#75452

Task ID: 2630244

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-30 21:05:23 +00:00
Tiffany Chang (tic) 2cb659aa7c [FIX] mrp: allow adding components to done mo when uom active
Steps to reproduce:
1. Activiate "Units of Measure" setting
2. Create and "mark as done" a MO
3. Unlock MO (may need to activate MRP setting for locking/unlocking qty
   to consume to see button to unlock first)
4. Add a new component to MO and save.

Expected result: New component added
Actual result: Validation Error related to UoM

This is due to all components' UoM being readonly once the MO is Done so
when the new component move is created, it is missing a UoM value.

We fix this by making any newly added component lines' UoM not readonly
regardless of MO status. When a user saves a MO after adding a new
component, they will not be able to edit the UoM again due to
quant/stock move inconsistencies this can cause.

closes odoo/odoo#75436

Opw: 2514262
X-original-commit: ab0fcdbceef3e2df7b89766b074c386465c60ad7
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-08-30 21:05:19 +00:00
Odoo's Mergebot 3dea610ac1 [IMP] auth_top, *: revamp two-factor authentication flow and add mail invite
Purpose
=======

Review the UX of the 2-factor authentication flow in order to make it more clear
and easy to use.

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

This commit applies multiple rewording of instructions, button, etc. Tests have
been adapted accordingly.

It also adds an 'invite to use two-factor authentication' flow that will
send an email to the selected used to redirect them their account security
settings.
- If portal is not installed yet, the user is redirected to his account security
settings in backend.
- If portal is installed, the user is redirected to /my/profile if them are
portal user. Otherwise, the redirection is still done at backend side.

As the backend view of auth_totp wizard is used at frontend side, copyclipboard
widget has to be rebuilt at frontend side (click event, style etc..).

As API key section is now displayed only on debug mode, test urls have been
adapted accordingly.

Task ID: 2487630

closes odoo/odoo#71142

Related: odoo/upgrade#2540
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-30 23:05:14 +02:00
David Beguin 09f6ae5b95 [MOV] auth_top: reorganise module to set content in proper place
This commit juste moves the different part of code (class, views, data) in the
correct file where they belong.

Task-2487630

Part-of: odoo/odoo#71142
2021-08-30 21:05:12 +00:00
David Beguin a3e1310222 [IMP] web: display toaster instead of dialog when change_password goes wrong
This commit is part of the 2 factor authentication revamp.
The purpose is to avoid to display error modals when it's possible to only
display a notification toaser.

Task-2487630

Part-of: odoo/odoo#71142
2021-08-30 21:05:12 +00:00
David Beguin 29db699e9b [IMP] auth_top, *: revamp Two-factor authentication flow
Purpose
=======

Review the UX of the 2-factor authentication flow in order to make it more clear
and easy to use.

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

This commit applies multiple rewording of instructions, button, etc. Tests have
been adapted accordingly.

It also adds an 'invite to use two-factor authentication' flow that will
send an email to the selected used to redirect them their account security
settings.
- If portal is not installed yet, the user is redirected to his account security
settings in backend.
- If portal is installed, the user is redirected to /my/profile if them are
portal user. Otherwise, the redirection is still done at backend side.

As the backend view of auth_totp wizard is used at frontend side, copyclipboard
widget has to be rebuilt at frontend side (click event, style etc..).

As API key section is now displayed only on debug mode, test urls have been
adapted accordingly.

Task-2487630

Part-of: odoo/odoo#71142
2021-08-30 21:05:12 +00:00
Laurent Stukkens (LTU) 2b9584101f [IMP] project: improve milestones design
closes odoo/odoo#75734

Related: odoo/enterprise#18045
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-30 21:05:04 +00:00
Bruno-brsy 2456dd930c [IMP] mrp: imp duration on MO view
Expected duration and real duration should be hide when the user doesn't use the Work Order aren't active

closes odoo/odoo#75677

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-08-30 19:17:39 +00:00
Bruno-brsy 5a22b3780c [IMP] repair/mrp UI improvement
Add some information to know wich repair order have the highest priority

Task id: 2593256

closes odoo/odoo#75657

Pr: https://github.com/odoo/odoo/pull/75657
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-08-30 17:53:11 +00:00
Yannick Tivisse 5193594a64 [FIX] hr_contract: Fix multi-company issue on api.constrains
Purpose
=======

Avoid mismatch between contracts from different companies and clarify
error message.

closes odoo/odoo#75553

Related: odoo/enterprise#19647
Related: odoo/upgrade#2777
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-30 16:47:49 +00:00
Thibault Libioulle 0caef93408 [IMP] hr_contract: add demo data
This commit adds demo data in hr_contract.

PR community : #75553

task-2559061
2021-08-30 16:47:49 +00:00
Thibault Libioulle 4f7d450cef [IMP] sale_project: move project stat button on SO
Prior to this commit, the project and task stat buttons were placed
before the invoice one.

After this commit, the project stat button will be placed before the
tasks stat button which will be before the sale order preview.

PR community : #75553
PR upgrade : odoo/upgrade#2777

task-2559061
2021-08-30 16:47:48 +00:00
Hubert Van de Walle (huvw) 8285412dbc [FIX] web_editor: prevent traceback when InputEvent.data = null
Step to follow

1. open any record with a chatter enabled )
2. start to write a log note in the the full composer
3. write a line with at least one character, then shift+enter
-> There is a traceback

Cause of the issue

InputEvent.data can be null

opw-2622051

closes odoo/odoo#75726

X-original-commit: 503bbe7a4d0cdd0aefcb723460210b089732831a
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-30 13:28:09 +00:00
Xavier-Do de077243ef [IMP] profiling: enable nested Execution context
The initial behaviour of ExecutionContext was to
- add the context for the current level of the stack on enter
- remove the context at this same level on exit.

When two ExecutionContext are nested at the same stack level:
- the first one adds it's context;
- the second one overrides the current context;
- the second one removes it at the end;
- the first one fails to remove the context at the same level a second time.

    def call():
        with ExecutionContext(foo=1):
            with ExecutionContext(bar=2):
                execute()

In this case we could imagine to combine both Execution managers in one:

    def call():
        with ExecutionContext(foo=1, bar=2)
            execute()

But the semantics is different: ExecutionContext should add one level to
the stack, instead of two.  In the first example above, we expect two
additionnal levels:

    call
    foo=1
    bar=2
    execute

A simple solution would be to transform the value of the context at some
level to a list of dict, but this would make the copy more difficult.
The decision was taken to change the context storage strategy, going
from a dict where the keys are the level to a tuple of tuples where the
first element is the level.

    {3: {foo: 1}, 4: {bar: 2}} =>  ((3, {foo: 1}), (4, {bar: 2}))

The first benefit is to allow multiple contexts at the same level.  The
second one is that we don't need to copy the data structure, since
tuples are immutables and the dicts are coming from kwargs.  This means
that saving the context is faster, and the tuple is shared between
multiple samples.  This is interesting if we assume that we do more
samples than exec_context mutations.

closes odoo/odoo#75687

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-08-30 13:28:05 +00:00
Francois (fge) aa797792ca [IMP] web: menu providers command in command palette
Adds the possibility to search an app/menu from the command palette .
It allows for fuzzy-searching apps and their submenus as shortcuts to directly
enter the right app and submenu and execute the corresponding action.

The comamnd is initiated by typing "/" in the command palette.

closes odoo/odoo#75396

Task-id: 2622952
Related: odoo/enterprise#20447
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-30 13:27:58 +00:00
Lucas Perais (lpe) 7ddcebfcda [FIX] point_of_sale: prevent menu_service from loading
Before this commit, the menu_service was not included into the pos.assets_backend bundle
which was fine until menu_service defined a helper function that other service would need.
Since pos.assets_backend imports virtually all web.assets_backend, there was dependencies errors.
Hence the need to import the menu_service as well, but making sure it doesn't make the rpc to load the menus.

After this commit, there are no dependency issues, and the menus are not loaded, as expected and as before.

Part-of: odoo/odoo#75396
2021-08-30 13:27:57 +00:00
William Braeckman 5b05352c99 [IMP] mail: add optional mail subtypes
This commit adds a way to filter out mail message subtypes for specific
records.

Task ID: 2585025

closes odoo/odoo#74764

Related: odoo/upgrade#2719
Related: odoo/enterprise#20096
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-30 13:27:50 +00:00