Commit Graph
157418 Commits
Author SHA1 Message Date
Laurent Smet c19b29a851 [FIX] account: Clean inconsistent currencies when creating statement lines
foreign_currency_id & currency_id must always be different on a statement line.
However, this happens sometimes when importing statement lines in csv.

closes odoo/odoo#109574

X-original-commit: 0b2cb4c82fa38ca1242c2344546768e481841116
Related: odoo/enterprise#35630
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-01-10 18:54:55 +01:00
Rémy Voet (ryv) 880daf6e59 [REM] base: remove useless module_nr field of ir.module.category
The last usage was an unused tree, previously removed.

closes odoo/odoo#109420

Related: odoo/enterprise#35586
Related: odoo/upgrade#4192
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-01-10 18:54:48 +01:00
Rémy Voet (ryv) 782fb61a3b [REM] base: remove useless list view of ir.module.category
The tree view `view_module_category_tree` was unused, remove it.
The form view (`view_module_category_form`) of `ir.module.category` is
still used in the `view_groups_form` view.

Part-of: odoo/odoo#109420
2023-01-10 18:54:47 +01:00
Rémy Voet (ryv) 2e2ca3dac0 [REM] base: remove useless field field_parent of ir.ui.view.
This field is useless since 905e01921f.
Remove it and all occurence of it in view records.

Part-of: odoo/odoo#109420
2023-01-10 18:54:47 +01:00
Rémy Voet (ryv) f9dc7e2698 [REM] base: remove deprecated methods of ir.ui.view
Since https://github.com/odoo/odoo/pull/87522 (landed in v16),
`fields_view_get`, `_fields_view_get` and `load_views` are deprecated.
Remove it for maintenance (and it is the last usage of
the useless field `field_parent`).

Part-of: odoo/odoo#109420
2023-01-10 18:54:47 +01:00
Xavier BOL (xbo) c0c5ca4b44 [IMP] hr_timesheet: avoid select internal project in task views
Before this commit, when the user creates a task in the (quick create)
form view of task, he can select the internal project. The goal of this
project is to contain the timesheets representing the time offs of each
employee.

This commit filter the projects available for the task creation/edition
to be sure the user cannot select internal project.

closes odoo/odoo#109002

Related: odoo/enterprise#35377
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-10 18:54:40 +01:00
Odoo's Mergebot 4217f9662e [IMP] survey: improve question triggering robustness
The PR improves user experience and database consistency for triggered questions.

* Deleting questions/answers used in triggers will clean those triggers to avoid corrupt
trigger configurations.
* Questions and Survey are saved during edition allowing to add questions with score,
  validation parameters (checked against SQL constraints), and triggers on the fly
 without having to save the survey and reenter edit mode. This required to modify the
 basic_relational_model `Record` `save` method to be able to display a notification
instead of another modal in case of `ValidationError`.
* Questions that are moved and placed before their trigger will show the icon in
`text-danger` with a warning message on hover, because other forms of feedback
would be too strong to be given when users are busy reordering.

Tests are included to ensure the specific behavior and needs of this module in case
some JS framework implementations change later on.

See details on each commit.

Task-2623482
See odoo/upgrade#3613

closes odoo/odoo#78705

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-10 18:54:29 +01:00
Florian Charlier b1d1856245 [IMP] survey, web: enable chaining question creation
## Survey
Due to the behavior of X2Many fields, the questions created when editing
a survey were not usable immediately after creation to be conditional
triggers for new questions. The whole survey had to be saved first, which
wasn't a smooth experience for the user.

This commit will save the survey and question at several times:

### For each new question added

Similarly to what was implemented for chatbot scripts, enables the
immediate computation of allowed question/answer triggers, permitting their
use when chaining question creation.

This also enables to check the answers "validation" fields immediately, and
activating scoring and add scores to question/answers without requiring the
extra steps of saving and re-entering edit mode for the survey.

### When rows are deleted

This will trigger the immediate removal of the triggers icons on
questions that were triggered by an answer to the deleted question.

### NOT when questions are moved

As there is no convenient way to ensure questions are properly ordered with
respect to their triggers (order dependency) without popping error messages
at every step when reordering questions, we chose to mark the misplaced lines,
missing trigger records or triggers that will be ignored (with the new
`trigger` widget).

This could have been done entirely with 'server' logic, but that would have
required additional saves and cleaning fields even more often, even during a
temporary reordering step, which isn't convenient.

### Misc
Finally, note the extra fields added on the question_and_page_ids field of the
survey form view, required to trigger these fields' update consistently
(required after reordering or removing records which sometimes doesn't occur
without these).

Tests ensuring the behavior of the X2Many (saving parent on open/edit and show
notifications on error) and the trigger widget are included.

## web
To support the functionality described above, we need to allow the caller of
'save' to catch errors to prevent default handling (here to use a notification
instead of an additional Dialog).

Task-2623482
Part of odoo#78705

Part-of: odoo/odoo#78705
2023-01-10 18:54:28 +01:00
Florian Charlier 91b306b5db [IMP] survey: enforce question triggering consistency
Before this commit, the state of a question triggering fields could be
inconsistent/corrupted:

* If a question used as trigger for another question was deleted,
  `is_conditional` would stay `True` even as `triggering_question_id` would be
   `False`, which would eg. prevent saving the question edit form unless this
   is not manually fixed.
* If an answer used as trigger was deleted, the triggered question
  would never show on a survey session, but still appear as "triggered" and
  causing the same trouble on form edition.

In this commit, we
* update `unlink` methods to remove the triggering fields on triggering
  question/answer deletion
* add SQL constraint to ensure DB consistency (also improving the survey
cloning/copying behavior robustness)
* add a python test checking this

Task-2623482
Part of odoo#78705
See odoo/upgrade#3613

Part-of: odoo/odoo#78705
2023-01-10 18:54:27 +01:00
Florian Charlier 51b4e6d098 [IMP] survey: improve validation parameters UI and logic
Purpose: Showing validation parameters with an arrow on one line (when
possible) is prettier.

Additionally, we now
- Improve data consistency by preventing saving `validation_required` without
  setting validation parameters (also allows to keep arrow invisible when no
  value is set)
- Explicitly add required flags to float values as they cannot be not set (see
  c5ae9b38).

Task-2623482
Part of odoo#78705

Part-of: odoo/odoo#78705
2023-01-10 18:54:27 +01:00
GorashandNicolas Lempereur 772cc29218 [FIX] mail: fix create link wrong escaping of html entities
Issue: `node.data` is an unescaped text content and used as an escaped
content just after (set `innerHTML`) which remove some of the escaping.

Without the fix, the 2 new first assertions would fail:

- first one with 'https://example.com/?¤cy_id' instead of
  'https://example.com/?&amp;currency_id' in the text node

- second one with `&amp;` replaced by & and `&gt;` replaced by >

other assertions ensure that use case before the fix (special char and
URL regex, smileys, ...) still work the same after the fix.

opw-2525028

Fixes #70485

closes odoo/odoo#109357

X-original-commit: 4938af5dd8bfb4ea0722e3de8340ff6437329b48
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
2023-01-10 17:51:50 +01:00
Leonardo Pavan Rocha 7f4e00146d [FIX] calendar: fix form view email button giving traceback
After https://github.com/odoo/odoo/pull/99386, clicking on the email button in
calendar.event form view would give a traceback as it tried accessing event_id
on a calendar.event record. This commit fixes this error as the object in the
template already is an instance of calendar.event.

task-3127534

closes odoo/odoo#109549

Signed-off-by: Arnaud Joset <arj@odoo.com>
2023-01-10 16:51:03 +01:00
Thomas Lefebvre (thle) c70e410050 [FIX] web: correct type of defaultPage prop
Steps to reproduce:
- go to "Link Tracker" app;
- go to "Campaigns" tab (UTMs);
- create a new campaign;
- leave and return in this record.

Issue:
A traceback appears.
Error message:
`Invalid props for component 'Notebook': 'defaultPage' is not a string`

Cause:
The `defaultPage` prop must be a string.
When the record is new, it will be `undefined`,
so it will pass props validation because this prop is optional.
But when we try to calculate it and it does not return a value,
the `defaultPage` is null.
The variable is therefore declared but it is empty
(and therefore not a string).
`null` value does not pass the props validation test.
The problem appears in the "Campaigns" tab
because there is a notebook without content.

Solution:
Test if it is possible to have a value.
If not, set the `defaultPage` prop to be `undefined`.

opw-3109327

closes odoo/odoo#109533

X-original-commit: 402b1a822c3983af33aa1d3a3c7e93d8836c60d8
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2023-01-10 16:50:58 +01:00
Romeo Fragomeli 1171432b99 [FIX] web: allow to clear a many2one field on small screen (Mobile)
Since the rewriting of the views in OWL2, it is not possible to clear a
set many2one field.

In this commit, we restore the clear button.

Steps to reproduce:
* Go to Sales (on Mobile)
* Create a new Quotation
* Select a customer
* Try to remove the selected customer => BUG

closes odoo/odoo#109531

X-original-commit: 57cb2a34c8211352baa439ee784dc370cc6abb1b
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-01-10 16:50:55 +01:00
Viktors Lipskis (vili) 01bcdee8e4 [FIX] hr: fix some UI elements
Detailed Reason in Employee Departure wizard now has a placeholder, and an
unnecessary visual separator is removed.

task-3046435

closes odoo/odoo#108314

Related: odoo/enterprise#34288
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-10 16:50:48 +01:00
Valentin Vallaeys (vava) 306b48ed09 [FIX] sale: unable to open sale order form view
Steps to reproduce:

* Go on `res.partner` form view
* Add field `sale_order_ids` visible in the view
* Try to open one of the partner SO's by clicking on it
* Traceback, unable to read 'modifiers' on undefined

Unexpectedly, the field `order_line` is not available in the Sale Order
`activeFields` on the client side when opening the SO form view that
way, which leads to a traceback when trying to know whether that field
is readonly.

This commit makes sure the field is in the SO `activeFields` before
checking whether it is readonly.

opw-3097134

closes odoo/odoo#109541

X-original-commit: b37a2cf45e1f5b1422cd19269cd2b85085d75558
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-10 15:43:24 +01:00
Nshimiyimana Séna 1d3fbcb6e2 [FIX] l10n_gcc_invoice: translate payment terms' notes correctly
## Steps to reproduce
- install l10n_gcc_invoice module
- switch to a company in Saudi Arabia (SA company)
- create and print an invoice that has a payment term with a translated
  note

We expect the payment term's note to be displayed both in English and
Arabic. But instead, the note is displayed twice in the customer's
preferred language.

## Cause
`t-field` does not use the context defined on the field itself. It uses
the rendering context.

opw-3101387

closes odoo/odoo#109330

X-original-commit: 8a3049a63c7e9b13892278784781a793f8e0ab4f
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-01-10 15:43:16 +01:00
Kartik Chavda 743704c54e [IMP] project: group task list view by default
This commit adds default groupBy for task list view
to represent data properly menu vise.
- add default groupBy stage for tasks from project action.
- add default groupBy personal stage for `My Task` menu.
- add default groupBy project for `All Tasks` menu.

task-3084850

closes odoo/odoo#109281

Related: odoo/documentation#3311
Related: odoo/enterprise#35504
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-10 15:43:10 +01:00
Kartik Chavda 6b22e54f1a [IMP] {sale_,}project: hide customer and sol field for private task
Before this commit when user creates a private task user
still able to customer and sol field which no use for
private task.

This commit hide customer and sol field for private task
and reset customer field when user make non private task
to private task.

task-3084850

Part-of: odoo/odoo#109281
2023-01-10 15:43:10 +01:00
Kartik Chavda 3cd30d1531 [IMP] web: add default_group_by in list view
Before this commit it is not possible to add default
groupBy in list if users want default groupBy a list
then they have to pass default groupBy in action and
passing default groupBy in action groupBy other views
in action, so priorer to this commit users cannot add
default groupBy in list view without impacting other
view.

In, this commit add default_group_by in list view
attribute so users can add default groupBy in list
view without impacting other views in action.

task-3084850

Part-of: odoo/odoo#109281
2023-01-10 15:43:10 +01:00
sofiagvaladze 262c0ad84f [IMP] hr_holidays: send time off cancellation notification to manager
Purpose:

User should be abled to delete him time off (time off that needs to be
validated by both, manager and time off officer), if it has not been validated
by officer yet.

The manager that validated the time off, should be notified
if/when the time off is canceled by the user.

Both manager and user should be notified if officer refused time off,
validated by manager.

This commit also fixes traceback on time off form in development mode.

If there is

<field name="A"/>
<label for="A"/>

we get traceback in dev mode.

Instread it should be

<label for="A"/>
<field name="A"/>

task - 2857233

closes odoo/odoo#94533

Related: odoo/upgrade#3809
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-10 15:43:00 +01:00
Demesmaeker 65ee6ddacc [FIX] payment_payumoney: fix typo in docstring
closes odoo/odoo#109534

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-10 14:41:05 +01:00
Thibault Delavallée 0fcd089a3d [IMP] test_mail: improve composer tests, yet again
Some additional changes in mail composer tests before going into some rewriting
and improvements

  * some improved messages in asserts;
  * additional tests for attachments in mass mailing mode, using sub tests;
  * additional tests for configuration (auto_delete_* fields, email fields,
    subtype, ...);
  * removed some wrong tests not failing due to current code: when testing
    template values, do not give a creation value at the same time as it
    will fail when moving to editable stored fields;

Task-2710804 (Mail: Clean MailThread Posting API)

closes odoo/odoo#109522

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-10 14:40:59 +01:00
Thibault DelavalléeandRobin Engels a2f9f26c85 [FIX] mail: better support private recipient in full composer
Current behavior

In the recruitment module, if you set an email template for the first step of
a job recruitment process you cannot send any other email using the full
composer. This happen because the partner type goes from 'contact' to 'private'
and this type cannot be set as recipient in the full composer.

Steps to reproduce

- Go to any job recruitement and set an email template for the first
  step
- Go on the website and apply for this job
- Go back to the job application and send an email using the full
  composer, the email is not sent to the applicant. And the applicant
  is not added to the followers.

Fix is to somehow improve support by adding asked partners from default in
context.

Note that this does not change anything from ACLs point of view, as trying
to access private partners without the necessary group or ACLs will raise an
access error anyway.

Also note that private partners defined on a template are still stripped
as they do not respect the new (nor the old) domain. That would be tricky
to solve, better not use private partners in templates.

opw-3010308

closes odoo/odoo#109451

X-original-commit: 12b25f21216b11511d5fed22fb3564d9dc297559
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Part-of: odoo/odoo#109522
Co-authored-by: Robin Engels <roen@odoo.com>
2023-01-10 14:40:59 +01:00
Thibault DelavalléeandRobin Engels a45afdd830 [IMP] mail: add tests for private partners in composer
Add tests showing current behavior of partner_ids fields on composer when
dealing with private partners. Some use cases are added as unit tests

  * default_partner_ids: coming notably from suggested recipients;
  * template usage adding a partner (e.g. partner_to);
  * when not having the rights to see private partners, access error should
    be raised;
  * mail gateway when a private partner sends an email;

X-original-commit: 2153eec790b730761fe50d6bea5cd4bacedce97a
Part-of: odoo/odoo#109522
Co-authored-by: Robin Engels <roen@odoo.com>
2023-01-10 14:40:58 +01:00
aliya 73b1aad8fb [IMP] l10n_co: update CoA, taxes
This commit:
- Updates the Chart of Accounts for Colombia
- Updates taxes

task-2830938

closes odoo/odoo#100513

Related: odoo/enterprise#31474
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-10 14:40:55 +01:00
Adrien Dieudonne 84bff82d76 [FIX] web, web_editor: ace widget partially hidden in read-only mode
Before this commit, the ´.ace_gutter´ overlapped the beginning
of the ace widget text content.

It only happens in read-only mode if it's a one-liner content.

Note that ´aria-hidden´ attribute is not set on BS modal. So,
it seems useless to remove it. Maybe a relicate of Bootstrap 3.

Steps to reproduce:
In debug mode,
- Open Settings
- Technical
- Scheduled Actions
- Open any

closes odoo/odoo#109519

X-original-commit: dc65d3de3a02a8f196eb22348bdfe41ede23f5d1
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-01-10 13:40:01 +01:00
Joseph Caburnay 4bf700140b [FIX] web: list column resize issue
**Issue:**

- Try resizing a column.
- Bug: After releasing the resize, the column being resized is also reordered.
  - This results to automatic resizing of the columns, not respecting
    the current resize made by the user.

**Solution:**

1. Keep the size of the columns after reordering. Better UX because any resize
   made by the user won't change when reordering the list (accidentally or purposely).
2. During resize, we track state variables - `resizing` and `preventReorder`.
   - When resize starts, `resizing` is set to `true`.
   - When the mouse pointer is released (mouseup), and before the `mouseup` event
     reaches the `window`'s `mouseup` listener, the column title handles the `mouseup`
     first, setting another state variable `preventReorder` to `true`.
   - `mouseup` will eventually reached `window` which stops the resize, setting
     `resizing` to false.
   - Then, click event happens on the column header. And since the `preventSort` is
     true, it will return early but resets the `preventReorder` to `false`.
     - If the click event happened to be in the resizer span element, we should not
       prevent it from bubbling so that `preventReorder` is properly reset.

**TASK-ID:** 3109501

closes odoo/odoo#109518

X-original-commit: 7a71a0974164277ac7fd382391684b078b71bf7d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-10 13:39:58 +01:00
Rémi Rahir dfb88e4fa2 [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/fc313d38 [IMP] images: delete images from the file store
https://github.com/odoo/o-spreadsheet/commit/d4e45186 [REF] config: move data external dependencies to config
https://github.com/odoo/o-spreadsheet/commit/3f6cd0f5 [FIX] headers: fix rounding error in header size
https://github.com/odoo/o-spreadsheet/commit/ac07e847 [FIX] functions: fix error message
https://github.com/odoo/o-spreadsheet/commit/e068c651 [IMP] clipboard: copy cell as HTML in OS clipboard

closes odoo/odoo#109497

Related: odoo/enterprise#35607
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-10 13:39:56 +01:00
David Ramia bcf253063f [FIX] website: optimize the asset disabling function
Before this commit, the behavior disabling the unused snippet assets
performed two checks:

1. It was looking for occurrences for its use in the snippet template
2. It was looking for occurrences for its use in the HTML fields
3. Checked on the occurrences of step 1 and 2 and return result.

In many cases there are already coincidences in the first step, making
the second step unnecessary since this second one is the slowest.
Matches are now checked between steps 1 and 2 to skip the second if
matches are already found.

closes odoo/odoo#109488

X-original-commit: 56100532dbcbdeb5487662d0cbf35ba6d62b15b5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-01-10 13:39:51 +01:00
Jensi Chovatiya 06b6a52648 [FIX] web: too long input placeholder
The placeholder may be too long and not fit the screen. In this
situation it would not been shown at all. Using the `text-trauncate`
bootstrap class, the end of the text is truncated with an ellipsis in
case it doesn't fit on screen.

task-id-3098157

closes odoo/odoo#109424

X-original-commit: dc7e4c90c9c28c456c1dfbdd503a4cb9095a1292
Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-10 12:35:09 +01:00
FrancoisGe 79c89438a7 [REF] web: converted the client actions from misc.js
This commit is to convert the client actions in misc.js into the new
architecture.
We remove the client actions login and logout because they are no
longer used in the code base.

closes odoo/odoo#109332

Task-id: 3099992
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-10 12:35:04 +01:00
David Monnom (moda) 9644ca52ff [IMP] point_of_sale: display rescue session
- Add link to see rescue session on each `pos_config`
- Change error popup by a alert popup when closing a pos.

Before the user wasn't notified when a rescue session isn't closed.
The popup isn't an error but a notification that inform the user that the session is already closed and a rescue session was created.

closes odoo/odoo#107000

Taskid: 2817110
Related: odoo/upgrade#4111
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-01-10 12:34:59 +01:00
FrancoisGe 2587f31912 [FIX] web: search in m2o displays lost connection notification
In the PR 104415, we add the possibility to abort the name_search rpcs
which will be ignored.
Unfortunately, we forgot that xhr.abort performs a reject which will be
converted into an "XmlHttpRequestError abort" error. This error will
cause a notification "Connection lost. Trying to reconnect...".

Solution:
We revert the modifications in the abort function and in the m2o
we catch all the errors on the rpc name_search that we are going to
abort because they have no more use.

How to reproduce:
- Go to a form view with a m2o field
- Having a slow network or a lot of records in the m2o
- Enter several char in the m2o search bar

Before this commit:
A notification "Connection lost. Trying to reconnect..." is displayed.

After this commit:
There is no notification.

closes odoo/odoo#109500

X-original-commit: 7bff161ac5e916bf4d4eabe4f9ada9a147893cf2
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-10 11:23:33 +01:00
Aaron Bohy d9b812d3f9 [FIX] base: allow t-debug directive in arch validation
Commit [1] added a whitelist of qweb directives that can be used
in qweb-based views (e.g. kanban). We forgot to allow the `t-debug`
directive, which obviously doesn't make sense in production but is
useful for debugging purposes.

This commit adds that directive to the whitelist, s.t. one can now
edit the view in xml or directly from the interface to add a
`t-debug`. Moreover, we add a test to ensure that we don't forget
a `t-debug` in an arch when we commit.

[1] 7fd5cec72b

closes odoo/odoo#109493

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-10 11:23:30 +01:00
José Moreno Hanshing 8802a69da6 [FIX] l10n_cl: extra delivery address in invoice header
This fixes an extra section that was being shown from the account module in Chilean localization invoices
because of changes in the account template in 16.0
Now we display delivery address in chilean invoices if it is different than the customer's address.
Also reorganized the header to optimize space. Addresses now don't use extra line breaks, moved the GIRO
to the right, and the Address to the left

closes odoo/odoo#109490

X-original-commit: e76c0f827f7c2b0a054cd1e4572155ece094f2cc
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-10 11:23:28 +01:00
Victor Feyens a3c3518313 [FIX] sale: avoid conflict between demo & test rates
When run on new year, the test fails because the created
currency rate (for the test) conflicts with the one in
the demo data.

closes odoo/odoo#109483

X-original-commit: 5a62eb7a25a05c7e779866824e0c1308d558f64a
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-10 11:23:25 +01:00
Adrien Widart (awt) d4f82ff1fa [FIX] purchase_stock: generate vendor delay report
The vendor delay report only works with basic use cases. Here are
the issues:
- For each SM, we sum up the done qty of all SMLs without
  considering the UoMs
- When grouping several lines (for instance, by partner and product),
  we sum up the quantities of each line but their UoM can be different
- When grouping several lines, we sum the `qty_total` which are the
  quantity of the related POL. This is an issue: suppose a POL with
  a quantity Q and suppose there are two SM (backorder), if we group
  by product, we will have a total quantity of 2Q, which is
  incorrect (and so will be the delivery rate)

To reproduce the issues: See the tests added by this commit.
Note: the last test (`test_vendor_delay_report_without_backorder`)
was not failing before this commit. It is added to simply improve
  the tests

OPW-3065065

closes odoo/odoo#109471

X-original-commit: c2e351534b9627b6844effba9943b09d4b0b93f3
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-01-10 11:23:22 +01:00
niyasraphy 0758297a65 [IMP] account: remove reference to view in enterprise
removing the view from the return action and thus it will take the default tree view.

closes odoo/odoo#107345

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-01-10 11:23:17 +01:00
Demesmaeker a6087c67b7 [FIX] sale: ensure correct partner is picked
Followup of b9e80c1403de0341a0c133a254142e53ef8c2842

In the last commit, we make it so when the tour was working as expected, the partner had an email.
But the problem which lead to another partner sometimes chosen instead was still there. We now make
sure to select the correct partner. Additionally, we supress an useless step.

closes odoo/odoo#109459

X-original-commit: 9b31ee81095ccef100c98cb0751b6e96d81f691e
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-01-10 10:16:56 +01:00
Jigar Vaghela 99e75e4e4e [IMP] l10n_in_edi: allow negative line for in invoice
Indian edi does not support line with a negative subtotal
but this use case is common when you want to apply a global discount.

This commit modify the json generated. The negative line are
splitted on same HSN code of the positive line affecting the discount of the positive
line.

The total of the invoice and the taxes remain unchanged.

closes odoo/odoo#109389

X-original-commit: 80701911229af6b9a6a29420796e45fcdbbd13ec
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-10 10:16:54 +01:00
fdardenne e602a55503 [FIX] mail: activity view: luxon in rendering context
Since the refactoring of the activity view, luxon is not in the
rendering context. Resulting in crashing in some activity views
that used luxon in their template.

- Go to Appraisal
- Switch to the activity view
- Create a record in this view -> crash

Now, luxon is in the rendering context.

closes odoo/odoo#109153

Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-01-10 10:16:51 +01:00
fdardenne ca80a60199 [IMP] mail: activity view: allow to filter columns
Before, in activity view, it was not possible for users to hide
never used columns.

Now it is possible for users to hide and show columns in the
activity view.

task-3039919

Part-of: odoo/odoo#109153
2023-01-10 10:16:51 +01:00
Claire Bretton (clbr) 9a20271a2a [FIX] l10n_ch: translate tax report line to English
One line of the tax report was still in plain French while the code should always be in English
Translate the data and update pot/po files.

closes odoo/odoo#109480

X-original-commit: bc8ff80b84d650c34224315097742cb878404f5b
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-01-10 09:12:44 +01:00
Claire Bretton (clbr) 7bd3871d07 [FIX] l10n_ch: reintroduce lost translations from 15.0/Transifex
Some translations were lost when we changed to 16.0 since there is no l10n project for 16.0 on Transifex.
Reintroduced lost translations for Arabic, German, French, Italian, Dutch and Chinese.

Task: 3126103
X-original-commit: b2794c76fea71011c92212808bfd2bf2edf42645
Part-of: odoo/odoo#109480
2023-01-10 09:12:44 +01:00
FrancoisGe 5d7136c21d [FIX] web: Incorrect navbar when leaving an invalid form view
Before this commit, when trying to change the menu from an invalid form
view, you would stay on the form view but the navbar would be modified
to dispaly the menu you had selected.

How to reproduce:
- Go to a form view
- Edit the fields so that the record is invalid
- Change the menu using the menu app or the palette command

Before this commit:
The form view has not changed but the navbar has been modified, it shows
the menu you selected.

After this commit:
The form view and the navbar have not changed.

closes odoo/odoo#109460

X-original-commit: bd7e36edcd2f9d33a72cc25b030f91c20da78387
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-10 08:14:46 +01:00
Rod Schouteden 2a1512f52e [IMP] microsoft_outlook: update refresh token when getting a new access token
Every 90 days the imap auth needs to be done again, because that is the only
way the refresh token is updated. With this commit it is now done also when
a new access token is called.

closes odoo/odoo#109477

X-original-commit: b9ecb538b39e7d5467de141a515ac833ace02973
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-09 22:31:51 +01:00
Benoit Socias d824a17344 [FIX] web_editor: reset m2m suggestions also after RPC returns
Since [1] when the m2m widget was introduced, when the network latency
is high enough, the `_search()` method can be called several times in
parallel. The former list of existing records is removed before doing
the RPC call, then populated with the results received after the RPC
call returns. With the proper timing and race conditions, this could
lead to having the list cleared several times, then populated several
times with the incoming results.

This commit makes sure the list is cleared after the RPC results are
obtained instead of before.

Steps to reproduce:
- Create and save a blog post with several tags.
- Edit blog post.
- Configure network latency to one second in browser's developer tools.
- Remove one tag.
- Remove another tag after 500ms. (Because the search happens after a
`setTimeout`.)
- Open tag suggestions.
=> List contained the concatenation of the two suggestion lists.

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

task-2811746

closes odoo/odoo#109479

X-original-commit: 48564abe484f61c09ca98c3cddd5b4b0b55e6497
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-01-09 21:15:45 +01:00
Benoit Socias f588703c28 [FIX] website_blog: make removed custom tags reusable
Since [1] when the blog tags field option was refactored to use the m2m
widget, the list of existing tags is not cleaned up anymore.
This causes custom tags to remain in that list when they are removed.

This commit adapts the existing condition to exclude custom tags that
have been removed.

Steps to reproduce:
- edit blog
- create custom tag 'test'
- remove custom tag 'test'
- create custom tag 'test'
=> was detecting the tag as already existing

[1]: https://github.com/odoo/odoo/commit/4a603cd59c8a3f33d9515f28d99a0f68c381c5d2

task-2811746

X-original-commit: 7f58519b922264efb6b6180608fd5a461d30b9e8
Part-of: odoo/odoo#109479
2023-01-09 21:15:45 +01:00
Benoit Socias 396ac318d9 [FIX] web_editor: restore m2m create text value before create
Since [1] when the m2m widget was introduced, events that were neither
from the create input text nor the create button did remove the internal
value of the text that was entered in the create input text.
Because of this "Create" had no effect if the user hovered e.g. a
suggested blog tag on its way to pointing to the "Create" button.

This commit replaces this behaviour by restoring the text value of the
create input when the create button is used.

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

task-2811746

X-original-commit: 59ecbb96db75a77cdcce11460cdbe8aa04438449
Part-of: odoo/odoo#109479
2023-01-09 21:15:44 +01:00