Commit Graph
146212 Commits
Author SHA1 Message Date
Kartik Chavda e62320f0c6 [FIX] project: fix copy functionality of project
Purpose of this commit to do not copy progress of the project
update when coping project.

So, In this commit make last_update_id field copy false
so default progress of the project update will be 0%.

task-2664773

closes odoo/odoo#79283

X-original-commit: 69dab41858ea737929591123e85f2f982f58589c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-02 15:06:57 +00:00
Jérôme Vanhaudenard d85c34e453 [FIX] l10n_fr_pos_cert: Ensure country set on company before opening POS
Before this fix, if the country is not set on the company
the loading of the session may stall at some point.

A check is added and will prevent to start a session if the country
is not set.

opw-2557989

closes odoo/odoo#79276

X-original-commit: 8c325324c0f476d77fec79cba0570b025114fc88
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2021-11-02 14:17:47 +00:00
Hubert Van de Walle (huvw) 706d2f01ae [FIX] web: basic_renderer: delay destroy after render when rerendering widget
Steps to follow

  Edit the account.move view (with studio for example)
  Set the lines readonly property to [["partner_id","=",False]]
  Create a new move
  Add a partner
  Add a product
  Remove the partner
  -> A traceback appears: widget.$el is undefined

Cause of the issue

  widget.$el is used after the widget has been destroyed

The fix was already present in 14.0 (3fd7b2009e)
but we still need to keep the test

opw-2557142

closes odoo/odoo#79261

X-original-commit: 71e6d7e510ff9d44fe8deb16f29d50b021709074
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2021-11-02 13:11:34 +00:00
Nasreddin Boulif (bon) c860a41706 [FIX] website_sale: search in website_description instead of description
Steps to reproduce :

  - Install E-commerce module
  - Go to Website -> Products -> Products
  - Edit product `Acoustic Bloc Screens`
  - Type "my product" in Internal Notes an save
  - Go to the Shop
  - In the search bar, type "my product"

Issue :

  `Acoustic Bloc Screens` is in the search results list

Cause :

  An 'ilike' for 'description' is added to the domain.

Solution :

  Replace 'description' by 'website_description' field in the domain.

opw-2649754

closes odoo/odoo#79004

Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2021-11-02 11:29:42 +00:00
Michael (mcm) df72d187e1 [IMP] web: add "unique" array utility function
This commit adds "unique" array utility function which
returns a copy of the given array but without any duplicates.

closes odoo/odoo#76472

Related: odoo/enterprise#20833
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-11-02 10:45:15 +00:00
Michael (mcm) 13686e0e19 [IMP] web: http service in webclient test helper
Before this commit, `setupWebClientServiceRegistry` didn't use
http service but some tests need it.

Part-of: odoo/odoo#76472
2021-11-02 10:45:15 +00:00
Michael (mcm) 5fef288cdb [IMP] web: tooling: whitelist web_map
Part-of: odoo/odoo#76472
2021-11-02 10:45:15 +00:00
Michael (mcm) d1c8a565ab [IMP] web: add pager to new framework
Before this commit, Pager was not implemented in the new framework.

Part-of: odoo/odoo#76472
2021-11-02 10:45:14 +00:00
Michael (mcm) 3ef8083dcb [FIX] web: autofocus conditional element
Before this commit, useAutofocus hook used the effect dependency
to check if the target is in dom but this dependency is computed
in onWillPatch and can be outdated when checking it in onPatched.

Now, the target isn't a dependency anymore and is computed just
before the check.

Part-of: odoo/odoo#76472
2021-11-02 10:45:14 +00:00
Florent de Labarre 2997249ff0 [FIX] point_of_sale: impossible to close session
- Open session with cash control
- Set 300 €
- Close session
- Add Cash 50€
- Close session
- Set end Cash at 350 €

--> It raise an error

closes odoo/odoo#79240

X-original-commit: 3be9a02b8824356d97d442b64f2cbd66085254ea
Signed-off-by: Masereel Pierre <pim@odoo.com>
2021-11-02 09:58:58 +00:00
qsm-odoo 41d9546061 [FIX] web_editor: add perf. optimization when toggling editor options
This allows to avoid tens of thousands of instructions being done at
each click in the editor.

At multiple places, the editor is asked to close all its widgets (for
example, when clicking on another snippet to edit). The original cost
of that action was to remove a class on each widget, which is a very
primitive action. But in the end we had to do more to close a widget: we
trigger_up an event and ask to close all sub widgets. When we ask the
editor to close all widgets... it makes sense not letting every sub
button of every select trigger_up an event.

closes odoo/odoo#79220

X-original-commit: 7aaf0e17f9c3d4e78b975dbd3747513d186ccc1e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-11-02 09:58:51 +00:00
roen-odoo 1281b5be2a [FIX] stock : Missleading help message
WO are released in confirmed state, but the help message says that they are released in draft.

opw-2609040

closes odoo/odoo#78954

X-original-commit: 3244944d0b6ccf7d18d8bb852183d14282674097
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-11-02 09:12:45 +00:00
Kartik Chavda d2b6304a32 [IMP] hr_timesheet: improve generic usage
Purpose of this commit to improve ux for timesheet app.

So, In this commit done following changes:

- make name field of account.analytic.line model translatable
  by user.
- changes in report of timesheet:
  - make generic table templete for timesheet.
  - changes label for employee_id field column 'responsible'
    into 'employee' and unit_amount field column
    'time spent (hours)' into 'hours spent' and
    'time spent (days)' into 'days spent'.
  - move name(description) field column right of the task
    column.
  - add timesheet entry report for project.
- change internal project name when user has access to
  multiple companies.

TaskId-2604773

closes odoo/odoo#75141

Related: odoo/enterprise#20242
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-02 08:29:35 +00:00
Nicolas Lempereur 0c5974dff0 [FIX] mail: progress bar if from parameters
If there was parameters in the from clause, there was a possible error
when reading progress bar for activities.

eg. grouping product.product by "Routes" raise an error because we have
in FORM clause like:

    FROM … ON … AND "product_template__route_ids"."route_id" IN
    (SELECT … WHERE … OR ("stock_location_route"."company_id" in %s))

so when we add timezone to parameters, it should be after FROM clause
parameters and before WHERE clause parameters.

opw-2674179

closes odoo/odoo#78867

X-original-commit: 904d0aab204b0ce40d7bc284086c33cbde6f06d8
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-02 07:40:59 +00:00
Olivier Dony 3cbc0915bb [FIX] web: expect explicit sign up parameters
Using an explicit list of sign up parameters will avoid
polluting the context with unrelated values, and make
debugging easier.
2021-10-02 15:04:53 +02:00
Martin Trigaux 8ae1a43663 [FIX] base: correct evaluation context for report rendering
Fix of 57665a02f7b4 which was problematic in point_of_sale
2021-01-19 11:09:41 +01:00
Sébastien Theys 94d9a31018 [FIX] mail: fixup of 8af59b95b477b
task-2388659
2021-08-26 15:40:31 +02:00
qsm-odoo 95ca988113 [FIX] website: fix video loading
task-2376327
2021-07-16 11:26:38 +02:00
Adrian Torres ed6595ed15 [FIX] base: prevent messing up existing registry 2021-04-08 08:20:03 +02:00
Christophe Simonis b81850a123 [IMP] core: large object support 2021-04-20 11:40:02 +02:00
Xavier Morel b51b094c2b [IMP] http: avoid cycle on request 2021-01-26 09:05:35 +01:00
Yannick Tivisse a7e99e261f [FIX] ir_demo.py: Force admin access to load demo data
Only admin users should be able to load demo data, if needed.

This is only possible from the settings dashboard, and thus,
the method could be decorated.

See: c002e2eb37
2021-09-20 13:01:55 +02:00
luvi 8e09f540d0 [IMP] web: clamp util and touch event helper
This commit adds touch events helper for tests and new util used
to constrain a number between two values. The purpose of
the commit is to introduce the ActionSwiper component using those
functionnalities.

closes odoo/odoo#78426

Related: odoo/enterprise#21712
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 17:20:06 +00:00
Anh Thao Pham (pta) 5e3f143f1c [FIX] web_editor: prevent editing document in iframe with cross-origin access issue
- Go to Email Marketing
- Create a new mailing with template having social media links
- Save
- Click on one of the social links
An error is triggered:
"Error: Blocked a frame with origin xxx from accessing a cross-origin frame."

The traceback occurs because we try to change the content of something we
don't have access to, as these sites prevent display in an iframe.

opw-2599540

closes odoo/odoo#79208

X-original-commit: 9702e541f27616a5249a140878d028335a0b3775
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-10-29 16:05:30 +00:00
Didier (did) 1afcc9c368 [IMP] bus, mail, *: improve longpolling bus notification format
* = auth_signup, calendar, im_livechat, snailmail_account, survey, test_mail,
    web_editor, website_crm_iap_reveal, website_livechat

The aim of this PR is to improve/fix various flaws and limitation of the current
API, to make it easier to use and more efficient.

Notification are now defined with 3 distinct parts:

- the channel determines which client(s) should receive it
- the type determines how it should be handled
- the payload determines any extra information helpful for handling it

Channel
=======

Business code
-------------

- Record channel is introduced for ease of subscribing to and sending
  notifications to specific partners, channels, documents, ...
- String channel is still supported (but it is converted internally to the tuple
  channel).
- Tuple channel is still supported without any change (but should be avoided
  whenever possible due to its complex syntax).

The channel is no longer sent to the client. When the channel was used for
business purpose, the information it contained has been moved into either the
new type, or the payload itself.

Technical note
--------------

All channels are now internally converted to the tuple (db, ...) channel, which
is necessary for the platform code (saas/sh).

Internally, the bus.bus table is not changed, type and payload are grouped
together into what was (and still is) called message.

Type
====

Type is introduced to uniformize the way notifications are sent and handled.
All existing notifications already had some kind of manually-built type in them.
This is now officially supported at the bus API.

In client code this will allow (to be done in future commits) to register one
handler per specific type, instead of having to iterate and to filter all
received notifications on every handler.

Payload
=======

Payload (ex message) did not change, it can still be anything depending on
business needs.

Few adaptations:
- When the type was included on the payload, the type has been moved to the new
  type parameter.
- When the channel was used in business code, its data has been copied into the
  payload.

task-1891151

closes odoo/odoo#79201

X-original-commit: 543af27c7d6836ffac9e80ff8490b6ddbd849221
Related: odoo/enterprise#21998
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 16:05:23 +00:00
Paolo (pgi) fe7ed6627d [FIX] base: invalid UNIQUE constraint just warn
When a submodule overrides an old UNIQUE constraint with a new one,
records in that module may respect the new one and not the old one.
As the old module is updated, it would fail giving an ERROR message,
and therefore blocking the Odoo.sh deployment pipeline.

i.e. website_sale (old): res_users_login_key -> ['login', 'website_id']
             base (new): res_users_login_key -> ['login']

With this patch, the error level is changed from ERROR to WARNING,
leaving Odoo.sh free to continue the build deployment, as the error
was not a blocking one.

closes odoo/odoo#79199

X-original-commit: 8ed3641f81502d3a7e9c9bb93771c6f5601a31a9
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2021-10-29 14:07:47 +00:00
Florent de Labarre d9300962c1 [REF] base: add _is_public on partner
To be use in mail, ... and prevent issue with archived partner

closes odoo/odoo#70665

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 14:07:43 +00:00
william-andre 01f85bda3a [FIX] hr_expense: bad forward port of 25ac51e01a2084afd7a4d5e9c4c87a50ea787b93
The field `payment_credit_account_id` on `account.journal` has been
removed by 04522f01e6

closes odoo/odoo#79203

X-original-commit: a5e5110b9a1cc85e76cb6a29de6e3bef9658d405
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-29 13:22:49 +00:00
Florian Charlier bfde0833b3 [FIX] event_sale: Fix kanban card layout with free tickets
The larger payment status "Free Admission" replacing "Free" in #61668
made it require two lines on the attendee kanban card. The card was hence
taller, and with additional and unnecessary whitespace.

To provide a fix promptly, the approach of renaming back the payment status
to "Free" was chosen.

Task-2586017

closes odoo/odoo#79202

X-original-commit: f0dddb5324f3f13cd673e6048c67c5a38ccc222a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-29 13:22:45 +00:00
Ipsita Borisagar 706247a605 [IMP] project: private task visibility for users
PURPOSE

In project, private tasks (with no project) are visible to other users even if
they have project admin rights.

SPECIFICATION

Private tasks will not be visible to other users even if they have project admin
rights.

Task-2656512

closes odoo/odoo#78601

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-29 13:22:41 +00:00
clesgow 678bc958fa [IMP] purchase: Add purchase history for PO line
Sometimes it's difficult to track the price of a product, with the
different discounts you can obtain.
Price of products might change often and it's very practical to track
the price at the moment of the order to verify that it's in line with
what you paid in the past.

Also hides the Forecast Report button when a new line is created (and
not yet saved) as the button is disabled anyway without any feedback).
New purchase history button will also hide at creation.

Task-2658786

closes odoo/odoo#78438

Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-29 13:22:38 +00:00
Benjamin Vray f534d20674 [FIX] web_editor, *: fix active class disappearing on tabs snippet
* = website

Before this commit, the active class of the tabs snippet buttons
disappeared when leaving the edition of the buttons.

After this commit, it is no longer possible to enable link options for
the buttons of the tabs snippet and accordion snippet. Being able to
customize these buttons introduces too many bugs and is not really
necessary.

task-2656662

closes odoo/odoo#79190

X-original-commit: 7f33cdcd14ef753cc5bf823bfc1de0d2431e285a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-29 12:39:58 +00:00
Touati Djamel (otd) ec109b48ad [FIX] mrp_workorder: calculate correctly the WO scheduled end date
Steps to reproduce the bug:
- install mrp_workorder
- Create a new work center which will work every day from 8:00-9:00
- Create a BOM with component and operation, which takes 24 minutes in your work center
- Create 4 MO for this bom
- Set manually scheduled date > 1 MO should have a different date than others, e.g:
    - 3 MO → 01/dec/2021 08:00
    - 1 MO → 02/dec/2021 08:00
- Plan the MO which has different date than others

The ```planned_end_date``` is not calculated correctly

Current behavior before PR:
MO_1 : 01/dec/2021 08:00 → 01/dec/2021 08:24
MO_2 : 01/dec/2021 08:24 → 01/dec/2021 08:48
MO_3 : 02/dec/2021 08:00 → 02/dec/2021 08:24
MO_4 : 02/dec/2021 08:24 → 02/dec/2021 08:24

Problem
The MO_4 should only last 20 minutes, while it lasts 23 hours and 48 minutes.

opw-2648065

closes odoo/odoo#79184

X-original-commit: b02cdbbe36ead262331fc74ec3039c8ded313d3d
Related: odoo/enterprise#21992
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2021-10-29 12:39:49 +00:00
Florent de Labarre a8ec7ddcb0 [FIX] mrp_subcontracting: clarify which product to specify SN
In case you use products with variants or internal references, display_name is more specific than name.

closes odoo/odoo#79191

X-original-commit: c46328315a8db2f579329a8a44c23fd4769e7d44
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-29 11:54:28 +00:00
Touati Djamel (otd) 6b8c367a16 [FIX] mrp: display a warning when archiving a used work center
If a work center is used in any routing, a warning will be displayed when it will be archived

opw-2658596

closes odoo/odoo#79185

X-original-commit: a05f4e05b9f4df88948ac3dfc1522828b63bfb64
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2021-10-29 11:54:25 +00:00
Olivier Dony dc99d15fdc [FIX] web,base: make code more defensive, cleanup
Following-up to previous commit, this one makes the
`get_translations_for_webclient()` more defensive with regards to the
absence of a `lang` key in the context, rather than relying on callers
to protect it. The rest of the logic was already fine with this.

This allows simplification of the `session_info` logic and removal of
the conditional for `translation_hash`.

Further cleanups in `session_info()`:
 - removed a duplicate calls to `session.get_context()`
 - removed duplicated resolutions of `request.session.uid`

closes odoo/odoo#79182

X-original-commit: 3eca1a2e58b8c644c0701d33d0c9d0330bdc234f
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2021-10-29 11:54:21 +00:00
Romeo Fragomeli 0cecf918a6 [FIX] auth_totp,mail,web: TOTP authentication with JSON-RPC
Since [1] and [2], the mobile app gets this error when trying to login
on v15, while it was working fine in v14 with TOTP enabled.

The 'authenticate' JSON-RPC route tries to authenticate the user and
then call `session_info()`. As no UID is defined, some methods in
`session_info()` raise an exception and an unexpected error is sent:
* `_is_public()` -> "Expected singleton: res.users()"
* `get_web_translations_hash()` -> "lang"

In this fix, this exception is avoided and the proper result is sent,
allowing the authentication process to continue.

Steps to reproduce:
* Try to connect to an account with TOTP on the mobile app (v15+) => BUG

Refs:
[1] odoo/odoo@80d74e7ee0
[2] odoo/odoo@401fc7efe9

X-original-commit: 65dca67ecdcc2228d90781a9f5ccd99f290ada6c
Part-of: odoo/odoo#79182
2021-10-29 11:54:21 +00:00
Louis Wicket (wil) 53a7c81276 [IMP] mail_bot: remove unused file
Remove unused file.

closes odoo/odoo#79183

X-original-commit: 65f1cacbc4c047233c807ba045f03e0c3b679cd1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 11:06:00 +00:00
yhu-odoo 9040bf33b5 [FIX] stock: avoid non-deterministic order for location
Stock.location is ordered by "complete_name" which is possible to be the
same (i.e. default production locations for different companies). This
may result non-deterministic order. Add "id" to avoid it.

closes odoo/odoo#79181

X-original-commit: 94a8ad3fae914b046064bb7ce17572be8280f6e0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-10-29 11:05:56 +00:00
jbw 5ab17ff395 [FIX] account,purchase,sale: fix typo and test for accrued orders
- Fix typo in accrued_orders.py
- Remove fields.Date.today() from purchase test
- Make more use of common resources

closes odoo/odoo#79159

X-original-commit: 31570e185dcb36145e28e42cda765284dc373294
Signed-off-by: Laurent Smet <las@openerp.com>
2021-10-29 08:43:31 +00:00
Dharmraj Jhala deba81203a [FIX] crm: set 'date_closed' while marking lead as lost
When lead is won/lost, 'date_closed' field should be updated. But since
recent commit[1], this field was not updated while marking lead as lost.

It used to work prior to commit because we used to set `active` and
`probability` together from `action_set_lost` method.

But now, won and lost action are handled with `toggle_active` method.
In case of the lost leads, it first sets the `active` field to False,
and the `date_closed` is correctly updated by write method. After that,
it sets the `probability` to 0, and during that the write method sets
the `date_closed` to False.

This commit fixes the issue by updating `date_closed` field from write
method, only if the `probability` is greater than zero, and thus not
discarding the already set value.

[1] - https://github.com/odoo/odoo/commit/9b76c6b7f1eec4057289de90d62b8a7a266b0aac

TaskID-2343223

closes odoo/odoo#79154

X-original-commit: 3b9db86b76a838c0ae6cc9d517d7a29bff2c0544
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-29 07:44:53 +00:00
Thibault Delavallée f99e8c03e2 [IMP] test_mail_full: add a test model for both SMS / phone and activities
Purpose is to ease future new tests about activities management involving
phone numbers and SMS sending. Let us have a new test model with both
mail.thread.phone and mail.activity.mixin mixins. It will be used first
in enterprise to test impact of voip and documents features added in activity
models.

Task-2657021

closes odoo/odoo#77265

Related: odoo/enterprise#21200
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-29 07:44:41 +00:00
Tiffany Chang (tic) dd12194834 [FIX] mrp: allow backorder immediate production for SN product
Steps to reproduce:
1. Create Manufacturing Order with quantity >1 of Serial Tracked product
2. Press Mark done. (One Product will be immediated produced with a new
   SN auto-created)
3. Create Backorder
4. Press Mark done on the backorder

Expected Result:
Backorder will also be able to immediate produce and auto-create a new SN

Actual Result:
Usererror because env is still referring to original MO and tries to
produce the same SN again.

closes odoo/odoo#79151

Fixes: odoo/odoo#78134
X-original-commit: 58cd10eb7277312d7d6c5e9da7b52dcbdb114734
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-29 07:00:44 +00:00
Francois (fge) 6470606d65 [FIX] web: Command Menu with custom icon
Before this commit, if you create a new app with a custom icon with
studio and you open the command palette with the namespace "/", then
you will have an error message.

We have this error because the home_menu does not support custom menu
icons.

closes odoo/odoo#79158

X-original-commit: c5f5b1de07ee6b8b09ae1821c4c0debc0d09f55e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-29 06:09:07 +00:00
Aktiv Software 9e35bcf667 [FIX] account: currency symbol not displayed in Subtotal and total amount
Under account.document_tax_totals template the subtotal and total were using the float amounts for printing.

There was the formatted currency returned from _compute_tax_totals_json but not printed.
This commit uses the formatted_amount and formatted_amount_total keys to display the amount with currency on PDF and portal view.

closes #77996

closes odoo/odoo#79153

X-original-commit: a2dbc4eb40a868860a7f8448a680a9f0e2ed16f4
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-28 16:08:53 +00:00
Rémy Voet (ryv) 846647229f [IMP] core: remove dead code
closes odoo/odoo#78948

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-10-28 16:08:46 +00:00
Rémy Voet (ryv) dab23a2daf [IMP] base: improve search on many2one with string values and negative operators
Currently, the domain expression on a many2one field with
negative operator + string values leads to a extra SQL request on the
target model of the many2one which is not optimal and lead to
performance degradation.

Example:
--------
With a simple model A with a one2many (`b_id`) targeting model B (with
a field `b_name` and `_rec_name = b_name`):
The `A.search([('b_id', 'not like', 'OneName')])` will
generate two SQL requests:
- A _name_search on model B and returning ids who match
`('b_name', 'not like', 'OneName')`.
- A other on the model A with the application of the result
of the first one `('b_id', 'in', <returning ids> + [False])`.

Solution:
---------
Avoid the extra SQL request (the first one) and use subquery instead.
We do it by translate the `('b_id', 'in', <returning ids> + [False])`
expression into `['|', ('b_id', 'in', _subquery), ('b_id', '=', False)]`

task-2671476

Part-of: odoo/odoo#78948
2021-10-28 16:08:46 +00:00
Rémy Voet (ryv) d31234cc5e [IMP] base: add test for many2one domain expression with 'not like' operator
task-2671476

Part-of: odoo/odoo#78948
2021-10-28 16:08:45 +00:00
William Braeckman 3d10c7c708 [IMP] project,*: improve project UX
* = hr_timesheet, sale_project, test_main_flows

Smaller changes:
 - Projects created on the fly (through `name_create`) will now come with a
   default `new` stage in order for them to not be empty.
 - Removed task auto assign upon creation besides in FSM's 'My tasks' menu.
 - Allow the reordering of projects without needing to group by
   anything.
 - Make `project.task`.`description` and `project.tags`.`name`
   translatable.
 - Disable the creation of records in the view when clicking on `Tasks
   in recurrence` stat button.
 - Track the planned date of the task in the chatter
 - Disable the creation of records in the view when clicking on
   'invoices' stat button and add the kanban view to that action.
 - Make milestones completely available to regular project users.
 - Remove the 'Documents' button in the project's kanban settings menu.
 - Add kanban, pivot and graph views to the 'Hours Recorded' stat button
   on projects
 - Add the calendar view on the 'Hours Forecast' stat button on projects
 - The 'Sales Orders' stat button on the `project.project`'s form view
   will now display the amount of sales order linked to the whole
   project. So the one linked to the project itself if it exists + all
   the tasks. It will also open them, form view if 1 else list view.
 - Fix a typo in the settings 'projets' => 'projects'
 - The analytic account  of the project will now be assigned to the
   sales order when a task is created through the 'Create a task in an
   existing project' option.

Changed the portal task view to include a sidebar similar to sales
orders, with a simple menu leading to different parts of the screen.

Changed the `project.task` 'rating' stat button:
 - The icon will now represent the latest review.
 - The action will directly lead to the record's form view if there is
   only 1 rating.
 - Make some fields readonly in the form view.
 - Display the % of satisfaction instead of the number of ratings.

Reorder all stat buttons on the `project.task` form view in this order:
 - Products, Worksheet, Sales Order(s), Invoices, Ratings, Hours
   Forecast, Parent Task, Tasks in recurrence, Tickets, Quotations and
   lastly Customer Preview

Make the status of the project editable directly through the kanban
view. A new widget has been added to handle that properly. When editing
the status through that means, a `project.update` will be created with
the current date and the appropriate status. In addition to that a new
status has been added (only on `project.task`, not `project.status`)
namely `to_define` in order to differentiate new and running projects.
Projects now start with the `to_define` status.

The `project.project`'s  rating stat button has been changed in the
following ways:
 - The icon will now change in function of the satisfaction percentage,
   smile above 66%, meh between 33% and 66% and frown below 33%.
 - The color will also change depending on the rate, smile is green, meh
   is orange and frown is red.
 - The ratings will now be in function of the last 30 days instead of
   all time and the action will also filter on those 30 days.
 - Change the action name from 'Rating' to 'Ratings'.

`project.project` ticket stat button:
 - Will now open the form view when there is only one record.
 - Added the activity view.
 - Disable the creation of new records.
 - Rename the action to 'Tickets'.

Closes: odoo/odoo#75269

See: odoo/enterprise#20334

Task ID: 2611006

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-28 15:27:36 +00:00
William Braeckman 32ba417549 [IMP] rating: add satisfaction percentage to rating.mixin
Adds the satisfaction percentage as an optional compute to
`rating.mixin`.

Closes: odoo/odoo#75269

See: odoo/enterprise#20334

Task ID: 2611006
2021-10-28 15:27:36 +00:00