Commit Graph
151653 Commits
Author SHA1 Message Date
Yolann Sabaux 24e89a3fbe [FIX] account: prevent deletion partner
Steps to reproduce:
- Create a partner-individual, assign to a company
- Create an invoice and set the new partner as the customer
- Go to the partner view
- Delete it

Issue:
- It is possible to delete it

Cause:
The constraint in "account.move.line" uses the "commercial_partner_id" as the partner

Solution:
- Prevent the unlink if the partner is used in 'account.move' -> To delete in Master
- add "ondelete='restrict' for partner and commercial_parner in 'account.move'

opw-2858789

closes odoo/odoo#94591

X-original-commit: 7d37f5ef7ecd87aea666d96dc8200a74c8dc0b31
Signed-off-by: William André (wan) <wan@odoo.com>
2022-06-24 19:34:28 +02:00
Brice bib Bartoletti c340c0ea9d [FIX] account: report_payment_receipt_document.xml
This commit fix the template "report_payment_receipt_document".

The template call the python method "_get_reconciled_invoices_partials" but
which signature was broken by https://github.com/odoo/odoo/commit/785d49f3f0a21720d8c929d597d4041918ab7f41

closes odoo/odoo#94579

Task-id: None
X-original-commit: 3ed9a07a3674d5ce5d4378acf589231a2867acc3
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Brice Bartoletti <bib@odoo.com>
2022-06-24 19:34:25 +02:00
Kevin Baptiste 40c7a4d705 [REV] hr_recruitment_skills: remove Populate feature
Partial revert of #93126.

closes odoo/odoo#94554

Taskid: 2894671
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-24 19:34:13 +02:00
tsm-odoo 2dc1d9d4a7 [IMP] mail: replace createMessageComponent during tests
The createMessageComponent  helper was used during tests to mount
a message component  and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's mount a webClient so that the message component
can be mounted in its real environment.

closes odoo/odoo#94243

Related: odoo/enterprise#28720
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-24 19:34:03 +02:00
Thibault Delavallée 662a5c5d01 [IMP] crm: allow to populate crm
Purpose of this commit is to add a first populate implementation in CRM to
create leads. Indeed as CRM application may have to handle lots of leads we
should ease data creation to test performance in several use cases.

Task-2679887

closes odoo/odoo#79150

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 19:33:53 +02:00
Adrien Widart e610b35f9d [FIX] purchase_mrp: set anglo_saxon flag in the test
If the module `l10n_de` is installed, the test
`test_kit_anglo_saxo_price_diff` will failed. This is because the flag
`use_anglo_saxon` is not enabled by default in the chart template of
German companies. Therefore, when posting the invoice, we skip the
anglo-saxon lines generation:
https://github.com/odoo/odoo/blob/f3ae759f2d54829f91badd32cacf70e8a8211288/addons/purchase_stock/models/account_invoice.py#L40-L42
This explains why the test fails.

OPW-2843861

closes odoo/odoo#94548

X-original-commit: 5af6d0374f8e8e8dceb9b26f79e6b962ff96b60c
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-06-24 18:33:08 +02:00
diagnoza cb07db6e41 [FIX] mail: allow tracking values not loaded into registry
Use dict.get() instead of a subscriptable call. This way we let through
selection values that are not loaded into the registry, instead
of raising an error.

This is especially useful in the upgrade environment
where such values may be unavailable (because of being
lambda-defined in a custom module for instance).

closes odoo/odoo#94530

X-original-commit: 36a6943740f9b4fbd9a78986bee4cd84bb8469c7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 18:33:05 +02:00
Dossogne Bertrand ad5b2a277b [IMP] hr_recruitment: improve reports clarity
This commit aims to improve the recruitment reports clarity,
particularly the confusion between source and medium

TaskID : 2837445

closes odoo/odoo#90975

Related: odoo/enterprise#27148
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-24 17:09:50 +02:00
grzana12 90f4daba95 [FW][CLA] sign CLA grzana12
closes odoo/odoo#94532

X-original-commit: cbb450165053a4a8ffcd7fa0585a7fdf51caa843
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 15:00:55 +02:00
grzana12 bbf936f40d [FW][FIX] mass_mailing: check fields for seen list are stored before going into SQL
Seen list (aka already mailed records) computation is done in SQL to speedup
computation. It is based on an heuristic to find fields to check (either
a partner, either an email). However it checks fields are present in model
but does not check they are stored. This leads to traceback if fields
are not stored.

Task-2852943

X-original-commit: fa11070d4533475778ea933225e30d06a09406bc
Part-of: odoo/odoo#94532
2022-06-24 15:00:54 +02:00
Thibault Delavallée 18a04afa8c [FW][IMP] test_mass_mailing: check partner_id usage in seen list
Add a model and a test allowing to test the seen list using raw SQL based
on partner_id field. Test indicates a not stored partner_id field currently
crashes beyond redemption.

Task-2852943

X-original-commit: a15bda3bed339a0ac422a3c82ec9cc295a11a785
Part-of: odoo/odoo#94532
2022-06-24 15:00:54 +02:00
Renaud Thiry e42446600e [FIX] mail: Update legacy arguments for services.action.doAction
Emails could not be resent from the chatter after failing to be sent.
This was due to parts of code not being updated after a refactoring of OWL.

Multiple other instances of non-updated code are updated here.

Task-2887153

closes odoo/odoo#94529

X-original-commit: 8fbdb1b52b9051e92e4980d5af73460a46fe70da
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-24 15:00:48 +02:00
Iryna Vyshnevska 93c6636897 [FIX] stock_picking_batch: compute properly scheduled time on batch
closes odoo/odoo#94082

X-original-commit: c008e8e88052553c7e4efea6cb9eb3896892c8d8
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-06-24 15:00:44 +02:00
Géry Debongnie 2b2fe35ff3 [IMP] web: update owl from 2.0.0-beta-8 to 2.0.0-beta-10
Release notes:
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-9
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-10

Details:

closes odoo/odoo#94523

Fix: event: no crash when using t-on + modifier on slots/components
Fix: component: fix props comparison code
Fix: component: fix wrong behaviour when using t-on on t-component
Fix: component: props values are own property of props object
Fix: t-out: allow expressions evaluating as number
Fix: compiler: add support for #{...} in string interpolation
Fix: compiler: escape backticks in attributes
Fix: crash when dynamic class have leading space
Imp: slots: add support for t-props on slots props
Imp: tooling: add another d.ts file
Imp: app: small scale perf improvement
Imp: app: add fast path for when component has no prop
Imp: validation: add support for value types
Imp: add support for t-call-context
Ref: compiler: remove useless ; in compiled output
Ref: move some code around
X-original-commit: 3c7e2cb5a2224ff624e0899ca392be8b3828b43a
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-06-24 13:49:16 +02:00
Vincent Larcin d13d520f32 [IMP] sale_timesheet: only create one project per SO in demo data
Since 12bc2ab, there are two projects created for each SO
instead of one in the demo data.

This is because in the sale lines, one product creates a project
with a template, but others create a project without a template,
which creates two projects.

This commit adds a project template to the products without one to
create a single project per SO.

closes odoo/odoo#94514

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-24 13:49:13 +02:00
Mitul Shah f0b7600314 [IMP] base, crm: set salesperson and team on partner from parent
This commit does below improvements:

1/ If salesperson and sales team are set on an individual partner, we propagate
   those to parent company being created from m2o of the form view.
2/ If the existing parent company is manually linked to an individual partner
   being created, and salesperson and sales team are not set on the individual,
   we set those values from the linked parent (if set on the parent).

Task-2636290

closes odoo/odoo#78696

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 13:49:07 +02:00
dht-odoo 020046a343 [IMP] survey: improve overall usability of survey
This commit imporves the usability of scoring fields and single-multi
choice question in survey. It does the following changes:

Backend:
- if it's a scored question, respective correct answer must be provided
  otherwise it will now give a warning while trying to save
- points are hidden unless it's a scored question (and will be inline now,
  next to 'Scored' checkbox)
- compute answer_is_correct based on question type of numerical, date,
  datetime for both scored and non-scored questions.

Frontend:
- if the answer is wrong, display the answer inside a red container and below
  the wrong answer, also display the correct one in green font
- if the answer is right, display the answer in a green container
- if the answer is skipped, display the text 'Skipped' inside red container
  with lower opacity
- hide the div for question description if it's empty, to avoid unwanted
  space bewteen questions
- added two different icons 'fa-check-circle' and 'fa-times-circle' for correct
  and incorrect answers respectively for single-multi choice question
- show answer is correct and incorrect based on is_correct not on scored values
- show skipped string  for  single choice, multi choice and matrix questions in
  result page if question was skipped

closes odoo/odoo#63915

Taskid: 2276724
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 13:49:04 +02:00
Touati Djamel (otd) e9d80990e0 [FIX] mrp: add read access on BOM to the purchase users
Steps to reproduce the bug:
- Install mrp and purchase
- Create a new user “U1” > give him only the “purchase” user access
- Log in as “U1”
- Go to purchase app > create a new PO
- Try to select any product

Problem:
A user error is triggered because we check if the product has a BOM
but since the user does not have access to MRP, an error is raised

opw-2885982

closes odoo/odoo#94489

X-original-commit: de359c0470fba1d5e9dfee416abe46661e35cce6
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-06-24 12:39:38 +02:00
tsm-odoo 850367e954 [IMP] mail, website_slides: replace createChatterContainer during tests
The createChatterContainer helper was used during tests to mount
a chatter container and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's mount a webClient and open a form view
containing a chatter.

closes odoo/odoo#94175

Related: odoo/enterprise#28684
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-24 12:39:35 +02:00
31cc10b91d [MERGE] website, *: move the frontend UI to the backend
*: auth_signup, knowledge, mass_mailing, portal, survey, test_website,
   test_website_modules, test_website_slides_full, web, web_editor,
   web_tour, web_unsplash, website_blog, website_crm,
   website_crm_partner_assign, website_customer, website_event,
   website_event_exhibitor, website_event_meet, website_event_track,
   website_forum, website_hr_recruitment, website_knowledge,
   website_links, website_livechat, website_mail_group,
   website_mass_mailing, website_membership, website_sale,
   website_sale_autocomplete, website_sale_comparison,
   website_sale_loyalty, website_sale_slides, website_sale_wishlist,
   website_slides, website_slides_forum, website_twitter, base

A new client action is introduced, to display the website in an iframe.
This allows to remove the "frontend" Odoo UI entirely. Everything
related to the website configuration (and especially the edit mode) will
now be done on the backend side.

The idea behind this mainly comes from the fact that we needed the
website in an iframe during edition to be able to render a mobile
preview properly. It was also required so that options which reloads
the page... are able to only reload the page and not the entire editor
with it. From there, it was decided that actually, since the website is
in an iframe, it could be in the backend and every website UI could
rely on this.

In the end, this comes with many functional and technical advantages.
Here are some of them (a few of them are not entirely done with this
merge but will follow the merge in the upcoming weeks, see this as a
non-exhaustive list of possibilities that are unlocked by this work):

Technical:

- No duplicated logic for website UI and backend (purple navbar is the
  backend one, slightly customized).
- No conflicting logic for website UI and website content (like dialog
  opening, ...).
- No forced CSS for our website / web_editor UI, no conflict with
  website themes.
- Everything converted in OWL, in backend code (no special OWL for
  frontend).
- "Legacy" code moved as frontend code or removed.
- No website content CSS for the case "when there is the Odoo purple
  navbar at the top".
- Backend views & features available (e.g. creating a new event -> form
  view instead of custom code with onchanges, validations, etc)

Functional:

- All website features available while editing your website (product
  configuration, settings, etc), no switch backend/frontend, no
  redirection, no reload (just the iframe).
- All other app features available while editing your website (discuss,
  calendar, all other apps, ...).
- Typing a website URL in your browser reaches your website (very small
  Odoo UI overlay at the top left as a connected user).
- Mobile preview: directly resizing the website rendering, in edit mode
  too and with a better phone image.
- Editor: mobile view edition (the editor is instanciated around the
  website content instead of inside of it (iframe))
- Can reload the website without reloading all the tools (editor, html
  editor, menu edition, etc) (customize_show options for instance ->
  moved as standard editor options which reloads the website only)
- Website UI in your language instead of website language

On the backend side, some customizations were done so that the UI feels
like it works as before (note that it will be reworked in upcoming weeks):

- A `website_systray` registry is defined to replace the systray items
  with the website's one when previewing the website.
- The webclient's navbar is patched to display additional dropdown menus
  related to the website edition.
- A website service that holds the global state of the website is
  introduced. Components from the systray and the dropdown menus can
  access and modify it.
- A component adapter for the wysiwyg (that will display the snippets
  menu) is added, that allows for caching the wysiwyg libraries, thus
  improving editions responsiveness.

See sub-commits for details. This work is known to not be bug-free and
will be bug-fixed, improved and reworked in the upcoming weeks.

task-2687506

Thanks to the whole team for reviewing and testing !
(ARD, BVR, BSO, GDI, MOU, PDE, QSM, RDE, SOBO, YOL)

closes odoo/odoo#89223

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Younn Olivier <yol@odoo.com>
Co-authored-by: Arthur Detroux <ard@odoo.com>
Co-authored-by: Mehdi Outagant <mou@odoo.com>
Co-authored-by: Benjamin Vray <bvr@odoo.com>
2022-06-24 12:39:14 +02:00
Antoine Vandevenne (anv) fd1e27c43d [FIX] base: fix link to non-existing documentation page
The documentation page for the external API was moved elsewhere with PR
odoo/documentation#2026.

closes odoo/odoo#94488

X-original-commit: 99eb55e14782bd32c4b2281681a62eb5f3d34407
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-24 11:32:51 +02:00
Adrien Widart 2244e9b127 [FIX] stock, mrp: display the forecast symbol for inter-wh SM
To reproduce the issue:
(Let WH01 be the existing warehouse)
1. In Settings, enable "Storage Locations"
2. Create a second warehouse WH02
3. Create a storable product P
4. Create a planned and internal transfer:
    - From: WH01/Stock
    - To: WH02/Stock
    - With: 1 x P
5. Save the transfer
    - Error01: the forecast symbol is green, it should be red
6. Confirm the transfer
    - Error02: idem

Error 01: Because the picking type is internal, we don't consider the
picking as a consuming one. Therefore, we don't reach the line that
define the forecast availability as negative:
https://github.com/odoo/odoo/blob/892232b5aef42dd2706cb9d1d027b1c463ca50dd/addons/stock/models/stock_move.py#L446-L448

Error 02: Fixing the first error is not enough. Thanks to the first
correction, we reach this line:
https://github.com/odoo/odoo/blob/892232b5aef42dd2706cb9d1d027b1c463ca50dd/addons/stock/models/stock_move.py#L449-L450
And we will then call another method to compute the forecast
availability:
https://github.com/odoo/odoo/blob/892232b5aef42dd2706cb9d1d027b1c463ca50dd/addons/stock/models/stock_move.py#L457-L463
However, `_get_forecast_availability_outgoing` won't define any forecast
availability for the move (it won't find any quantity to fulfill the
need). So, when getting the value (`forecast_info[move]`), we will a
have the default values:
https://github.com/odoo/odoo/blob/892232b5aef42dd2706cb9d1d027b1c463ca50dd/addons/stock/models/stock_move.py#L2035
where `result` is the dict returned by
`_get_forecast_availability_outgoing`. Later on, when using the field
`forecast_availability` to render the view: in case of an outgoing
transfer, we use the forecast widget:
https://github.com/odoo/odoo/blob/73ab94402878a16c34c0e131818ffc0d2e8da3da/addons/stock/views/stock_picking_views.xml#L393-L394
And it correctly works because we compare the forecast availability with
the demand:
https://github.com/odoo/odoo/blob/6eaa4a2ae3b12b244f4c4277ef9cbc172f492f0a/addons/stock/static/src/js/forecast_widget.js#L34

However, in case of an internal transfer, we don't use the forecast
widget:
https://github.com/odoo/odoo/blob/3a2ee95c3ddfa0b2cf9383772ba48ebf6d9d5bb2/addons/stock/views/stock_picking_views.xml#L388-L391
And, if `forecast_availability` is equal to zero, it should mean that
there will be just enough stock to fulfill the need [1]. This explains
why the symbol is green.

So, the issue comes from the values returned by
`_get_forecast_availability_outgoing`: it should not set the forecast
availability to zero if there isn't any stock available.

[1] Some tests need to be fixed to respect this definition of
`forecast_availability`

task-2822157

closes odoo/odoo#94332

X-original-commit: 7610664cfbcfa89b0a9608663952544f8c9f195d
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-06-24 11:32:48 +02:00
Adrien Widart 9c8ddea062 [FIX] stock: display the forecast symbol on outgoing SM
To reproduce the issue:
1. Create a storable product P
2. Update the on-hand quantity: 5 x P
3. Create a planned delivery order with 4 x P
    - Note: once saved, the forecast symbole is green
4. On the delivery order, set the quantity to 5 and save

Error: The symbol is now red, which is incorrect: there are 5 available
P in the stock

The color condition is incorrect, when `forecast_availability` is equal
to zero, it means that there will be just the right quantity:
https://github.com/odoo/odoo/blob/892232b5aef42dd2706cb9d1d027b1c463ca50dd/addons/stock/models/stock_move.py#L446-L448

task-2822157

X-original-commit: b49577d1aa0dda3b3890c7150db0242254cf46c5
Part-of: odoo/odoo#94332
2022-06-24 11:32:48 +02:00
Sylvain Francis 7b179f411a [FIX] mass_mailing: Allow reply_to mode 'email' for mailing contacts
Before this commit:
When creating a mail template for a marketing campaign targeting mailing
contact, the reply_to_mode would be set to 'thread', and the reply_to
field would be be read-only. Since there is no way to target a mailing
list from a marketing campaign (see the domain on marketing.campaign's
model_id), and there is no default followers mailing.contact, email
responses would be "lost".

After this commit:
The reply_to_mode is set to 'email', and the reply_to is set
accordingly

OPW-2803314

closes odoo/odoo#94507

X-original-commit: f47da5d3183479597b572046566f67621f6db837
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Francis Sylvain (syf) <syf@odoo.com>
2022-06-24 10:30:15 +02:00
Jeremy Kersten f9eb23f896 [FIX] website, web_unsplash: allow Restricted editor to use Unsplash
Before this commit, when a restricted editor search for an image, he
will have an error 404 not found, when he try to access to the unsplash
key. Now he can search for image on Unsplash.

closes odoo/odoo#94506

X-original-commit: bbdd91e778a46c68461574dbea146e178f8c3c3f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2022-06-24 10:30:12 +02:00
Laurent Desausoi (lade) 70c22cac0d [FIX] crm: set partner company on lead when resetting company
In a multi-company environment, when we transform a lead (which has no
salesperson) into an opportunity, we get an error if the customer has
a company set.

To reproduce the issue
  1) Create a new company
  2) Create a Lead for a customer with the Company set
  3) Remove the Sales Team
  4) Set the company on the Lead
  5) Convert to an opportunity and you will see an error showing up

Solution

A previous commit (1fad826743de9c8f916ef083e8de453212df6959) adapted the `_compute_company_id`
computation in which a case was forgotten (the case described here-above).
The fix was to force the `company_id` to the one of the `partner_id` if it
has one.

OPW-2805181
Task-2888330

closes odoo/odoo#88108

closes odoo/odoo#94493

X-original-commit: fc3bb66a863cd3ff8c92d70dd43146a5610a4a43
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 10:30:06 +02:00
Laurent Desausoi 6762590b9d [IMP] crm: add tests for MC computation on lead with partner company
Currently using a customer with a company set on a lead without company
crashes, as it keep a void company on the lead. This is not compatible
with the company set on the partner itself.

OPW-2805181
Task-2888330

X-original-commit: 51be6cab5c4437ef56de5d1b25c0ba8486d25291
Part-of: odoo/odoo#94493
2022-06-24 10:30:05 +02:00
Nikunj Ladava 261fd732f8 [IMP] mail: add a node option for custom onchange debounce delay
This commit introduces a node option 'keydown_debounce_delay' on the
character field and on emoji mixin, so that use can define the custom
debounce delay (in milliseconds) instead of fixed 2000 ms for
triggering an onchange on the field. Note that this delay will be
applied only when 'onchange_on_keydown' node option is also provided.

Also, we've utilized the odoo's debounce instead of the one provided by
underscore js, for 2 reasons:

1 - odoo's debounce is already well tested (see the file
    /web/static/tests/core/utils/timing_tests.js)
2 - to take a step forward for reducing external lib dependency

task-2821978

closes odoo/odoo#94486

X-original-commit: ab80cdc0809e1347d201f21ac9474e66e9270f94
Related: odoo/enterprise#28822
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 10:30:00 +02:00
std-odoo dd87eb77f3 [FIX] google_gmail, fetchmail_gmail: use Odoo endpoint for authentication
Purpose
=======
The flow where we copy / paste the authorization code will be
depreciated. Because of that, we know use the newest authentication
system which use redirect URI.

Technical
=========
Now, the user is redirected to an Odoo endpoint "google_gmail/confirm"
and the access token / refresh token are automatically fetched.

Documentation
https://developers.google.com/identity/protocols/oauth2/native-app

Task-2852560

closes odoo/odoo#94476

X-original-commit: 69bd9bc6b36fdd55e8e859667bcddddad6db7d06
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 10:29:54 +02:00
Odoo's Mergebot f828c89648 [FW][MERGE][FIX] event_booth_sale: Allow confirm sale order with event booth
Steps to Reproduce:

  - Connect as Admin
  - Install event_booth_sale module
  - Give only sales right to Demo user
    (get rid of everything else (especially event)
  - Connect as Demo
  - Create a new SO
  - Add an event_booth as product to the SO
  - Try to confirm the SO

Issue:

  Access error.

Cause:

  When confirming the SO, we also update the selected event_booth
  while the sales right are not enough to update event_booth model.

Solution:

  Use sudo to update event_booth, since SO already confirmed.

Also fix unlink of booth, for the same reason.

opw-2823555
Task-2842621

closes odoo/odoo#94475

Forward-port-of: odoo/odoo#93983
Forward-port-of: odoo/odoo#88914
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 10:29:51 +02:00
Thibault Delavallée 19a8c8fac6 [FIX] event_booth_sale: fix ACLs issues at unlink
When unlinking booths a check is done on sale orders to prevent their deletion when
a SO is linked and raise a nice error message. However as there is a group on the
field (coming from Sales app) we should sudo the filtered.

Task-2842621

X-original-commit: 9cdc2eec25dd57a74be993b0db0fd81460d6aed6
Part-of: odoo/odoo#94475
2022-06-24 10:29:50 +02:00
Thibault Delavallée dd1a842c32 [IMP] event_booth(_sale): improve tests execution
Notably using post-install allows to run event_booth tests even when sale
dependencies are installed. Otherwise they cannot run at install due to
required column not being filled in DB.

X-original-commit: aa769df87c0ef0e7ac6924c3e8f5595e8c82eba7
Part-of: odoo/odoo#94475
2022-06-24 10:29:50 +02:00
Nasreddin Boulif (bon) dff3304175 [FIX] event_booth_sale: Allow confirm sale order with event booth
Steps to Reproduce:

  - Connect as Admin
  - Install event_booth_sale module
  - Give only sales right to Demo user and remove event rights
  - Connect as Demo
  - Create a new SO
  - Add an event booth as product to the SO
  - Try to confirm the SO

Issue:

  Access error.

Cause:

  When comfirming the SO, we also update the selected event_booth
  while sales rights are not enough to update event_booth model.

Solution:

  Use sudo to update event_booth.

opw-2823555
Task-2842621

X-original-commit: 3f78c6aab091388afaf1e75fc8e9e66db5b8ab4a
Part-of: odoo/odoo#94475
2022-06-24 10:29:49 +02:00
svs-odoo d62d7e65fe [FIX] purchase_stock: removes filtered
In the `_stock_account_prepare_anglo_saxon_in_lines_vals` method, we
loop the moves' invoice lines but we called `filtered` on it to remove
ineligible lines.
That said, we have a conditional `continue` at the beginning of the loop
precisely for the same reason, which is redundant.

As it's better to filter out inside a loop instead of call `filtered`
(one loop instead of two), this commit removes the call to `filtered`.

closes odoo/odoo#94456

X-original-commit: a0a90fb20410d663d4615e7a055fce18c868116b
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Steve Van Essche <svs@odoo.com>
2022-06-24 10:29:41 +02:00
Younn Olivier b19a1eaaf4 [IMP] website, website_event: add edit event menu dropdown
This commit adds a new menu item in the "Site" menu section.

This "Edit Event Menu" item is only shown when a [data-content_menu_id]
element is displayed within the iframe (such data attribute is added on
the event menus).

The contentMenuId is taken from the currentWebsite.metadata to keep data
taken from the iframe's document centralized in the service.

The spec is different from the previous implementation, that was
prompting a dialog to select the menu to edit, before prompting the
dialog to edit the menu. Here we have two different dropwdown items.

See merge commit for more information.

task-2687506
2022-06-24 10:28:08 +02:00
Arthur Detroux (ard) 44da4bfcc3 [IMP] website: hide edit button when a page is not editable
This commit hides the Edit button when visiting a page that is not
editable (e.g. sitemap.xml, a link to an image, etc).

See merge commit for more information.

task-2687506
2022-06-24 10:28:08 +02:00
Arthur Detroux 9c53c373bf [FIX] website: load wysiwyg in iframe only for publishers
See merge commit for more information.

task-2687506
2022-06-24 10:28:08 +02:00
Arthur Detroux (ard) e771339834 [IMP] web_editor, website: give util functions the right window
Related to the review comment [1]. This commit aims at removing
the dependency of a target for those utils functions.

[1]: https://github.com/odoo/odoo/pull/89223#discussion_r893595305

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Arthur Detroux (ard) 2e47516515 [IMP] website, *: reload webclient when installing app from editor
*: web_editor

When installing an app from the web_editor, it's needed to actually
reload the webclient, or some apps might not work properly as they
won't have the right assets loaded.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Arthur Detroux (ard) 69af7dcfeb [IMP] website, web_editor: improve startup time of website editor
By starting the get_switchable_related_views request when the
WysiwygAdapter is started, and awaiting it only when we need to know,
we can improve the initial loading time of the editor.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Arthur Detroux (ard) ac4c61bd87 [FIX] web_editor, website: prevent race condition when closing s_popup
When clicking on save while having a popup open, in some conditions,
a traceback can appear due to a race condtion.

This is caused by an event listener which updates the visibility status
of said popup in the editor panel. When saving the popup is closed,
and the cleanForSave starts, but while the popup is closing an event
is triggered which recreates editors (_onSnippetOptionVisibilityUpdate).

This commit aims at mitigating the appearance of this race condition
by listening to the .hide event instead of the .hidden, which means
the event is fired right away instead of 400ms later.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Younn Olivier 06516329a0 [IMP] website, web_editor: add autofocus on form inputs
This commit adds the autofocus on inputs on form inputs.
It also adds inputs validation on the Edit Menu dialog, and
autocomplete.

The validation is done with a useControlled input hook, taking an
initial value and a validation function (isEmpty, ...). It returns a
state holding two value: the actual value of the input and the boolean
hasError (used to display or not an is-error css class), as well as the
validation function, wrapped to update the hasError state value.

The existing jquery autocomplete widget is reused, with the a mapping
object (a fake widget that will use the Component's rpc service instead
of the legacy Widget's one).

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Younn Olivier 95c8f1a6a8 [FIX] website: fix restricted_editor test
See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Younn Olivier 2781214d7e [FIX] website: remove welcome message before starting the wysiwyg
Before this commit, the welcome message was removed at the level of the
client action, independently from the wysiwyg initialisation.

As the welcome message is directly inserted into the iframe's
contentDocument, it could lead to a race condition with the editor's
observer: if the wysiwyg was already started when the client
action was removing the message, that mutation was recorded in the
history (therefore, when switching to edit mode and clicking on discard
would show the "Are you sure to discard ?" toaster).

Now, the welcome message is removed before starting the wysiwyg using a
removeWelcomeMessage callback.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Arthur Detroux (ard) 8eb0ca5420 [FIX] web_editor: clear tooltips before quitting editor
See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Younn Olivier 85b1ec969e [FIX] web, web_editor, website: fix qunit tests
This commit mocks the website service for all the QUnit tests.
As the website module now defines a patch on the WebClient and NavBar
components, adding the website service, this service needs to be mocked
for all the tests. This is done by patching the QUnit.testStart hook.

Also, after the addition of the new media dialog, this component is
mocked at the field html unit test.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Younn Olivier 63c325b17f [FIX] website_sale: fix products header edition
This commit adapts [1] to the new wysiwyg adapter component.

[1]: https://github.com/odoo/odoo/commit/ce067c3b56ca8551f2904f7e91313ebde344a57b

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Arthur Detroux (ard) dafdfba6ef [IMP] website, web_editor: re-introduce cancel dialog
The cancel dialog is now using the new Dialog API and disables buttons
when the process is ongoing.

This is needed because prior to this commit, the iframe would reload,
but it would still be possible to click on the buttons.
So one could cancel then click on save and a traceback would show up.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Arthur Detroux (ard) d3a9a1bf02 [IMP] website: remove the websiteRootInstance when changing page
See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Younn Olivier 0048b209ab [IMP] web_editor, knowledge: adapt to new media dialog
This commit adapts the Knowledge "/file" wysiwyg command to work with
the new media dialog, introduced earlier in this merge.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00