Commit Graph
148804 Commits
Author SHA1 Message Date
Vincent Schippefilt a5e21abdf5 [ADD] models: adds a test for read_group date:agg group
Adds a test that verifies that the grouping with a date aggregate
specifier (the only group specifier supported until now) is working correctly

Part-of: odoo/odoo#84908
2022-03-02 17:10:47 +00:00
Vincent Schippefilt 209249dcec [REF] base: modernize read_group tests
reshape a bit the read_group tests by ensuring that:
- creation of user is made in batch
- assertions are always assert(actual, expected)

Part-of: odoo/odoo#84908
2022-03-02 17:10:46 +00:00
Géry Debongnie 8c266b24c9 [IMP] web: update owl to last version
closes odoo/odoo#85671

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-02 15:18:52 +00:00
Michael de Villiers 07c45ed7bd [CLA] added cla for systemworks
closes odoo/odoo#85621

X-original-commit: de99a2a41a6bf3b88bff5911c5fa5a0816ec3898
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-03-02 13:06:10 +00:00
Michael de Villiers e2ac705dce [FIX] stock_landed_cost: reconcillation with partial/zero journal items
If a landed cost is validated for an invoice where items either have 1)
a zero value, or 2) have been partially reconciled multiple times until
it is fully reconciled, validation will fail with a cannot reconcile
error because they are already reconciled.

The fix is to use the `reconcilled` attribute rather than checking for
existence of `full_reconcile_id`.

X-original-commit: 608ed487b61c81e38a5d0b856732a8b94c6df64a
Part-of: odoo/odoo#85621
2022-03-02 13:06:10 +00:00
Aaron Bohy d40e0e8242 [FIX] web: FieldBoolean causing non deterministic issues
The FieldWrapper and the owl compatibility layer aren't bullet
proof. They allowed us to write new fields in Owl and use them
below legacy views, but in some tricky situations they can produce
undesirable race conditions. In particular, the FieldBooleanOwl
sometimes produces a crash in tours, making runbot builds fail
randomly.

This commit makes a special case for "boolean" when determining
which field widget/component to use: we always take the legacy
FieldBoolean, s.t. the FieldBooleanOwl is no longer used in
views. This is obviously not the perfect solution, but those
issues are really hard to reproduce in practice (it's rather
a concern for tour tests). Moreover, that FieldWrapper/compatibiliy
layer architecture is about to be removed anyway, as we are
rewritting everything with a top-down approach, including views
and fields.

Runbot build errors: 2158 3232

closes odoo/odoo#85573

X-original-commit: f74f81543c1d899dbb0dc201d26a460fb8ae61ac
Related: odoo/enterprise#24869
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-02 13:06:03 +00:00
Aaron Bohy a451596ba4 [FIX] web: tip: do not call delegateEvents if no $el
According to [1], the update function can be called before the tip
is rendered (i.e. when this.$el is null). [1] aimed at preventing
that function to crash when called in that situation. However, if
the function _delegateEvents is called and this.$el is null, it
crashes as well. This was a cause of non deterministic runbot
failure.

[1] a34cd7c662

Runbot build error: 3382

X-original-commit: 66dd147eb6d0aab10bf4d8883fa4965b76f55de8
Part-of: odoo/odoo#85573
2022-03-02 13:06:02 +00:00
FrancoisGe 87323e36e0 [FIX] web_tour: make tour manager more robust
Before this commit, it could happen that the trigger element of a
step was in the DOM at time t0, but was no longer in the DOM at
time t1, when we tried to actually execute the step, because of a
non zero running_step_delay. This commit checks again the presence
of the trigger in the DOM at t1, and if it isn't resets the step.

The same reasonning applies to the ui blocked check: we never want
to run a step if the ui is blocked.

X-original-commit: 119d509feb2cb93c648160af2848146e9c623e21
Part-of: odoo/odoo#85573
2022-03-02 13:06:02 +00:00
Jorge Pinna Puissant cac3ba62e5 [IMP] test_lint, *: add caughtErrors option to no-unused-vars
All named arguments on the catch block must be used. If for some motive
the named argument on the catch block is not used, its name must begin
with '_'.

closes odoo/odoo#85569

Related: odoo/enterprise#24867
Related: odoo/design-themes#552
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-03-02 13:05:42 +00:00
Jorge Pinna Puissant bc20eb4790 [IMP] test_lint, *: enable no-unused-vars rule
Part-of: odoo/odoo#85569
2022-03-02 13:05:42 +00:00
Jorge Pinna Puissant 19e775b3cc [IMP] web: add the new test_lint eslint rules to the tooling
Part-of: odoo/odoo#85569
2022-03-02 13:05:42 +00:00
Jorge Pinna Puissant 8cf6643c7b [IMP] test_lint: don't check generated code
Part-of: odoo/odoo#85569
2022-03-02 13:05:41 +00:00
Benoit SociasandRomain Derie 5d5d5d75d5 [IMP] website: facilitate searching for industries in the configurator
Before this commit the industries were only matched on starting with or
containing the searched term and the autocompletion results were shown
alphabetically.

After this commit the industries are also matched if they contain all
individual search terms.
All terms are matched against the label and each synonym (if any exists),
but the industry is only displayed once, with its label.
If there are 7 results or less, the results are alphabetically sorted on
the label, otherwise the IAP result order is kept (which is expected to
be by descending cross-theme total hit count).
The truncation of the matching list to 15 results gives higher priority
to labels with the least words (so that "restaurant" still appears even
if there are 15 more common sub-types).

task-2688878

closes odoo/odoo#82018

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
2022-03-02 13:05:19 +00:00
Arnold Moyaux 0b58de8a58 [FIX] stock: reserved move base on the schedule date
Usecase to reproduce:
- 2 product A in stock
- Deliver 1 the 1/1/2022
- Deliver 1 the 4/1/2022
- Deliver 1 the 2/1/2022

Current behavior:
Check Availability the 3 pickings at once. The 2 first are reserve

Expected behavior:
The picking for 1/1/2022 and 2/1/2022 are reserve

It happens because the sorted is only done on date deadline

opw-2762223

closes odoo/odoo#85584

X-original-commit: fb3b261ef56a62e2c753191313682287aa3a12fb
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-03-02 11:23:41 +00:00
Pierre-Yves Dufays 2faefd4757 [IMP] website_event[_questions]: allow setting event questions as mandatory
Purpose:

Allow users to make sure they will get an answer to the questions they ask
attendees while they register.
e.g.:
- You organize activities for kids and want to make sure you have a second
phone number available in case of emergencies
- You organize B2B events and need to know in which industry your attendees
work
- You use the Event/CRM bridge and plan to filter attendees based on those
answers
...

Specifications:

In the question form view, a boolean "Mandatory Answer" has been added.

In the list view, that field has been added as column.

In the registration form:
- "*", next to each mandatory question has been added
- "*" has been added next to name and email which were already mandatory
- the mandatory question have been actually made mandatory by preventing
user to submit empty answer

Remark: once_per_order was missing in the list view of the event template
questions. We have added it as well as "mandatory answer" field. The
question list view of the template and the event are now almost identical
(the button to the stat is obviously not present in the template).

Technical remarks:
- To ensures that multiple choice answer are filled by the users, we have
added an empty choice selected by default which forces the user to choose
one option.
- Empty answer were already filtered by the server and not inserted in the
database (in controller method _process_attendees_form, value evaluated
to false are not inserted)

Task-2745835

closes odoo/odoo#83586

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-03-02 10:00:50 +00:00
Nicolas Bayet 923a92a0bb [FIX] web_editor: only include website commands in website
task-2696972

closes odoo/odoo#85628

X-original-commit: c1ff3260a8e09ba4af3ad44138d44d4457c7c689
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-02 08:36:10 +00:00
Nicolas Bayet 1b4a390b73 [FIX] web_editor: select checklist when language is rtl
task-2734731

closes odoo/odoo#85627

X-original-commit: 0a236b11e770b6a8db5192685a2c36ce1e303399
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-02 08:36:06 +00:00
Florian Damhaut 268025dccc [FIX] hr_holidays: HR leave only approvable by time off officer
Step to reproduce:
- Create a time off type T with approval 'time off officer'
- As user U create a time off request of type T
- Login as the manager of U (which should not be a time off
 officer)
- Approve the time off of U

Current Behaviour:
- Time off is approved

Behaviour after PR:
- Time off is not approved and an error is raised

opw-2753845

closes odoo/odoo#85622

X-original-commit: 8a0564369baf9de7797a58ab0cd5cae870b910cf
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2022-03-02 07:20:51 +00:00
roen-odoo 0ab9cf3fa0 [FIX] pos_coupon: Coupons code disappear when switching table
Current behavior:
When adding a coupon with a code in a PoS (restaurant/bar) if you switch table and come back to the first table the coupon code is disappearing

Steps to reproduce:
- Activate promo code for a PoS (restaurant/bar)
- Go on table A, add some product and enter a code for the order
- Leave table, and come back to table A
- The promo code has dissapeared

note: A better fix could be done on master adding bookedCouponCode on order field to save it between the table switching.

opw-2733081

closes odoo/odoo#85524

X-original-commit: bdc4895226374932a92a543ff25ea1a41d5a4ce8
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-03-02 06:28:47 +00:00
clesgow 49f61225ff [FIX] purchase_stock: Apply po_lead only to buy orderpoints
Changes made in #78199 would remove the Purchase Security Lead Time from
any orderpoint as long as the 'purchase_stock' module was installed,
whether the orderpoint was related to purchase or not.

Task-2721378

closes odoo/odoo#85594

X-original-commit: 3bd9b7a77a1e0e05ea479945d5cd8085f6981feb
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2022-03-01 17:25:31 +00:00
Laurent Stukkens (LTU) b42359bd5f [IMP] project: improve cyclic dependencies validation error message
task-2710808

closes odoo/odoo#85395

Related: odoo/enterprise#23370
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-03-01 17:25:22 +00:00
William Braeckman 96bc5b3c67 [IMP] hr: add new ways to filter and search on employees
Makes it possible to filter on My Team or My Department and search on
manager.

TaskId-2780061

closes odoo/odoo#85418

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-03-01 16:32:37 +00:00
Umesh Gupta 061cb6885f [IMP] mass_mailing: add import template for mailing contacts
Currently when user starts using the app and tries to 'import records' from
'Mailing List Contacts', there is no templates available to assist the user.

This commit adds import template for mailing contacts to assist the users
in importing records.

taskID-2763984

closes odoo/odoo#84804

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-01 16:32:33 +00:00
Adrien Dieudonne 4e1e762c53 [IMP] web: move BS5 utility classes in a dedicated file
Waiting the complete migration, some classes needs to be available to already
migrates xml files.

This file will be deleted once we're done.

closes odoo/odoo#85586

Task-id: 2704984
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-03-01 13:46:50 +00:00
Adrien Widart 4a770c8bbe [IMP] stock: merge quants after unpacking
When unpacking a package, the quants are not merged

To reproduce the issue:
1. In Settings, enable "Delivery Packages"
2. Create a storable product P
3. Update its quantity: 5
4. Create a planned receipt R with 10 x P
5. Mark R as Todo
6. Put the 10 x P in pack (PK)
7. Validate R
8. Unpack PK
9. Consult the on-hand quantity of P

The use case is already fixed thanks to:
5e08aa3def
This commit only adds the associated test

OPW-2713407

closes odoo/odoo#85575

X-original-commit: 76400ba0f6c2c15d9478b762a0a393129cd20f5e
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-03-01 12:49:18 +00:00
Raphael Collet 15215d650a [FIX] core: check rules before flush() in unlink()
Just before deleting records, we mark fields on dependent records as "to
compute", and their actual computation should happen after the records
have been deleted.  The problem is that checking security rules may
trigger the computations that have been prepared.  So we should check
security rules before marking dependent records.

closes odoo/odoo#85574

X-original-commit: 79908bc757a239c97bd2b4cda505b7b8df769325
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-03-01 10:53:51 +00:00
Yannick Tivisse 72682c22d8 [FIX] hr_attendance: Use orm cached method to improve perf
closes odoo/odoo#85557

X-original-commit: 2975c0539d8c2781ff56a9f8be8e302d45b7d80b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-03-01 10:53:48 +00:00
Victor Feyens cf6855995c [IMP] resource: batch calendar resources creation
closes odoo/odoo#85532

Related: odoo/enterprise#24843
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-03-01 10:53:43 +00:00
Michael (mcm) b81861233d [REF] *: use LegacyComponent
This commit replaces Component by LegacyComponent when the component
uses removed features from owl 1 like getting its `el` or `trigger` an event.
It also adds `useService("rpc")` when component needs it.

closes odoo/odoo#85389

Related: odoo/enterprise#24745
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-03-01 09:57:39 +00:00
Michael (mcm) b133f93213 [REF] mail, im_livechat: use LegacyComponent
This commit replaces Component by LegacyComponent when the component
uses removed features from owl 1 like getting its `el` or `trigger` an event.

Part-of: odoo/odoo#85389
2022-03-01 09:57:39 +00:00
Michael (mcm) 4dc2b2e539 [REF] web: use LegacyComponent
This commit replaces Component by LegacyComponent when the component
uses removed features from owl 1 like getting its `el` or `trigger` an event.
Some tests are updated to have less LegacyComponent.

Part-of: odoo/odoo#85389
2022-03-01 09:57:39 +00:00
Michael (mcm) d6946775a2 [IMP] web: introduce LegacyComponent
This commit introduces LegacyComponent and removes patches on Component.
LegacyComponent is used instead of Component when the component
uses features from owl 1 like getting its `el` or `trigger` an event.

Part-of: odoo/odoo#85389
2022-03-01 09:57:39 +00:00
Audric Onockx (auon) 138d881cd9 [FIX] hr_timesheet : display archived employee on timesheet
Steps :
Archive your employee, go to your timesheets and add time on a task T line
Go to task T and note that a line have been added without any employe

Cause :
By default, views do not show archived values.

Fix :
Show archived employees with context key 'test_active=False'.

opw-2740228

closes odoo/odoo#85563

X-original-commit: 071d58fe01debf9f5c0e86e5f42eada2061fe40f
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-03-01 08:07:06 +00:00
Thibault Libioulle 38b3fe7e51 [FIX] payment_stripe: fix base url for webhook url
This commit fixes the webhook base url to use the override defined in
the payment acquirer model.

It ensures the base url follows the same logic as the success and cancel
urls defined in the `checkout/sessions` request payload.

closes odoo/odoo#85558

X-original-commit: d3f4619b731d71ccd2af26b9fa148d2957773680
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Thibault Libioulle (tle) <tle@odoo.com>
2022-03-01 08:06:55 +00:00
std-odoo 4da710f860 [FIX] mass_mailing: empty alert message on the mailing form view
Bug
===
When sending a mailing (with a valid outgoing mail server), during the
"sending" stage, the blue alert div is visible but empty.

The reason for that the scheduled count is only visible when the
mailing is in "in queue" state (and in this state the alert should
always be visible to display "Mailing scheduled for ...".

Task-2746886

closes odoo/odoo#85545

X-original-commit: 02285dbde93ac8e710a569aa0018acbae4728d9e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-01 08:06:51 +00:00
Audric Onockx (auon) 43196c9ec0 [FIX] project : keep one task as model for recurrence
Steps :
Create a recurrent task.
Delete it.
Run the cron "Create Recurring Tasks".

Issue :
IndexError: tuple index out of range.

Cause :
The cron calls a method which takes the last task of the recurrence
as a model. As there is no such task, an python error is thrown.

Fix :
Do not display the "Continue Recurrence" button when deleting the last
task of it.

opw-2743788

closes odoo/odoo#85176

X-original-commit: 4f143131a1722e87b7dbb6b54a76b81ce2ba40cd
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-03-01 08:06:44 +00:00
Florian Damhaut ab940a921e [FIX] product: packaging correctly chosen
Step to reproduce:
- create a unit of measurement (UoM) and set it's rounding to 1.000
- create a product that uses this UoM
- create two packaging for this product
- create a sales order and in the sales order line set the created product
- you can already see the packaging is set, but anyways set a quantity to near the defined in the package
- the quantity will be updated

Current behaviour:
- Packaging always update to bigger package even if it doesn't fit

Behaviour after PR:
- Packaging update to the biggest package which is a full divider of the qty
- If no package fit, then no package are applied

opw-2718146

closes odoo/odoo#85351

X-original-commit: ad047434a802abfc9f4203897aec9cda149dd43b
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2022-03-01 07:15:18 +00:00
Josse Colpaert 54dea0d81a [FIX] l10n_it_edi_sdicoop: fix access rights so demo user can send invoices
As the proxy client user can only be accessed by base.group_system,
we need a sudo() to make it possible for a regular user to send
invoices.

closes odoo/odoo#85566

X-original-commit: 79a076b832a785b78ed6d73d539d3eae6eb2fd02
Signed-off-by: William André (wan) <wan@odoo.com>
2022-03-01 03:23:05 +00:00
abderraouf f87d0d5226 [IMP] project : Add project Tree view, improve some wordings and hide uom conversion when default and selected are the same
Before this commit, In the product form, when the selected uom is Hours and as Hours is the default uom, we display this conversion (1.0 Hours = 1.0 Hours) which is useless
Before this commit, Kanban is the only view available for projects. With this view, we can't select a batch of projects and display optional fields
Before this commit, Some wordings didn't have a significant meaning.

This commit hides uom conversion when selected and default uom are the same.
This commit adds the projects tree view.
This commit improves some wordings according to what was mentionned in the task.

task-2724965

closes odoo/odoo#82135

Related: odoo/enterprise#23206
Related: odoo/upgrade#3207
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-28 20:23:53 +00:00
Florent de Labarre ff018c674e [FIX] sale: button are executed with active_test = False
Partial Rev of https://github.com/odoo/odoo/pull/83669/commits/75979217d23a47e8484f95e3ee4721e501edfd10

Open a contact
Click on sale
Create an order
Click Confirm

--> active_test = False is in the context

closes odoo/odoo#85533

X-original-commit: 4235d4b96cf8f4c10bbbf24f104a555638109f56
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2022-02-28 19:35:38 +00:00
Kartik Chavda d4e327fa80 [FIX] hr_timesheet: fix timesheet description required in mobile
Currently, when user enter the timsheet in editable tree from the
task form view the description is not required and if keep empty then
it will add the '/' as default description but in the mobile form view
of the timesheet description is still required.

so in this commit, make description non required in timesheet form
view of mobile.

task-2740041

closes odoo/odoo#85460

X-original-commit: 1c82a66cf975203b6a44f23c6a866c1d7b4637ed
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-28 19:35:28 +00:00
Yannick Tivisse 2adba30ef2 [IMP] hr_gamification: Improve _compute_employee_badges perf
From 20ms to 0.3ms

closes odoo/odoo#85133

Related: odoo/enterprise#24628
Related: odoo/upgrade#3294
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-28 17:27:08 +00:00
Yannick Tivisse 9da4639b49 [IMP] hr_org_chart: Improve perf
From 300 to 100ms

Part-of: odoo/odoo#85133
2022-02-28 17:27:08 +00:00
Yannick Tivisse 0ca4c838ac [IMP] base: Batch calls to exists in _visible_menu_ids
Purpose
=======

Make 1 call per model (3-4 max) instead of 1 per menu.

Part-of: odoo/odoo#85133
2022-02-28 17:27:07 +00:00
Yannick Tivisse 20f556644b [IMP] hr*: Avoid creating useless objects on salary simulations
Part-of: odoo/odoo#85133
2022-02-28 17:27:07 +00:00
Yannick Tivisse 1da5b4e802 [IMP] resource: Move test models in their own module
Purpose
=======

When creating resources, SQL request were made to this test table.

Part-of: odoo/odoo#85133
2022-02-28 17:27:07 +00:00
Yannick Tivisse 90fd30d99c [FIX] hr_timesheet: Avoid costly prefetch on field computation
Part-of: odoo/odoo#85133
2022-02-28 17:27:06 +00:00
Yannick Tivisse 36d466fea8 [FIX] hr_holidays: Avoid useless overhead on employee creation
Part-of: odoo/odoo#85133
2022-02-28 17:27:06 +00:00
Yannick Tivisse f85cc5995c [FIX] hr_holidays: Avoid useless overhead on employee creation
Part-of: odoo/odoo#85133
2022-02-28 17:27:06 +00:00
Pierre-Yves Dufays 354b9e8ed2 [IMP] web, base: export field res_partner.name by default in import-compatible
mode

Purpose:

Include the name of the partners so that:
- it can easily be updated
- it is easier for users to recognize who is who

To generalize this modification, a new attribute has been added to the model
field descriptor (odoo/fields.py): default_export_compatible.
Setting this value to True on a field of a model will force that field to be
included by default in the exportation when "import-compatible export" is
selected.

Specification:

If the user goes:
    Contacts > List view > Select Records > Action Export
	     >  I want to update data
The field name is selected by default

The fields selected by default for export are the columns of the list so that
what is exported by default is what the user sees on the screen.
The display name is one of the column but is not importable.
When the option "I want to update data" is selected, only field that are
compatible for importation are selected and then display name is no longer
selected.
With this modification, the name is selected instead.

Technical:

- a new attribute "default_export_compatible" has been added in odoo/fields
- the controller /web/export/get_fields that lists the fields available
for exportation has been modified to add a default_export attribute on each
returned field. This new attribute is set to True when import_compat is True
and default_export_compatible is True on a given field.
The client uses that information to force by default the field for exportation.

Task 2734222

closes odoo/odoo#83697

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-28 16:33:50 +00:00