Commit Graph
148388 Commits
Author SHA1 Message Date
Umesh Gupta b07edf4fa8 [FIX] {website_}crm: fix tracebacks while merging leads
Before this commit, if we try to merge crm leads and few of the
details are not available, traceback was thrown. For ex-
 - When lead does not have a company or the company does not have
   currency set
 - When the visitor name is not set

This commit fixes both of the tracebacks and thus allows users
to merge the leads in these cases.

taskID-2745017

closes odoo/odoo#84656

X-original-commit: eda3f43dde8122aa5f572f57bf2c3c0d94abe1f2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-15 16:51:31 +00:00
Thibault Libioulle c5198b0bab [IMP] payment{,_stripe},{,website_}sale: improve stripe onboarding
This commit lighten payment onboarding form in order to take advantage
of the Stripe Connect Onboarding Flow. It integrates the Stripe
Onboarding using the IAP proxy.

Purpose
=======
Help users easily onboard with Stripe by using the Stripe Connect API.

Specifications
==============
During the payment onboarding, if the user selects Stripe, they will
start the Stripe Onboarding. (NB: The process uses a proxy that handles
the Stripe Onboarding calls and signs them with the Stripe Connect key)
1) A call is made through the proxy to get the Stripe account token;
2) A call is made through the proxy to get the Stripe account link which
   contains the URL of the Onboarding;
3) The user is redirected to the Stripe Onboarding;
4) The user completes the Stripe Onboarding;
5) The user comes back to the acquirer form of Stripe and is able to get
   their keys.
6) The user can directly create their webhook after having copied/pasted
   their API keys.

During the website sale onboarding, the user doesn't go through the
onboarding wizard but is directly prompted to activate their account.

Note that the Onboarding status isn't stored in the database so there is
no call to Stripe API to validate the account status.

API Documentation :
- Connect Onboarding: https://stripe.com/docs/connect/standard-accounts
- Webhook creation: https://stripe.com/docs/api/webhook_endpoints/create

task-2685160
task-2691213

closes odoo/odoo#84639

X-original-commit: 085f4af4e57c43127413585a8df5b3aa47843339
Related: odoo/enterprise#24376
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Thibault Libioulle (tle) <tle@odoo.com>
2022-02-15 16:51:24 +00:00
Antony Lesuisse cec482878e [IMP] payment: fix payment icon sequence
This commit adds payment icon sequence to display the icon in a more
famous-more visible order.

task-2685160

X-original-commit: d11ff9eda43c390f584a148a956f7bc505007765
Part-of: odoo/odoo#84639
2022-02-15 16:51:24 +00:00
Dominik Zians 7111c9b404 [FIX] snailmail: change error code when timeout
When the snailmail API-call timed out, the SnailmailLetter.state and SnailmailLetter.error_code were not changed, which resulted in an infinite loop of retries  via the "Snailmail: process letters queue" cron job.
This commit changes this behavior: On a timeout the SnailmailLetter.error_code is changed such that no retry happens. Following stable policy, no timeout error is added, but 'unknown error' will be used. Preventing retries on timeout is mandatory as timed-out request are indeed processed by IAP and customer credited.

closes odoo/odoo#84263

X-original-commit: b3c46e8050e9405e69cfbe9c49706a22007e10ba
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Zians Dominik (dozi) <dozi@odoo.com>
2022-02-15 16:51:15 +00:00
Philippe Wauthy ca5ee8e2ae [FIX] hr_holidays: clean allocation validation
PURPOSE

When we made the b2b on Time Off, we designed the allocation settings to be like this :

    1. Allow Allocation : NO (stop here)
    2. If YES
    Can the Employee requests Allocation himself ?
2.1. NO (stop here, cause the HR will create the allocation and it will be automatically accepted)
2.2. If YES
Who will approve the Allocation made by the Employee ?
2.2.1. Nobody, it's directly approved
2.2.2. The time off officer must approve
2.2.3. It's SET by the time off officer.

In the day to day live, the case 2.2.3. never happen. It's the same settings as 2.1. "the employee will not make an allocaiton request, it will be the HR officer"
In fact, nobody understand what is behind that settings and the technical code behind it seems obsolete.

SPECIFICATION

1. Remove the "set by time off officer"
2. If Employee Requests is set on "Not Allowed", don't display Approval : https://tinyurl.com/yxwwql83 if an allocation is created, it will be done by the HR officer and automatically approved.

task-2705150

closes odoo/odoo#81914

Related: odoo/upgrade#3247
Related: odoo/enterprise#23105
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-15 16:51:11 +00:00
Philippe Wauthy a7819fe1ef [FIX] hr_holidays: fix change of employee_id in context
Observed behavior

When logged in as another employee than Mitchell Admin (or equivalent
employee who has an ID of 1 in the database), the number of days
allocated and displayed in the time off type name when creating a time
off from the dashboard is by default the one of Mitchell Admin.

Expected behavior

The allocation in the time off type should reflect the allocation of the
employee

Steps to reproduce

1) Create a new user and an employee for this user
2) With the credentials of this user, create a new time off from the
   dashboard calendar
3) The default time off type has the allocations of Mitchell Admin (or
   equivalent employee who has an ID of 1 in the database)

task-2712193

closes odoo/odoo#81213

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-15 16:51:01 +00:00
Adrien Widart 9870b42d3b [FIX] stock_account: return product with PU equal to zero
To reproduce the issue:
(Need purchase,sale_management)
1. Create a product category PC:
    - Costing Method: FIFO
2. Create a product P
    - Type: Storable
    - Category: PC
3. Create a PO with 1 x P @ 10 + Receive P
4. Create a PO with 1 x P @ 0 + Receive P
5. Create a SO with 1 x P + Deliver P
6. Create a SO with 1 x P + Deliver P
7. Process a return for sold P at step 6
8. Open the valuation of the return

Error: The value is 10, should be 0

In `_get_price_unit`, `price_unit` is defined with the correct value
(i.e., `0`), but the if-condition of the `return` is not respected, so
another value is used

OPW-2735502

closes odoo/odoo#84649

X-original-commit: 3ad98f7da027829c563fb9ebc86e8299721743db
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-02-15 15:51:56 +00:00
Achraf (abz) 6353fbaa06 [FIX] web: Allow user to groupby nonstored field
For the moment we cannot groupby an inherited field (which is therefore related) in a graph view, so it is counted as being non-stored.
Because in the `_normalize` function we do not process fields that are not stored, whereas like here

https://github.com/odoo/odoo/blob/d679cd0d8ba9a2420e81a42a698763e9be2327e1/addons/web/static/src/legacy/js /control_panel/groupby_menu.js#L45-L49.

Typically when a field has store=False but sortable=True it is inherited from a stored field, so it can be sortable
So we have to use `sortable` instead of `sort` to make it consistent.

opw-2733133

closes odoo/odoo#84612

X-original-commit: ce2a538e2988aef572171f783891cd6ee644ad14
Related: odoo/enterprise#24351
Signed-off-by: Achraf <abz@odoo.com>
2022-02-15 15:51:42 +00:00
Antoine Guenet bf61c9a36a [FIX] web_editor: properly convert fonts to images
export_icon_to_png sometimes failed because PIL's getbbox returned None.
This fixes it by not using a default color of (0, 0, 0, 0) when creating
the image but using the actual color of the image instead.
Also, the size of the image was wrong because of using the default size
when width and height are defined.

task-2761098

closes odoo/odoo#84638

X-original-commit: efcb432f4c459b2d2d819c3aed7d63d53fc93809
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-15 14:55:05 +00:00
Mathieu Duckerts-Antoine 93ea0d6ff9 [FIX] web: useAutofocus in mobile mode
In https://github.com/odoo/odoo/commit/4308de6aab93630c2c24a2d1d2ffd2db4e1d4b6b, the API of useAutofocus
was modified but only partly leading to problems in mobile mode.
We make the appropriate correction.

closes odoo/odoo#84541

Related: odoo/enterprise#24324
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-15 14:54:52 +00:00
std-odooandflch-odoo 78c0257ae4 [FIX] crm: sync the email / phone with the partner
Bug
===
If we
1. Open a lead with an email but without partner
2. Set a partner without email on the lead
3. The warning "The email will be propagated" is visible
4. When saving the form, the email is not propagated even if the
   warning message was visible

Solution
========
The reason is that, as the email was not changed, the inverse method
of this field was not called and so the email was not propagated.

The best solution would be to use "force_save" on those fields. But
this feature only works on readonly fields.

So, we simulate a real "force_save" on the email / phone, directly in
JS. That way the inverse will be called, and if necessary, the email /
phone will be propagated.

Task-2704904

closes odoo/odoo#84618

X-original-commit: 1d548c7eadcd25b97856c4769759358f86e00640
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: flch-odoo <flch@odoo.com>
2022-02-15 11:24:16 +00:00
Laurent Stukkens (LTU) e59e34ea2d [FIX] sale_project: prevent unacceptable project form loading time
Previous implementation was generating an unoptimised query which
lead to unacceptable loading time on large databases.

task-2764954

closes odoo/odoo#84611

X-original-commit: aec71f39a7a7919c15d3ba49eabe6e5bf74d757f
Signed-off-by: Xavier <xbo@odoo.com>
2022-02-15 11:24:12 +00:00
Kevin Baptiste 55e4f94752 [FIX] hr_holidays: correctly show employee's Dashboard
Only show the leaves taken by the current employee when using the Leaves
stat button on an employee's form.

closes odoo/odoo#84609

Taskid: 2764912
X-original-commit: 7413e7c5834713381870073db02019c7dd8ea6c4
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-15 11:24:08 +00:00
Thanh Dodeur 73961202fe [FIX] mail: prevent empty popover in the rtc controller
Before this commit, the popover containing the options of the rtc
controller was rendered empty. This was because the `t-set` was used
instead of `t-set-slot`. This commit fixes this issue.

closes odoo/odoo#84595

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-02-15 11:24:04 +00:00
Yannick Tivisse 4d5feb27e0 [FIX] pos_hr: Allow HR officer to unlink an employee
closes odoo/odoo#84574

X-original-commit: 5cab5c11436d83bdaaf0f8c678c959340427d469
Related: odoo/enterprise#24337
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-15 11:23:52 +00:00
Demesmaeker 95a1b387cb [IMP] payment: test the call to send_payment_request
Adding a test to verify if `send_payment_request` is used once and
only once, and under the right conditions.
In the utils, we change the direct use of `opener` in
portal_transaction for a softer use of `url_open` which manage the
url and then call the `opener` for a same end result.

task-2659750

closes odoo/odoo#84582

X-original-commit: c9371a2ec8dfbd7e55b1b6595e2a76d76ee36e12
Related: odoo/enterprise#24338
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2022-02-15 10:26:12 +00:00
Odoo's Mergebot dfc82a655b [MERGE] SMApps: improve performance / remove fields
PURPOSE

Improve performance in often used views and fields in a normal Odoo usage.

SPECIFICATIONS

On crm.lead model

  * remove field user_email and user_login fields. Those are related non stored
    and used in kanban for no reason (or even not used). Those can be removed
    completely;

On res.partner model in website_crm_partner_assign, convert the computed field
``_compute_implemented_partner_count`` to use read_group. Performance test
have shown it could be costly.

By the way reorganize website_crm_partner_assign content.

Task-2752043

closes odoo/odoo#83806

Related: odoo/upgrade#3215
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-02-15 11:25:59 +01:00
Thibault Delavallée 766e0c98c4 [IMP] website_crm_partner_assign: use read_group for computed fields
PURPOSE

Improve performance in often used views and fields in a normal Odoo usage.

SPECIFICATIONS

On res.partner model in website_crm_partner_assign, convert the computed field
``_compute_implemented_partner_count`` to use read_group. Performance test
have shown it could be costly.

Also rename ``implemented_count`` to ``implemented_partner_count`` to better
match ``implemented_partner_ids`` naming.

Task-2752043

Part-of: odoo/odoo#83806
2022-02-15 10:25:58 +00:00
Thibault Delavallée 82f3ee064c [MOV] website_crm_partner_assign: split models and views into separate files
Give a little coup de jeune to this module by reorganizing models and views
into separate files.

Task-2752043

Part-of: odoo/odoo#83806
2022-02-15 10:25:58 +00:00
Thibault Delavallée 5664ee04f4 [IMP] crm: remove outdated fields
PURPOSE

Improve performance in often used views and fields in a normal Odoo usage.

SPECIFICATIONS

On crm.lead model

  * remove field user_email and user_login fields. Those are related non stored
    and used in kanban for no reason (or even not used). Those can be removed
    completely;

Original commit seems to be odoo/odoo@ea2e8b64c4 which seems to show those
fields were added to add a gravtar based on user email, and its login was used
to display "responsible". Maybe an internal Odoo related spec, anyway not used
anymore.

Task-2752043

Part-of: odoo/odoo#83806
2022-02-15 10:25:57 +00:00
Adrian Teng 45b38f52bb Create AdrianTeng.md
closes odoo/odoo#84588

X-original-commit: b80220a6d446ac4b27925482b00bfc963f57d3f2
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-02-15 09:27:03 +00:00
Adrian Teng cb07225bb0 Update create doc on allowed vals_list types
X-original-commit: 1c6fc48ee80906e22a11c7e49f238d2e4e747417
Part-of: odoo/odoo#84588
2022-02-15 09:27:03 +00:00
Samuel Degueldre 07bbe4e8dc [IMP] test_lint, *: activate no-duplicate-imports eslint rule
*: base_automation, hr, mail, web, web_tour, website_payment

Previously, some modules were imported twice, this increases duplication
and can make refactoring more difficult. This commit enables the
no-duplicate-imports eslint rule and fixes offending modules to remove
duplicates.

closes odoo/odoo#84530

Related: odoo/enterprise#24319
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-15 09:26:54 +00:00
Samuel Degueldre 284ce4b7a4 [IMP] tools, test_js_transpiler: add support for import default + named
Previously, importing the default export on the same line as the named
exports was not supported, this commit adds support for that in order to
allow removing duplicate imports.

before:
import something from "path";
import { A } from "path";

after:
import something, { A } from "path";

Part-of: odoo/odoo#84530
2022-02-15 09:26:53 +00:00
Samuel Degueldre 9b8f77caee [IMP] test_lint, web, point_of_sale: enable no-unsafe-negation rule
This commit also enables the valid-typeof rule which didn't find any
issues

Part-of: odoo/odoo#84530
2022-02-15 09:26:53 +00:00
Samuel Degueldre 3ed0869558 [REF] test_lint: make test_eslint use an eslintrc file
Previously eslint was entirely configured through the use of
command-line arguments stored in python variables, this is difficult to
read and modify. This commit moves the existing rules into an eslintrc
file which is the standard way to configure eslint.

Part-of: odoo/odoo#84530
2022-02-15 09:26:53 +00:00
Pablo Montenegro 4fd8dab24a [CLA] add new members to Adhoc CLA
closes odoo/odoo#84493

X-original-commit: 2df9503fddc0e6d1dcd4478de334c20ae6325b18
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-15 09:26:38 +00:00
Nasreddin Boulif (bon) 56e6c90e6d [FIX] web: display correct favicon depending company
Steps to reproduce:

 - Activate Debug mode
 - Go to Settings -> Companies
 - Create company A and B and set a different favicon for each company
 - Refresh the page or switch company

Issue:

  The favicon is not the right one.

Cause:

  Code (that update favicon) removed when refractoring of owl.
  Related commit: https://github.com/odoo/odoo/commit/0573acae2306bf5da2005852da9323ddc59e5431

Solution:

  When web client start, update in JS the favicons (desktop and mobiles)
  with current company favicon.

opw-2664525

closes odoo/odoo#84571

X-original-commit: fa2cc58ef34382a8b9a8d04a6e54267e39630432
Signed-off-by: Jérémy Kersten <jke@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-02-15 08:34:05 +00:00
Thibault Libioulle ecd08f519f [FIX] website: fix matching of search term and fuzzy term
Prior to this commit, when a user searches with an upper case search
term of more than 3 characters, the search was considered as a fuzzy
search even if the result was an exact match.

Since the search is always lowered when there are more than 3
characters, the search is considered as fuzzy only when the search and
fuzzy term are case insensitively distinct.

closes odoo/odoo#84593

X-original-commit: 34362a7c07a2868103b24d16a83a97356ad1f60d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-14 22:31:11 +00:00
roen-odoo 5450f50e35 [FIX] pos_gift_card: Access error gift card
Current behavior:
When trying to open the gift card list you get an access error if one of the cards has been used in another company.
This error appears because you cannot access SO from another company and the used gift cards were linked to a SO.
So shouldn't be able to use a gift card that was created in another company.

Steps to reproduce:
-Create a gift card in company A
-Use it in company B
-Try to access it from company A
opw-2732973

closes odoo/odoo#84584

X-original-commit: 37d2178263d0c3875c603c5e6c53118f7a518b32
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-02-14 22:31:07 +00:00
Pierre Masereel bd9212bce4 [FIX] sale_coupon: access to fields on coupon from POS
When a pos launched by a user having no access rights on sales order
lines is launched. It cannot have access to the coupon program because
it tries to get the computed field order_count that needs to read the
sale order lines.

closes odoo/odoo#84583

Task-id: 2742528
X-original-commit: 15a896f4c0a98472dfab26fa9a18ededdd6f1a56
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-02-14 22:31:03 +00:00
Pierre Masereel 59c3b32778 [FIX] pos_coupon: allow coupon creation when generated from POS
When a coupon is generated from POS order, you get a traceback saying
you don't have access rights on "coupon.coupon" when you are only a pos
user.

So when we need to create the coupons and write on it, we are doing it
in sudo, to let the pos process generate the coupon.

Task-id: 2742528
X-original-commit: 2faefd5d6e69170a49c2cc5aca000f791f40f448
Part-of: odoo/odoo#84583
2022-02-14 22:31:02 +00:00
Rémi RahirandLucas Lefèvre 249162b047 [FIX] web: Domain arrayToString support 'in' operator
The function `arrayToString` did not properly support domains containing
arrays of booleans, for instance `[["val", "in", [true, false]]]`. The
array containing the boolean was directly JSON stringified without being
converted to its python equivalent.

closes odoo/odoo#84592

X-original-commit: 62f996e43098dc0f671f1e2cbb36f977ef6a36c9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Lucas Lefèvre <lul@odoo.com>
2022-02-14 21:36:51 +00:00
Agustín Castro Bugallo e0174ce9d5 [FIX] stock_account: fix expected singleton error on post
While calling `_stock_account_prepare_anglo_saxon_out_lines_vals`, the line
`credit_expense_account = accounts['expense'] or self.journal_id.default_account_id`
can cause a 'Expected singleton' error. During upgrades from v13 and earlier,
the value used for `accounts['expense']` is always `None`.
If the recordset in `self` contains more than one record, the error will happen.

By replacing `self` with the iteration object `move`, this error is averted.

The error happened during an upgrade from v13. Since the value assigned to
`accounts['expense']` doesn't exist in that version, it goes to
`self.journal_id.default_account_id` to grab it.
If `self` has more than one record, the error happens.

Traceback:
```
Traceback (most recent call last):
  File "/home/odoo/src/odoo/14.0/odoo/service/server.py", line 1199, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/home/odoo/src/odoo/14.0/odoo/modules/registry.py", line 89, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/odoo/src/odoo/14.0/odoo/modules/loading.py", line 475, in load_modules
    migrations.migrate_module(package, 'end')
  File "/home/odoo/src/odoo/14.0/odoo/modules/migration.py", line 180, in migrate_module
    migrate(self.cr, installed_version)
  File "/tmp/tmpae3wx5o6/migrations/account/saas~13.4.1.1/end-09-payment-refactoring.py", line 618, in migrate
    util.iter_browse(env["account.move"].with_context(**ctx), ids, chunk_size=1024).action_post()
  File "/tmp/tmpae3wx5o6/migrations/util/orm.py", line 197, in caller
    return [getattr(chnk, attr)(*args, **kwargs) for chnk in chain(it, self._end())]
  File "/tmp/tmpae3wx5o6/migrations/util/orm.py", line 197, in <listcomp>
    return [getattr(chnk, attr)(*args, **kwargs) for chnk in chain(it, self._end())]
  File "/home/odoo/src/odoo/14.0/addons/sale/models/account_move.py", line 14, in action_post
    res = super(AccountMove, self).action_post()
  File "/home/odoo/src/odoo/14.0/addons/account/models/account_move.py", line 2715, in action_post
    self._post(soft=False)
  File "/home/odoo/src/enterprise/14.0/l10n_mx_edi_landing/models/account_move.py", line 26, in _post
    return super()._post(soft)
  File "/home/odoo/src/enterprise/14.0/l10n_mx_edi/models/account_move.py", line 456, in _post
    return super()._post(soft=soft)
  File "/home/odoo/src/odoo/14.0/addons/sale/models/account_invoice.py", line 75, in _post
    posted = super()._post(soft)
  File "/home/odoo/src/odoo/14.0/addons/purchase_stock/models/account_invoice.py", line 171, in _post
    return super()._post(soft)
  File "/home/odoo/src/enterprise/14.0/account_reports/models/account_activity.py", line 75, in _post
    return super()._post(soft)
  File "/home/odoo/src/odoo/14.0/addons/stock_account/models/account_move.py", line 49, in _post
    self.env['account.move.line'].create(self._stock_account_prepare_anglo_saxon_out_lines_vals())
  File "/home/odoo/src/odoo/14.0/addons/stock_account/models/account_move.py", line 158, in _stock_account_prepare_anglo_saxon_out_lines_vals
    'account_id': credit_expense_account.id,
  File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 3821, in __get__
    raise ValueError("Expected singleton: %s" % record)
ValueError: Expected singleton: account.account(1383, 38, 30)
```

closes odoo/odoo#84129

X-original-commit: acda26fd71eac3c6bac1ad81886cd8885bc69c5a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-02-14 21:36:48 +00:00
Christophe Monniez f0715c419a [FIX] tests: wait for futures before clearing browser
When a test fails and asks for a screenshot, it seems that in some
conditions, the browser has already navigated to the blank page when
capturing the screenshot, resulting in a useless blank screenshot.

With this commit, all the futures are awaited to avoid this race
condition.

closes odoo/odoo#84566

X-original-commit: 37a7b81c28a7ad7c4f225e1463df96bbaf2d5c8f
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-14 19:25:13 +00:00
Brice bib Bartoletti c11ae302fc [FIX]purchase_stock,stock_account:partner on aml
The aim of this commit is to set partner on anglosaxon
aml in order to help our client in their stock
reconciliation process in case it hasn't been done automatically.

Before this commit:
anglosaxon line were created without partner

After this commit:
A partner is set when anglosaxon line are created

closes odoo/odoo#84547

Ticket: 2692308
Community-pr: https://github.com/odoo/odoo/pull/84468
X-original-commit: abfe37fcea5b20f77799d9331d4d011530880669
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-14 19:25:06 +00:00
Wolfgang Taferner c099709b85 [FIX] http_routing: mitigate key does not exist in context for lang
closes odoo/odoo#84478

X-original-commit: bdde46dad4d5886a8423bfaa0cac316784c7d382
Signed-off-by: Olivier Dony <odo@odoo.com>
2022-02-14 19:25:02 +00:00
Antoine Guenet afc2e84a9b [FIX] web_editor: better align converted icons
Icons converted to images were improperly aligned because as inline
elements their vertical-align style property used their first block
ancestor as reference.

closes odoo/odoo#84513

X-original-commit: eb0fa518b563206afcc214a81f89cea45820b34c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:27 +00:00
Antoine Guenet c99f652aa9 [FIX] mass_mailing: apply mail-safe font on everything
The final mail to be sent will have to use a mail-safe font everywhere
so we can't allow other fonts to be applied in some elements. Because of
the way the css was declared, we still had other fonts on some elements,
like .btn. As a result, we had a different look between readonly and
edit modes.

X-original-commit: bde0dbe9a4ade4ec0fe1a5b44fc64e5d484ac49e
Part-of: odoo/odoo#84513
2022-02-14 14:51:26 +00:00
Antoine Guenet 608a9909bc [FIX] web_editor: ensure border around comparison snippet
The conversion of the comparison snippet for mail compatibility involves
heavy changes in the html. In order to preserve the style, some style
changes were needed as well. This change to the style of cards allows us
to restore the border around the snippet.

X-original-commit: fae07f2dcd74ed3ce85d37cc7ea0180b40994ff1
Part-of: odoo/odoo#84513
2022-02-14 14:51:26 +00:00
Antoine GuenetandNicolas Bayet 18fb205c41 [REF] web_editor, mass_mailing: replace use of jQuery in convert_inline
jQuery was used extensively in `convert_inline`, slowing it down by a
factor of more than 2. This replaces all use of jQuery with vanilla
javascript so as to improve performance significantly.

X-original-commit: 8573a4ebbfe951c9ce0d3ef753174f4f0a6c829b
Part-of: odoo/odoo#84513
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
2022-02-14 14:51:26 +00:00
Antoine Guenet 612cd4e092 [REF] web_editor: remove _applyOverDescendants
Rules used to be applied in the DOM sequencially, in traversal order.
This is slow and confusing to debug. Meanwhile, most functions had been
adapted to process the rules in a simple loop on the concerned nodes.
This commit does that for `classToStyle`, the last remaining function
that wasn't doing it yet, and removes the utility function
`_applyOverDescendants` altogether.

X-original-commit: 70253a98bd9d6752c29cfe61debf4567d0a872e8
Part-of: odoo/odoo#84513
2022-02-14 14:51:26 +00:00
Antoine GuenetandNicolas Bayet c40d9357fd [IMP] web_editor: apply rules only where needed
This improves performance of `classToStyle` by first selecting which
nodes and which rules will be concerned.
When parsing the css rules, we computed their specificity and normalized
their styles one by one. This applies these processes only on the
concerned rules, all at once.

X-original-commit: bb28624dcd69efe1aff546b37e66c05c001a5927
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:25 +00:00
Antoine GuenetandNicolas Bayet 6ec2d52c6f [FIX] web_editor: remove rule grouping in css rules parsing
Since some css was loaded twice, when parsing rules, we grouped similar
rules in order to minimize the amount of rules on which to iterate
during conversion, so as to improve performance. This is not needed
anymore now css is loaded only once, so we can remove this extra
processing.

X-original-commit: 3db6f4a345015adf99c2a744066dcdf8f076a657
Part-of: odoo/odoo#84513
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
2022-02-14 14:51:25 +00:00
Nicolas BayetandAntoine Guenet 96c859eb0a [IMP] web_editor: batch write in formatTables to avoid layout thrashing
This batches all writes in the `formatTables` method of `convert_inline`
so as to minimize layout thrashing and therefore improve performance.

X-original-commit: f3c0f0c62b9f31e47ef8644c79e1b9751d0ba746
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:25 +00:00
Nicolas BayetandAntoine Guenet 382b77bec2 [IMP] web_editor: batch write in classToStyle to avoid layout thrashing
This batches all writes in the `classToStyle` method of `convert_inline`
so as to minimize layout thrashing and therefore improve performance.

X-original-commit: addf3e8fa37f4f2cc212a55a332ec61090655232
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:24 +00:00
Nicolas BayetandAntoine Guenet a8cf97bdee [FIX] web_editor: prevent double-loading css in mass_mailing
`web.assets_frontend` was called in `wysiwyg_iframe_editor_assets` _and_
in `iframe_css_assets_edit`. As a result, they were loaded twice in edit
mode.

X-original-commit: 4bea292681039c1954c6c9038742fa6e2cc2c31e
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:24 +00:00
Nicolas Bayet 8f829fb7bc [REF] web_editor, mass_mailing: remove unused code
`__extraAssetsForIframe` had been kept in `mass_mailing` and
`web_editor` for historical reasons but was not used anymore. This
removes it.

X-original-commit: 88b91df3ff75bb0be9a84761cb251d0b7b3c976d
Part-of: odoo/odoo#84513
2022-02-14 14:51:24 +00:00
Antoine Guenet 0791c31654 [FIX] web_editor: correct reference to editable in tests
Some tests depended on a variable to be defined, which was only defined
in other tests.

X-original-commit: d3e30a532526e7be54d6153a3ed375ff30d8f8e3
Part-of: odoo/odoo#84513
2022-02-14 14:51:23 +00:00
Odoo's Mergebot 793b738d03 [MERGE] project sharing follow up
Follow up of tasks 2379518 and 2633229 (#73341 and #77156).

Purpose
=======

The main goal is to allow the portal user to click on some stat button shown in the task form view in the project sharing feature. Those stat button will redirect to a portal view if the portal user has access to the document(s).

Then, some refactoring is made to easily use the existing code for one route to another one and review the code for the project sharing tour.

Finally, the `/my/project` and `/my/task` routes have been renamed to follow the same *naming* in the another routes. That is, those routes will be named `/my/projects` and `/my/tasks`.

## Details of the implementation

- Allow the portal user to click on the sale order stat button in task form view. This stat button will be clickable if the user has access to the sale order of the current task shown in the form view, otherwise the stat button will be invisible. If a portal user clicks on this button, then he will be redirect to `/my/orders/<id of the sale order>`.
- Allow to show the parent task from another project than the one shown in project sharing. If the portal user has access to the other project than there is no reason to not allow him to see the parent task.
- Rename the `/my/project` route into `/my/projects`.
- Rename the `/my/task` route into `/my/tasks`.
- Create hook methods to avoid duplicating code when we want to use this code to another route. It will be the case for a new route used in the project sharing feature.
- Create hook method in controller of account module to easily reuse the existing code for another route for project sharing feature.
- Refactor tour js for project sharing feature to remove the duplicating code.
- Revert the disable click on avatar. This changes was initially done for project sharing feature. However, this changes is made `web` module instead of the `project`. Since this changes is no longer used in project sharing feature and no used in backend code, the changes is reverted.
- Move the `invoice_count` field from `sale_project` module to `industry_fsm_sale` one because it seems this field is only used in that module and not anywhere before installing that module.

task-2648955

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#82379

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-14 15:50:59 +01:00