Commit Graph
152817 Commits
Author SHA1 Message Date
Sébastien Theys 9de429e747 [IMP] mail, project: move chatter container setup code in init
Setup was conditionally done in render lifecycle methods, but it could be moved
to init instead, allowing to simplify the code and remove unnecessary methods
and overrides.

Part of task-2871070

closes odoo/odoo#94307

Related: odoo/enterprise#28893
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-27 15:11:13 +02:00
Miquel Raïch 055f95ddfe [IMP] event: use UserError in search method instead of ValueError
In a search method, the error comes from the user and thus the error should be an UserError. ValueError should be used for other cases.

closes odoo/odoo#93944

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-27 15:11:09 +02:00
Xavier-Do 23c36a86d5 [IMP] tests: add option to watch test execution in chrome
When browser_js tests, especially tours, it can sometimes be useful to connect to
chrome devtools in order to follow test execution. This can be tricky since we need to
find the `devtools_port`, browse 127.0.0.1/:`devtools_port` and clic on the link opening the
devtools from a remote adress with a specific version using the devtools websocket adress to
observe the test.

This commit adds an additionnal browser_js parameter, `watch` enabeling to automatically open
a new chrome window/tab with this specific url.

closes odoo/odoo#66769

Related: odoo/documentation#2305
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-06-27 15:11:06 +02:00
Xavier BOL (xbo) 64745b506c [FIX] hr_timesheet: ensure UoM is defined on timesheets
Before this commit, if the user uses Studio app to customize the form
view of timesheet and adds `product_uom_id` field in that view, then if
for instance that field is invisible, it will be in in the vals when the
user will create a timesheet. In that case, the value given to that
field will be False since the field has no default value. Since in the
compute of `total_timesheet_time` defined in project used that field to
convert the `unit_amount` of each timesheet linked to this project in
the right UoM, the `product_uom_id` field has to be defined if the AAL
is a timesheet, otherwise, the timesheets without any UoM set on
`product_uom_id` will be excluded in the compute.

This commit fixes the issue by setting a UoM if the UoM is not in vals
or if the value is False for a timesheet.

opw-2884148

closes odoo/odoo#94643

X-original-commit: 9ec6f14c2a6863ed45c24e8695bb56512996fa16
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-27 13:58:51 +02:00
Yannick Tivisse 8d631d8acd [IMP] hr_recruitment: Improve kanban view for long job titles
There is an overlap with the ribbon for long titles

closes odoo/odoo#94634

Taskid: 2888621
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-06-27 12:34:09 +02:00
Kevin Baptiste f24c909462 [ADD] l10n_mx_hr: add specific employee fields
Add fields specific to Mexico.

closes odoo/odoo#92393

Taskid: 2859750
Related: odoo/enterprise#27892
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-06-27 11:20:07 +02:00
Nicolas Pierre 9f3c6bfd25 [IMP] mrp: add production capacity in split wizard
Add in the split wizard the quantity of MO that can be produced using the available quantity of components.

closes odoo/odoo#88855

Pr: https://github.com/odoo/odoo/pull/88855
Task-id: 2773895
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-06-27 11:20:03 +02:00
Hubert Van de Walle (huvw) 2a9ee1307a [FIX] point_of_sale: close popup buttons hidden on mobile
Steps to follow:

  - Use a mobile view in the browser dev tools
  - Open the POS app
  - Perform a Sale
  - Close the session

opw-2788751

closes odoo/odoo#94587

X-original-commit: 654cdb5b8a46c9b44d432f05bcaf29d20fe3e306
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-06-27 10:10:40 +02:00
Pratik Raval 992ef282ac [FIX] mass_mailing(_sms): make 'Retry' button generate a cron trigger
When we use the "Retry" button in case of a failed SMS mailing, it puts
the mailing back to the queue, which will be processed when on the next
cron call of `Mail Marketing: Process queue`  (generally on the next
day). However, it should immediately generate a cron trigger in this
case so that SMS(s) can be sent right away.

The same goes for Email Marketing, where it should immediately generate
a cron trigger so the mailing can be sent immediately.

With this commit, instead of simply putting the mailing back to the
queue, we utilize the method `action_put_in_queue` which immediately
generates the cron trigger in both cases.

taskID-2760101

closes odoo/odoo#94269

X-original-commit: 572a7effb271ad134bb936751292668ae7b2b590
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-27 10:10:34 +02:00
Florian Vranckx 396a7e775b [FIX] l10n_fr : 0% tax in wrong category for repport
Steps to reproduce:
	- install l10n_fr, account_accountant
	- generate an invoice with tax "TVA 0% autres opérations non imposables (vente)"
	- Got to Accounting > Reporting > Tax Report
Issue:
	The last invoice would appear in the 02 "Autres opérations imposables" meanwhile it should appear
	in the Autres opérations non imposables

Solution:
	Change the base data to fit

opw-2882543

closes odoo/odoo#94613

X-original-commit: f18d99699d37dc5c67f3cdae98d70865db0d8282
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2022-06-27 09:10:06 +02:00
momegahed 838b856b88 [FIX] sale: SO amendments after invoicing change the unit price
Steps to reproduce:

1- install sale, invoicing
2- create a product p with price pr
3- create a new Sales Order SO with p and edit the price
to any other price than pr
4-  create an invoice
5- go to SO, reduce quantity to 0 ( customer returns the item )
6- the unit price is set back to pr and there is no way to edit it

Bug:

in 836f463c97 the `_compute_price_unit`
method was changed from onchange to depends which caused the edits now
to be commited to memory.
While it can be beneficial for other flows, for this specific use case,
it is not

Fix:
make an exception for lines with already invoiced quantities

OPW-2830824

closes odoo/odoo#94482

X-original-commit: b77346926f634f2f06fe1b06b68835a360ae91c5
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2022-06-26 10:53:00 +02:00
Jeremy Kersten 1186424387 [FIX] mail: check access on translation too
This commit checks that users without the access right 'Template Editor'
are not allowed to add dynamic qweb in the translations of a mail
template.

Old tests have been updated to keep the assertRaises and all the code
that handle the invalidation cache, ... But now we ensure that the
Access Error raised is the expected one.

Original tests was testing that a user without the group 'Mail Editor'
got an  access error due to the missing group, but since the commit
1a3e713 the Access Error is because you cannot edit a template that is
not created by yourself.

closes odoo/odoo#94597

X-original-commit: 127a598e96e0e4a9952c009d98b705ceccf40def
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-25 17:06:48 +02:00
William Braeckman b4f77a5362 [FIX] hr: fix access error on language change
Backport of odoo/odoo#81474
Before odoo/odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

closes odoo/odoo#94618

X-original-commit: 90cec4073e065c142043fcea1d68a10c7cb72e73
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-06-25 10:50:48 +02:00
Romain Derie 56a9636af3 [FIX] website: lower the step safety check amount
The drag and drop mega test is quite simple: the python gets the list of
all the snippets (by rendering a view + etree), then it just starts a JS
tour by passing all those snippets in the tour URL.

From there, the JS tour is in charged of building its own steps based on
the list of snippets it received from the python.

The MOST important part is to be 100% sure that the built steps are as
expected: ~5 steps / snippets: ~220 steps with website only and ~280
steps with all modules.
If we don't have that check, the tour could suddenly not test anything
because the step list would be empty, but the test wouldn't fail.

Thus, we don't want to programmatically try to compute that step amount
but want it to remain an hardcoded number, which is lowered in this
commit as if we have 220 (it could be 200, 150..) steps, it means that
the steps were built as expected.

Note that since the test is run on post_install, 280 was fine since all
modules were installed.
But the nightly build is also testing this test with only the website
module, ultimately failing.

Note that this check was actually not working at all since [1] as there
was a typo on `length`.

[1]: https://github.com/odoo/odoo/commit/61b19dafd1fb79120f701b94038bbe859aa2e271

closes odoo/odoo#94614

X-original-commit: 23c6b49ba43e6146143bf83bdfd7ce93934961ea
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-06-24 22:29:42 +02:00
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