Commit Graph
147000 Commits
Author SHA1 Message Date
Martin Trigaux d99cfd9416 [I18N] *: export saas-15.1 source terms
closes odoo/odoo#80964

X-original-commit: 0663892a34896980008eb0de69aeb58019a67e89
Related: odoo/enterprise#22759
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 13:48:53 +00:00
Thibault Delavallée bd0d951eef [FIX] website_slides: fix choosing of templates in invite wizard
``channel_id`` field is used to compute ``render_model`` of invite wizard
used to filter templates to choose. It is a fake trigger ensuring the
render model field is computed, and then used in template domain
(see ``mail.composer.mixin`` and ``mail.render.mixin``).

As channel_id field is not available in view the domain computation for
template_id is not updated. No template is therefore available in template
m2o field in invite wizard. This commit fixes that by adding the channel_id
field in the view, meaning render_model is now computed.

Task-2709581

closes odoo/odoo#80947

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-07 11:50:54 +00:00
Thibault Delavallée 836428788d [FIX] sms: do not force a void context
When scheduling a mass sms with a template, do not force a void body in
context as default value. Indeed it takes precedence on computation of body
based on template and may lead to a void value being given to create.

Task-2709581

Part-of: odoo/odoo#80947
2021-12-07 11:50:54 +00:00
Thibault Delavallée e8796e6302 [IMP] sms: add precompute on fields
As body and composition_mode are required, an override of create has been
added to ensure they have a value. Indeed compute are computed after creation
which leads to required not being satisfied.

Now that precompute[1] are available this code can be safely replaced.

Task-2709581

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

Part-of: odoo/odoo#80947
2021-12-07 11:50:54 +00:00
Thibault Delavallée 4d4c66acc4 [IMP] website_slides: remove unnecessary create override
An override of invite wizard exists to give a value to body and subject.
However as those are computed field (not required) this is not necessary.

Task-2709581

Part-of: odoo/odoo#80947
2021-12-07 11:50:53 +00:00
yhu-odoo a9d9a258e4 [IMP] stock(_picking_batch): improve set/clear qty button
Add a "clear qty" button to revert the change by "set qty" button in
(batch) picking.
On the move, Whenever the qty_done != reserved, we consider it a
manual change from the user. "set/clear qty" buttons won't change the
line with manual change.
Show "set qty" button when there are moves with 0 qty_done and non-zero
reserved. Show "clear qty" button when we don't show "set qty" button
and there are moves with qty done == reserved but the number is not 0.

Task-2659233

closes odoo/odoo#78737

Signed-off-by: Steve Van Essche <svs@odoo.com>
2021-12-07 11:50:45 +00:00
Brieuc-brd 1e466775fe [IMP] web_editor: add new background shapes
This commit introduces two new background shapes (Float 13 and 14).

task-2687297

closes odoo/odoo#80658

Related: odoo/design-themes#529
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-07 11:00:46 +00:00
alt-odoo e1d1e1f2a5 [FIX] hr_holidays_attendance: allow non HR officer user to refuse leaves
When refusing a leave, we are deleting the associated overtime if any so it can be
used again by the employee. However, we need HR Officer rights to access overtime
field. The sudo() should be used before we try to read the field to avoid errors
in case the manager of the employee does not have HR rights.

closes odoo/odoo#80945

X-original-commit: 1ffbcf9787e5efe00d49f18baba0144f631ada51
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
2021-12-07 10:08:17 +00:00
Kevin Baptiste e65a6f6eda [FIX] hr_holidays: bring back missing import
The custom calendar CSS was no longer imported.

Follow-up of #80397

closes odoo/odoo#80940

Taskid: 2675380
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-07 10:08:13 +00:00
Juan Jose Scarafia 2e75a77411 [IMP] l10n_ar: document types settings
1. disable document types that are not available https://www.afip.gob.ar/libro-iva-digital/documentos/Libro-IVA-Digital-Tablas-del-Sistema.pdf (remove "internal_type" value)
2. Add prefix and purchase_aliquots for every document type that usable (has an internal_type value)
3. Enable liquidacion primaria/secundaria de granos

closes odoo/odoo#80808

X-original-commit: 2cd1b449be537c545c153434536ddaae9975b717
Signed-off-by: Josse Colpaert <jco@odoo.com>
2021-12-07 09:14:09 +00:00
Alvaro Fuentes 525f7f1407 [FIX] hr_work_entry: improve query and add indices
The query below
https://github.com/odoo/odoo/blob/81497125d8100c6bdd2dc30434232a88a419a3e3/addons/hr_work_entry/models/hr_work_entry.py#L92-L115
has bad performance without the bespoken indices on `date_start` and
`date_stop`. We can speed it up more with an index on `employee_id`.

This is not enough for DBs with many work entries (500K+), specially
during upgrades.

Here we optimize the query to take into account only the work entries
being modified.

This issue was observed during an upgrade saas~12.3->13.0 where the
payslip recomputation never ends due to the increased amount of hr work
entries created. Note how the first 1K payslips are processed in 1 hour
(~16 payslips per minute), while the latest 3 (before the upgrade
was killed) took 1 min.
```
2021-11-02 21:05:44,403 2229 INFO db_42897 odoo.modules.migration: module hr_payroll: Running migration [$saas~12.4.1.0] end-compute-amount
2021-11-02 21:06:44,577 2229 INFO db_42897 odoo.upgrade: [1.61%] 1120/69635 payslip processed in 0:01:00.036716 (total estimated time: 1:02:12.729213)
2021-11-02 21:07:44,602 2229 INFO db_42897 odoo.upgrade: [2.66%] 1853/69635 payslip processed in 0:02:00.062972 (total estimated time: 1:15:11.918540)
...
2021-11-05 09:59:46,565 2229 INFO db_42897 odoo.upgrade: [47.95%] 33390/69635 payslip processed in 2 days, 12:54:02.025479 (total estimated time: 5 days, 7:00:30.261882)
2021-11-05 10:01:04,990 2229 INFO db_42897 odoo.upgrade: [47.95%] 33393/69635 payslip processed in 2 days, 12:55:20.450549 (total estimated time: 5 days, 7:02:32.725840)
```

opw-2672031

closes odoo/odoo#80898

X-original-commit: 47b7a760c5788782c65136e529c8283fe5f0cce2
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
2021-12-07 07:33:07 +00:00
Florian Damhaut 23b459abdf [FIX] hr_holidays : no traceback on accrual plan with no level
How to reproduce :
-Create accrual plan with no level

Current Behaviour :
Traceback because num2words does not support all of odoo language
For supported language, the numbers showed are not ordinal

Behaviour After PR:
Show Basic numbers in every case

opw-2697987

closes odoo/odoo#80849

X-original-commit: 0cf2ade4e6e959170906b4b0143e07909980b1d7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-07 07:33:03 +00:00
Florian Damhaut 57451578c0 [FIX] hr_holidays : no traceback on accrual plan with non-supported language
How to reproduce :
-Set language to portugese
-Try to access accrual plan in time off

Current Behaviour :
Traceback because num2words does not support all of odoo language
For supported language, the numbers showed are not ordinal

Behaviour After PR:
Show Basic numbers in every case

opw-2697987

X-original-commit: afa531b6c8a06f553784e90df7641024d9bb142c
Part-of: odoo/odoo#80849
2021-12-07 07:33:02 +00:00
Amin Dehghani 363cdd63e3 [CLA] signature for amindehghani
closes odoo/odoo#80934

X-original-commit: 06b3ba128081c8885da44a5b73845b03963a9f7b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 06:38:54 +00:00
Arthur Detroux (ard) 78a1e11326 [FIX] web_editor: show pointer cursor when hovering colors
Prior to this commit, when the user was hovering on colors in the
web editor, the cursor would stay with its default appearance.
Some users weren't able to tell if this was an interactive
element or not.

With this commit, we change the cursor to the pointer cursor when a user
is hovering the element so that they have a visual element indicating
that it's interactive.

task-2687469

closes odoo/odoo#80933

X-original-commit: 40fec954a369c94576b5ed88eade5d3ff120ca4a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-06 18:01:46 +00:00
Arnaud Joset 4196ea9dc2 [FIX] google_calendar: prevent traceback when resetting the google tokens from the reset account wizard
Before this commit, the account reset would fail with the following traceback:

```py
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/odoo/src/odoo/15.0/odoo/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoo/src/odoo/15.0/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
AttributeError: 'res.users' object has no attribute '_set_auth_tokens'
```

This commit allows to use the wizard.

opw-2705169

closes odoo/odoo#80918

X-original-commit: 9f2aa5c87a9809899cba872e6a0428f86c687b9a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-06 16:49:24 +00:00
Kevin Baptiste 60728a63db [IMP] hr_holidays: convert dashboard and widget to OWL
Convert the `leave_stats` widget and the leaves dashboard to OWL.

closes odoo/odoo#80397

Taskid: 2675380
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-06 16:49:20 +00:00
Leonardo Pavan Rocha 6739514087 [IMP] portal: adds access_token to pager urls in portal
Within portal, subscriptions/sales orders presented in list view have their URL
containing the access_token as a GET param. However, when clicking on a
subscription and using the pager to navigate between records, the access_token
is not present in the URL. In order to keep consistency between the links and
views, this PR adds the access_token as a GET param in the pager as well.

task-2512070

closes odoo/odoo#76673

Related: odoo/upgrade#2752
Related: odoo/enterprise#20357
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-06 16:02:01 +00:00
Sébastien Theys 7925804e39 [FIX] mail: ensure unlink-all properly does its job for x2many
Before this commit, unlink-all would sometimes fail to unlink more than one
record.
This seems to be the case in particular for x2many relations with isCausal true.

Indeed, the delete from isCausal is itself calling unlink-all on the inverse
relation (the same record that was being unlinked-all in the first place) which
would pre-emptively remove it from the same Set that was used during the initial
iteration.

The solution is to make a copy of the Set before iterating it to ensure all
records that were planned to be removed are actually removed.

Candidate fix for task-2410314 and definitely necessary for data integrity in
general.

closes odoo/odoo#80913

X-original-commit: 0077b93fea6f8c39ee535f19426c3f95a0e97e9f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-06 14:29:47 +00:00
Nicolas Bayet acd946b8a8 [FIX] mass_mailing: save from the codeview
Whenever opening the codeview from mass_mailing and then directly
saving the document did not work.

Task-2704335

closes odoo/odoo#80899

X-original-commit: d9fe1e22b4f645f1732283ab558de170716a7434
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-06 12:55:14 +00:00
Nicolas Bayet f02b1727dd [FIX] base: allow the codeview for the user signature
Task-2674070

closes odoo/odoo#80897

X-original-commit: 17d9a044ff0cab09a40695da00769dd55135577f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-06 12:55:11 +00:00
Nicolas Bayet 4bde8e8b38 [FIX] web_editor: properly call addRowBelow
The call to `addRowBelow` was not updated to the new API.

Task-2698729

closes odoo/odoo#80896

X-original-commit: f7fb967cd8ada702e298d097ea107fda802fa6a4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-06 12:55:07 +00:00
Merlin (megu) bd283e90a4 [FIX] base_vat: display correct partner name in error message
VAT check error message says 'record_label' instead of real partner name

Steps to reproduce:
1. Install the Contacts app and the VAT Number Validation module
2. Go to the Contacts app
3. Create a contact and define his country and an invalid VAT number
4. Save

Solution:
Modify the error message with the correct placeholder

OPW-2692320

closes odoo/odoo#80660

X-original-commit: 0aff6adc03c2d7cd6b3d29848e895cd258e42348
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2021-12-06 12:55:03 +00:00
Alexandre Kühn 1543d5a6fd [IMP] mail: move composer send shortcut from prop to field
In preparation for using OWL v2 in discuss code.
(`shouldUpdateBasedOnProps` will be removed)

Task-2695743

closes odoo/odoo#80615

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-06 12:55:00 +00:00
Zelong Lin e6b4761bec [FIX] discuss: clicking on attachment download closes current rtc call
Using <a> with 'download' attribute to download the attachment.
Prevent calling .navigate() interrupting the current call.

task-2692597

closes odoo/odoo#80903

X-original-commit: 97fa88c2e8407972c83c93d4d2198633a5560ecc
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-06 12:07:34 +00:00
Alexandre Kühn eb29425f73 [IMP] mail: remove NotificationPopover/notificationLocalIds deep props
In preparation for using OWL v2 in discuss code.
(shouldUpdateBasedOnProps will be removed)

Task-2695743

closes odoo/odoo#80616

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-06 12:07:30 +00:00
ren-odoo b8110de4ed [IMP] l10n_pe: Update website reference
The website is now referenced to Odoo's website, with the most updated documentation.

closes odoo/odoo#80514

X-original-commit: 98025e4919e8a907419794b03d0386648c31343f
Signed-off-by: Josse Colpaert <jco@odoo.com>
2021-12-06 11:21:47 +00:00
Adrien Widart dc54341dc0 [FIX] mrp_subcontracting_account: always return PU of subcontracted SM
When using AVCO and subcontracting without any additional cost, the
valuation of the finished product is incorrect

To reproduce the issue:
1. Create a Product Category PC:
    - Costing Method: AVCO
2. Create two products P_compo and P_finished:
    - Both:
        - Type: Storable
        - Category: PC
    - P_compo:
        - Cost: 10
        - Routes: Resupply Subcontractor
3. Update P_compo's quantity: 2
4. Create a Bill of Materials BO:
    - Product: P_finished
    - Type: Subcontracting
    - Subcontractor: a partner P
    - Component: 1 x P_compo
5. In Inventory, create a planned Receipt R:
    - From: P
    - Operations: 1 x P_finished
6. Mark R as To Do
7. Process the delivery of P_compo
8. Validate R
9. Repeat steps 5-8
10. Open the Inventory Valuation

Error: There are two valuation lines for P_finished: one line has a
value of $10, which is correct (this is the cost of the component).
However, the value of the second line is $20, it should be $10 too.

Here are a part of the values used to generate the related MO:
https://github.com/odoo/odoo/blob/2d12fb8fb94c0f2acade7222cfedbec34114a8e9/addons/mrp_subcontracting_account/models/stock_picking.py#L21-L25
In the above case, an extra cost is defined on the MO and is based on
the unit price of the subcontracted SM. However, `_get_price_unit` will
return an incorrect value:
https://github.com/odoo/odoo/blob/251be6b943ea8c3f274bb0863d0af3f7c6b8d10d/addons/stock_account/models/stock_move.py#L39
After step 8, the standard price of P_finished is $10. Also, in the
above case, there isn't any subcontracting cost, so there isn't any unit
price defined on the SM. Therefore, `_get_price_unit` returns the
standard price of P_finished ($10). As a result, when computing the
value of the finished stock move:
https://github.com/odoo/odoo/blob/4fc2ec31861d4602357f130066ec3507b96d8dc8/addons/mrp_account/models/mrp_production.py#L39-L42
It uses the extra cost of the MO + the component cost. This explains
where the $20 come from.

OPW-2641339

closes odoo/odoo#80889

X-original-commit: 0567536f8b66c71f6860041926542f88026793b1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2021-12-06 10:34:45 +00:00
Stéphane Bidoul a79426c3e3 account: search on parent_state instead of move_id.state
By searching on account.move.line parent_state instead
of move_id.state, we avoid a join in many circumstances
and allow the database to benefit on an index on
company_id+parent_state to optimize several
queries, such as the default filter on the Journal Items
menu which shows posted items.

closes odoo/odoo#80815

X-original-commit: c2a72c268e6a28d7448b6dbf96fed4e36d24b3fe
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2021-12-06 09:06:06 +00:00
Florian Damhaut f140704b31 [FIX] pos: check pricelist availability now
Current behaviour :
In POS, pricelist are based on the day and not the current moment so if a pricelist item start on day X at 01:00, it's not taken into account at day X at 02:00.

Behaviour after PR:
Pricelist are taken into account based on full time.

opw-2691883

related to  b3149d84a0

closes odoo/odoo#80779

X-original-commit: c0c968063bf791a13117434e8cdd0e3c8120eaa3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
2021-12-06 09:05:59 +00:00
Tiffany Chang (tic) d3a31eeff4 [FIX] sale_timesheet: handle blank uom in product form view
Even though `uom_id` is required by product.template, it's still
possible for users to delete it within the product view and trigger a
compute that depends on it before saving.

Steps to reproduce:
1 - install sale_timesheet + activate UoM
2 - open any product form, click on uom_id and delete the uom

Expected result: No UoM + user cannot save
Actual result: traceback + user can appear to save (but uom defaults
  back to last selected UoM

While this isn't a blocking problem since users won't be able to save
no UoM being selected, we would still rather avoid the traceback so we
default to no service_upsell_threshold_ratio message in this case and
properly prevent the saving.

Task: 2689438
Also fully fixes: odoo/odoo#78693

closes odoo/odoo#80868

X-original-commit: f60786a7490cc09a31fe0dd0d74cf97368184bd9
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-12-06 08:22:44 +00:00
Aaron Bohy 0133f4c183 [FIX] web: FieldDomain in debug: domains with dynamic content
In debug mode, the FieldDomain displays a textarea to allow the
manual edition of complex domains. However, when those domains
contain dynamic content (e.g. datetime stuff), the evaluated
version of that content was displayed, which isn't what we want.
We want to see the raw version of the domain as written in db,
and be able to edit it. This commit fixes that issue. Moreover,
we also ensure to keep whitespaces and new lines, which can be
useful for large domains.

closes odoo/odoo#80866

X-original-commit: 15301a1ddaf00e51688d8134b7cb19baf386577c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-06 07:35:42 +00:00
Nicolas (vin) 62954aaaf5 [IMP] [base, account_facturx]: Add PDF/A(-3B) support
Improve the factur-x export in two ways: make the exported PDF
PDF/A-3B compliant, and add the factur-x XMP metadata inside the file.

The added .ICC profile comes from https://www.color.org/srgbprofiles.xalter
License terms can be found here: https://www.color.org/profiles2.xalter#license

Task id # 2668919

closes odoo/odoo#80741

X-original-commit: 3a9a685fc360fee7fe10ed7fdb768414697673b2
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-04 21:45:04 +00:00
Alexandre Kühn c114614a28 [FIX] mail: properly render following canceled patching
Before this commit, sometimes component do not properly
render changes in the models. Although the modeling is correct,
there is a problem in the component not re-rendering itself.

The shouldUpdateBasedOnProps component hook did not consider
update attempts that could be canceled. This commit adds this
consideration, so that it ensures component is eventually
rendered correctly

Task-2410314
Task-2705078

closes odoo/odoo#80877

X-original-commit: 12c77f52c5a16c95e57de31587d67eda4d582bde
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-04 14:05:18 +00:00
IEL 64864a6402 [FIX] base, website: fix no web translation on duplicates
TLDR: if we have a term in python and js code, then js translation may not work

STEPS:

* install point_of_sale
* activate and switch to French translation
* go to "Point of sale >> Reporting >> Orders"
* Click "Time Ranges >> Range"

BEFORE: "This Week" is not translated

AFTER: All terms are translated

WHY:

* Translation imports merges translation if they have same src

  https://github.com/odoo/odoo/blob/1e39a2d3b8060963073a39d99ba3a14b07d03333/odoo/addons/base/models/ir_translation.py#L196
  https://github.com/odoo/odoo/blob/1e39a2d3b8060963073a39d99ba3a14b07d03333/odoo/addons/base/models/ir_translation.py#L111

  So, we get either js term for "This Week" or py term, but not both

* web/webclient/translations loads only translation with comments==openerp-web

  https://github.com/odoo/odoo/blob/1e39a2d3b8060963073a39d99ba3a14b07d03333/odoo/addons/base/models/ir_translation.py#L900

  So, if we don't have js term, then the translation is not loaded to UI

* This only fix problem of no translation, but doesn't fix overriden
translation (i.e. when same english term, e.g. Free, has different translation
in frontend and backend). This part can be fixed by changing english term to
something more unambiguous.
---

opw-2357399

closes odoo/odoo#80875

X-original-commit: 4b4234134bcb139c6c6a12992c5ab6195c3b2710
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-04 06:35:56 +00:00
Martin Trigaux b36e784ff2 [FIX] website: allow redirection to external websites
Before this commit, the redirections were only possible localy
(e.g. making a redirection to
https://www.bloggiflette.com/potimarroniflette on https://www.odoo.com
was redirecting to https://www.odoo.com/potimarroniflette)

It is safe to allow external URLs as only Website Designers can modify
it.

closes odoo/odoo#80874

X-original-commit: 133424025b22454fa88252806282f647e158d390
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-04 06:35:51 +00:00
Arthur Detroux (ard) ac8d83cc12 [FIX] website: properly rerender dynamic snippet
Before this commit, changing a filter in the dynamic snippet could
cause errors because the option wasn't awaiting an asynchronous
call.

This commit fixes that by using the same mechanism used in the
s_website_form snippet, relegating the rerenderXML call to updateUI

task-2654924

closes odoo/odoo#80867

X-original-commit: 8a4391a7d6e6988da7b62f6caa91e49c831da774
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-03 18:24:07 +00:00
Arthur Detroux (ard) 51c3a69304 [FIX] website_sale: make less product snippet refreshes
Prior to this commit, any add 2 cart would rerender the dynamic
snippet, making it flicker and in the case of the carousel, resetting
to page 1.

With this commit, only filters that require the snippet to reload will
do so.

task-2654924

X-original-commit: 7f84a10cc5ff7ba4c65c249dfb2fe546968e2a7c
Part-of: odoo/odoo#80867
2021-12-03 18:24:07 +00:00
Arthur Detroux (ard) 40de474f68 [FIX] website: use context in dynamic snippet
Prior to this commit, when using a ir.filter on a dynamic snippet,
the filter would not use the product context defined in itself.
This would cause unexpected behaviour like ignoring
the 'display_default_code: False' in the website_sale ir.filter.

This commit adds context to database record lookups.

task-2654924

X-original-commit: d10d406739239e8d8fc240b2c6b2596b1ee6e610
Part-of: odoo/odoo#80867
2021-12-03 18:24:06 +00:00
root 2d99d81da7 [FIX] base_vat: allow disabling VAT check through context
Before this fix there is no real way to influence the VAT validation.
This can be problematic though as in some cases external platforms push data to you
on which you don't really have control. If an external software pushes an invalid VAT
and your database has the option 'Verify VAT Numbers' checked on there is no way
for you to bypass this though.
This means that before this commit you have to always run VAT number checks on all data,
no matter if they come through the frontend or backend.

After this commit you can supply a context key 'no_vat_validation' though.
This way you could skip doing VAT number validations on (some) records while still
enforcing this in the UI.
This allows you to have crons/external API's push any VAT number while enforcing full
validation through the UI.

This opens up the best of both worlds.

closes odoo/odoo#80843

X-original-commit: d31bf866e1556327f634e20d6d845d67143e2a06
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-12-03 15:03:59 +00:00
Joseph Caburnay 5c93e371df [FIX] pos_cache: error when loading missing products
As part of loading orders, we need to make sure we load the missing
products. This process relies on the existence of the `product.product`
model declaration in the PosModel. However, since we are loading
products differently here in pos_cache, the `product.product` model
is removed from the list of models.

We are now return the `product.product` model to the list of models
after loading.

closes odoo/odoo#80844

X-original-commit: ccac36b353fb1f1ffc1905808765464c0cbba3e1
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2021-12-03 14:19:06 +00:00
FrancoisGe dc93dbefe0 [IMP] web: Run JS tests
After this commit, the tests launched from the debug tools or the
command palette will be in debug=assets mode.

This commit adds the "Run JS tests" and "Run Mobile JS tests" commands.

closes odoo/odoo#80842

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-03 14:19:02 +00:00
FrancoisGe 5801ff87cf [FIX] web: MockServer search
The mockSearch function should not return the list of records for a
domain and a model but the list of ids.

The path "/web/dataset/search" does not exist.

closes odoo/odoo#80835

X-original-commit: 5f6d72e43eaec803eea76927433706dfd5e2be73
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-03 12:05:59 +00:00
alt-odoo fd96a99eef [FIX] google_calendar: don't delete several times the same attendee
Small side effect of commit https://github.com/odoo/odoo/commit/b19dc634684aab239575b9a9e784c7420d110b7d

When deleting old attendees, we are removing the partner id associated with the email
from the partner_ids set on the event.

As the same partner can be set on more than one event, we need to loop only once
on each attendee email, otherwise we will face the error "Record does not exist
or has been deleted."

Also, when deleting partner_ids on an event, the attendee is already automatically
removed as well in _attendees_values method, there is no need to do it manually, as
it will raise the error a second time.

opw-2694428
opw-2695915

closes odoo/odoo#80828

X-original-commit: 766a1ad50a9dbc85ed2f9083f881781b7d5ec96c
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
2021-12-03 11:18:53 +00:00
Samuel Degueldre 7b3b421c4d [FIX] web: rerender MainComponentsContainer on main component error
Previously, when a main component errored during rendering, we would
remove it from the list of main components that should be rendered by
the MainComponentsContainer to avoid it erroring again on a subsequent
rendering (which can cause infinite error loops).

Unfortunately, since we did not rerender the MainComponentsContainer
after this removal, the erroring main component would remain, and could
cause such error loops anyway. This commit fixes that.

closes odoo/odoo#80822

X-original-commit: 0a2fa98086dfdaa36b01ca8ef3e22b8b8ffef60c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-03 09:44:04 +00:00
Merlin (megu) 711780944a [FIX] hr_expense: use contact bank account for employee expense
Steps to reproduce:
1. Install the Expenses and Contacts Apps
2. Go to the Contacts App
3. Add a bank account to the private address linked to a specific employee
4. Go to the Expenses App
5. Create an expense for the employee and try to register the payment
6. The bank account will not show up

Solution:
If the employee doesn't have a bank account selected in the Employee form, we select the first bank account of his private address

OPW-2655450

closes odoo/odoo#80774

X-original-commit: cb998c804a0e7b14393637f372f1f32051fd548d
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-12-03 09:43:54 +00:00
Laurent Smet 9f8b70aa68 [FIX] account: Fix wrong filter on partner banks
closes odoo/odoo#80811

Forward-port-of: https://github.com/odoo/odoo/pull/80771
X-original-commit: bd24fbbe1d16280b014caadc5c65fddb5f10112c
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-03 08:55:50 +00:00
Christophe Monniez 9e41603743 [FIX] tests: fix race condition when spawning chrome
When Chrome is spawned, the `DevToolsActivePort`file is awaited to read
the port. Sometimes the file is read but is still empty, resulting in a
ValueError when trying to cast into integer. This happens when Chrome
did not have time yet to write into file.

With this commit, we expect the file to contain at least 5 bytes which
is enough to contain the max port number.

closes odoo/odoo#80791

X-original-commit: aab53fbb4e02461e0f23cf202d393e30a73fbc92
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-12-03 08:55:46 +00:00
sofiagvaladze 3018a91eaa [FIX] hr_recruitment: correct smart button display info
It is more intuitive that application_count smartbutton has
the label 'x Other applications'.

task - 2695252

closes odoo/odoo#80551

X-original-commit: f1a2f51fec0a31b80a20c78a5b3d11561dce7164
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-03 08:55:43 +00:00
Florent de Labarre b88e1ee3a3 [FIX] l10n_fr: add missing line 20 for TVA EU
According to https://www.impots.gouv.fr/portail/files/formulaires/3310-ca3-sd/2018/3310-ca3-sd_2076.pdf, for TVA EU you should also add the value of the tax in the line 20.

closes odoo/odoo#80818

X-original-commit: 8406e25ff20224f9d169233d39d2cdf6f85c5507
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-12-03 08:11:50 +00:00