Commit Graph
159542 Commits
Author SHA1 Message Date
Victor Feyens cd47fd451e [CLN] website_sale_digital: split product.py (1)
Part-of: odoo/odoo#116026
2023-03-21 22:25:45 +01:00
Victor Feyens 868b8c9f5c [CLN] website_sale_loyalty: xml cleanup
Part-of: odoo/odoo#116026
2023-03-21 22:25:45 +01:00
Victor Feyens 59eae1d7d5 [IMP] website_sale: right place for menus definition
Part-of: odoo/odoo#116026
2023-03-21 22:25:45 +01:00
Loan (LSE) dbf12af2fa [FIX] pos_epson_printer: more details on printer errors
Before this commit:
If the ePos printer is reachable but is
configured incorrectly (change of Device ID, etc.)
or have an issue (missing paper, etc.),
a generic error message will be given:
"Please check if the printer has enough paper
and is ready to print."
This is too generic considering the amount of issue
that can happen and the fact that the printer itself
does send to us a `code` which give good indication
on the origin of the issue.
The list of these codes can be seen at:
https://files.support.epson.com/pdf/pos/bulk/server_direct_print_um_en_revk.pdf#page=52

In version 14 this code was given in the error message.
But this feature was lost in the versions above

&

 Trying to print a receipt from the PoS with
 a wrongly configured ePoS printer will just pop
 the confirmation popup:
 'Do you want to print using the web printer?'
 Without giving any details regarding the errors
 causing the issue

After this commit:
A more precise error message is given:
 - Containing the printer error code
 - Giving recommendation on how to search
 online to solve the issue
 - On the specific case of the `Device ID`
 setting changed, give more details on the
 value to use

&

 The error pop-up with the error details
 is displayed first. Then the confirmation one

 opw-3188576
 opw-3071709

closes odoo/odoo#116020

X-original-commit: 1f753d31c925e479e8243a6427a24b3da99bfc31
Signed-off-by: Loan (LSE) <lse@odoo.com>
Signed-off-by: Loan (LSE) <lse@odoo.com>
Signed-off-by: Sens Loan (lse) <lse@odoo.com>
2023-03-21 19:54:34 +01:00
Raúl e3c0e04ac9 [CLA] add new member to CLA Trescloud
closes odoo/odoo#116019

X-original-commit: 794bf239749e03de532e9ad648c66f85073c5176
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-21 19:54:29 +01:00
Thibault Libioulle ecc58cb482 [FIX] project: fix tag name search with none project in context
This commit fixes the name_search traceback on project tags when the
`project_id` in context is set to `False`.

Prior to commit odoo/odoo@05855b6b this check was still relevant since
the implementation used the ORM search method. Since this commit,
project_id must be an integer to be used in the SQL query.

Steps to reproduce:
- Open Project menu;
- Go to My Tasks menu;
- Create a new task;
- Open task;
- Click on Tags field.

Current Behavior:
```
  File "/home/src/odoo/odoo/models.py", line 1605, in name_search
    ids = self._name_search(name, args, operator, limit=limit)
  File "/home/src/odoo/addons/project/models/project.py", line 2756, in
  _name_search
    self.env.cr.execute(query, params)
  File "/home/src/odoo/odoo/sql_db.py", line 313, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.UndefinedFunction: operator does not exist: integer =
boolean
LINE 9:                             ON task.project_id = false
                                                       ^
HINT:  No operator matches the given name and argument types. You might
       need to add explicit type casts.
```

Expected Behavior:
- No traceback and standard name_search behavior.

closes odoo/odoo#116006

X-original-commit: f21bd6f47a75f5d6cbd442f30ef7df221e6fec7d
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-21 19:54:20 +01:00
Om Rabara a06a58e08b [FIX] mail: prevent timed-out error when quit pop and imap server
OSError: cannot read from timed out object while evaluating a
"model._fetch_mails()", it occurs because when we try to quit a POP server
of incoming mail using the "pop_server.quit()" method, sometimes it is not
able to reach the remote server to quit the pop server, so it throws an OSError.

We added the try block for POP and IMAP.
if it fails then we display the os error.

sentry-3932133536

closes odoo/odoo#116004

X-original-commit: 0c30529cc9256c0b2483c2fcbbc599b87c1f8577
Signed-off-by: Anh Thao PHAM <pta@odoo.com>
2023-03-21 19:54:13 +01:00
luvi 8580049bf1 [FIX] web: fix default_export_compatible fields in Export dialog
This commit fixes the exported fields list used by the export dialog. Since the
list was deducted from the column titles, it was not possible to get the complete
attributes required to filter them. Now we use the real fields fetched from the RPC
in the dialog. It fetches the correct list of exportable fields, and the
defaultExportList props only serves to list fields associated with visible columns.

It is now possible to filter fields correctly, and improve the reliability of the
export feature, to use the data from the RPC instead of using the data deducted from
the visible columns only.

A test has been added to verify the presence of a field that has the defaut_exportable
attribute in the export list by default.

task-3203958

closes odoo/odoo#116003

X-original-commit: 9ea5cf81a2b5ddcb0f19827d4a699193046fafb6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-21 18:56:20 +01:00
David Monnom (moda) a9608cdf1e [IMP] pos_restaurant: swap payment and order button
Previously, the payment button was larger than the others and next to
the numpad. The other buttons were managed by a mixin and arranged
in a predefined order.

Now, the payment button only stays in place when the "order" button is
not present, currently it can only be present if the restaurant module
is installed and a printer configured.

When it is present, it takes the place of the payment button and the
latter is added to the mixins with the other buttons

closes odoo/odoo#115988

X-original-commit: f32c07f28e2fd2830f568757d4700fa77b83ced7
Related: odoo/enterprise#38476
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-03-21 18:56:15 +01:00
althaf shaik 6273ac721c [FIX] stock: getting value from context in inventory
Attribute Error: 'frozendict' object has no attribute 'default_product_id'
trace back that occurs in stock/stock_quant: action_inventory_at_date
was caught by sentry.

steps to produce:-
Install inventory module
Select any product from menuitem/reporting/stock
Click replinish button & from that replinish wizard, select the product again
Then click forecasted stat button and in forecast click On Hand button
Then click Inventory At Date.
At this moment you find a trace back.
Because default_product_id is not getting from context in inventory.

sentry:-3952193922

closes odoo/odoo#115946

X-original-commit: 53445511294b5dfb27d626bf0039eba7e7ad54f2
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-21 18:56:12 +01:00
moerradi 87821818ee [REM] account: remove tax_audit field
the tax_audit field was introduced in v13 and it served the purpose of providing users with improved visibility regarding the impact of move lines on report lines. The computation of the sign for each move line when resolving tax grid amounts has now been simplified using the formula (tax_tag_invert * sign of the tag * balance). Consequently, the tax_audit field has become redundant and is no longer required.

closes odoo/odoo#114616

Task-id: 3196711
Related: odoo/upgrade#4442
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-03-21 18:56:01 +01:00
sofiagvaladze 94bbffe46b [IMP] add domain to select current company calendar
Before this commit user was able to select calendars from
differant companies even though user is not allowed to read
that companies record.

This commit add field related to country company and use
it in a domain to restrict user to select on availble
calendars.

task-3078009

closes odoo/odoo#109904

Related: odoo/enterprise#37334
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-21 18:55:55 +01:00
std-odoo 603df3c890 [FIX] web: allow to use properties in JS domains
Purpose
=======
Allow to use the following domain in views
```
[('properties', '=', [])]
```

To be able to show / hide elements based on the fact that the
properties is empty or not.

Task-3213639

closes odoo/odoo#115990

X-original-commit: 4c41108df23a1bbce8c5f6918ead80568a72d4ce
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-03-21 14:32:40 +01:00
Joseph Caburnay 8c82bec586 [FIX] web: status bar layout with many items and long names
Several status bar buttons having long names combined with several status
bar field items results to terrible layout.

To make it a little better:

- We wrap the status bar buttons so that each button will have single-line
  label.
- We also prevent the container of the statusbar field items from shrinking
  until a max-width of 50%.
  - In case there is multiple lines of status bar buttons and single line
    of statusbar field items, we keep the vertical alignment of the
    statusbar field items at the top.

This solution is not really very good but it's okayish.
A better solution can be like providing a way to allow dropdown menu for
the "extra" buttons that won't fit in a single line. For the future?

closes odoo/odoo#115987

Task-id: 3215622
X-original-commit: b1d51667b43c6404367b5cdfc8b17e722f39417c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-03-21 12:39:01 +01:00
John Laterre (jol) 7e21edf89b [FIX] account: fix ir.rule on tax repartition lines
Before this commit, you could search `account.tax.repartition.line`
and get records from all the existing companies,
which is not supposed to happen.

It should only return records of the `active_company_ids`.

That was because there were no `ir.rule` preventing that.
This fixes the issue.

closes odoo/odoo#115973

X-original-commit: 3e850ba9e27ac487d1f300f3ffc4ed2578e76f2f
Related: odoo/enterprise#38472
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-03-21 12:38:56 +01:00
Rahul Prajapati 4d71ae5a13 [FIX] mail: portal users can not join rtc calls
Before this commit:

Portal users are not able to join RTC Calls in Discuss.

After this commit:

Portal users are able to join RTC Calls.

Task-3050534

closes odoo/odoo#115963

X-original-commit: 0bfd2625fb89b93494c9df1aad9b7390723f1aa7
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-21 12:38:53 +01:00
Romain Estievenart 6d87d17919 [FIX] web: Scroll position on kanban view when "load more" datas
Steps to reproduce:

- Open a kanban view with enough records for a 'load more' button to be
  displayed
- click on Load more
  => the column remains scrolled all the way down, making the user lose
     track of where they were before clicking on the button => bug

This problem occurs because the foreach using by the xml trigger a full
rerender of the node in owl. To avoid these weird behavior, we now keep
the scrollTop of the scroll item, the column should remain at the same
place the end user was when clicking on the 'load more' button

Task ID: 3196763

closes odoo/odoo#115975

X-original-commit: b6731193004dc2d1a174fc6fc4de9e99db8e247a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-03-21 10:44:56 +01:00
Joseph Caburnay e2a6471e52 [FIX] web: introduce all the clickParams in list view buttons
**ISSUE**

A header button in the list view with "confirm" attribute doesn't
show a confirmation dialog when clicked. This is different to the
header buttons from the form view.

**SOLUTION**

In order to achieve similar behaviour, we reuse the BUTTON_CLICK_PARAMS
which originated from thew view_compiler and make sure that
buttons parsed from the other views also contain the correct set
of clickParams.

closes odoo/odoo#115974

Task-id: 3216357
X-original-commit: d91eac84ddafe1338470e73ba9921ddcbcac0e80
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-03-21 10:44:53 +01:00
Nasreddin Boulif (bon) 6019e26804 [FIX] website_slides: set right text color on sub menu/navbar
Step to reproduce:

  - Install E-learning module
  - Go to any course and set `Display` to `Documentation`
  - Click on `Go to website` and open editor
  - Click on `Theme`, then in `Theme Colors` section, click on the
    palette and select the first custom colors (black-white-gray)

Issue:

  The background of the submenu (just under `Course` tab) is
  transparent (while it should be black, like main menu) and the links
  are not well displayed (white/light text color).
  (Same issue with navbar brand and toggler when reducing screen width)

Cause:

  The background of the submenu is always set to transparent but
  the text color change depending if the top main menu background
  is dark or light.
  Lines that make the issue: https://github.com/odoo/odoo/blob/693092f2c90e36735c6896b6c6e7d795406453e9/addons/website/static/src/scss/website.scss#L240-L252

Solution:

  Set the text color (and the background of the toggler) to
  `light` color if background is dark (determined with
  `has-enough-contrast($body-bg, $dark)`), otherwise use `dark` color.

opw-3086750

closes odoo/odoo#115910

X-original-commit: ee7fe74d6d839eb20b6165e475f49eeed0262fcc
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-21 10:44:47 +01:00
std-odoo eae1a0a7ab [FIX] mass_mailing: the blank.gif image in the emails always raise a 500 error
Bug
===
Since 6185f14807 we check the <mail.mail>
existence before marking the <mailing.trace> as opened, but since
57ae1b9b8b61f5f4719a8a81e9d0d21fab58cfda we remove the <mail.mail>
automatically when we send them.

The result is that this endpoint always raise a 500 error.

To be: the <mail.mail> existence shouldn't be checked in this endpoint
(the token is valid for the raw integer id).

Task-3234519

closes odoo/odoo#115842

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-21 10:44:40 +01:00
Kevin Baptiste 7fbfb36285 [FIX] hr_attendance: show employee's picture
The pictures of the employees were no longer showing in the kiosk mode
as it tried to read on `hr.employee` instead of the `hr.employee.public`
model.

closes odoo/odoo#115950

X-original-commit: 3794bfed7d474f470f6e401d697d8c36ad620820
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-21 09:36:15 +01:00
Jurgen (jugj) c8ff1c6899 [IMP] Time-off : Add 5 precision digits to added_value in hr_leave_accrual_plan_level.py
task - 3147639
Adding precision digits and displaying the number without unnecessary trailing zeros using JS

closes odoo/odoo#115944

X-original-commit: b6c715cc5b39e28b4f40803a5f161845f5b407ab
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-21 09:36:12 +01:00
Maruan Aguerdouh (magm) cb345ea1e7 [FIX] web: traceback when trying to add favorite filters without name
Steps to reproduce:

- Install Sales, Subscriptions or similar app.
- Go to Sales, and try to save a favorite filter without name.
- It can also be done in the order lines of the Subscriptions, if
we try to add a product and select "search more", inside the new
window try to add a favorite filter without name.

Issue:

We got a traceback that's not user friendly instead of the proper
warning message, this is because inside the `saveFavorite` method we
check if the description is empty, but we can't use `.length` because
when we don't fill any name, the description is `undefined`.

Solution:

Removing the `.length` check, and just checking if the description is
undefined or not.

Forward bot up to master.

opw-3200499

closes odoo/odoo#115204

X-original-commit: c0fe1408da48e43b3e7e55de8e1c1edb09c982d2
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-03-21 09:36:07 +01:00
Camille Spiritus 055af0b0af [FIX] account/l10n_ch : remove blocking condition on _get_available_qr_methods
Since 16.2, a condition was added to _get_available_qr_methods :
        if self.env.company.country_id.code == 'CH':
            rslt.append(('ch_qr', _("Swiss QR bill"), 10))

This condition was not allowing a multi-company call, and caused another issue.

Once the method was called to check on the eligible QR choices, the ORM would consider the current company to be the US default one.

Hence the condition would never be fulfilled and a stacktrace would appear :

Oh snap!
Wrong value for account.move.qr_code_method: 'ch_qr'

Reverted back to the unconditional behaviour, and will check this occurence with the framework team.

closes odoo/odoo#115952

X-original-commit: cdba8a062985bfbdcbe8d51aa9705e702b4dee61
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
2023-03-21 08:31:11 +01:00
Julien Van Roy 45ae6ad15c [FIX] account_edi_ubl_cii: select the format based on the partner
Add a selection field on the partner to choose the EDI format.
Merge the `cii_` and `ubl_` fields.

Add an `endpoint_value` and `eas_code` on the partner. These values are
read when generating the Bis 3 (or one of its derivatives) to fill the
`EndpointID` and the `@schemeID` in the xml.

We can remove `l10n_nl_oin` and `l10n_nl_kvk` which are only used by
electronic invoicing, and replace every usage of them by the new fields
`endpoint_value` and `eas_code` (since for NL partners, they should
necessarily represent the KVK or OIN number: eas code '0106' or '0190').

We can also remove the `l10n_lu_peppol_id` module which was only there
to allow an arbitrary number to be set on the `EndpointID` (for
instance, for public administration that doesn't have a vat number).

task-3232845

closes odoo/odoo#115934

X-original-commit: 8bef3ac696d387a5b5867bc239d628477278fb1b
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-03-21 08:31:06 +01:00
Bruno Boi c9988a7812 [FIX] web: refocus date field in editable list
Before this commit
- an editable list will not refocus a date field after a pick of a date

After this commit
- it will

closes odoo/odoo#115892

Taskid: 3184929
X-original-commit: 6e570bc446295a1d56bd9f171b1f1d328a98127f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-21 08:31:03 +01:00
Bruno Boi 029ed70132 [FIX] web: traceback on opening group config menu
Before this commit
- since [1]
- a traceback occurs when opening a kanban group config menu if the view
  has "records_draggable" and "groups_draggable" attributes set to false

Explanation
- the kanban renderer template do not set a group id on o_kanban_group
  elements when the aforementioned attrs are false
- the kanban renderer then use a selector in order to give the kanban
  groups config menus their container element (used for positioning the
  dropdown).
- as there is no elements that matches that selector: a traceback occur
  later in the usePosition hook positioning logic.

After this commit
- this is fixed by always setting ids on the group elements.

[1]: https://github.com/odoo/odoo/commit/65e43dd88115b46e2d8585cf6dd7af4a89693e68#diff-823da6a5974aafef6ec7d54b4d410ccd8dc54e1892aee57c3bb62ff8a0414826R21

closes odoo/odoo#115891

Taskid: 3231051
X-original-commit: c8e9cf7f691dd208ffa947f110596beaf2f9ae94
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-21 08:31:00 +01:00
Renaud Thiry bc4abcc1b3 [FIX] mail: allow sending notification emails
Add back the 'sudo()' on batch mail unlinking.

Sudo is necessary to delete user notifications on auto-delete.
Which makes sense as the  recipient would have an email for it anyway.

The sudo was there as far back as:
c5c369355d

Then transfered in this change:
036a739b62

And removed in the recent optimization here:
e38bfd25df1bb25e7e5695b536052d5a0c85c5c4

task-3225207

closes odoo/odoo#115956

X-original-commit: 93a28f17024511e30d3c70eb847c361ca87e0ffe
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
2023-03-21 07:36:00 +01:00
Thomas Lefebvre (thle) 86ffeb2e5d [FIX] project: update token even if False
Steps to reproduce:
- take a project;
- change the visibility to allow sharing;
- click on "SHARE EDITABLE";
- share the project with a portal user;
- login as portal;
- try to open a project task.
Remark: the problem does not occur for all tasks.

Issue:
A traceback appears.

Cause:
Error occurs because: `return (token and record and consteq(record[token_field], token))`
compare two values with different type.
- `token` is equal to `'null'`
- `record[token_field]` is equal to `False`

In the code: `consteq = hmac_lib.compare_digest`

> `hmac.compare_digest(a, b)`
Return `a == b`.
This function uses an approach designed to prevent timing analysis
by avoiding content-based short circuiting behaviour, making it appropriate for cryptography.
a and b must both be of the same type:
either str (ASCII only, as e.g. returned by HMAC.hexdigest()), or a bytes-like object.
[source](https://docs.python.org/3/library/hmac.html#hmac.compare_digest)

The source of the problem is upstream to this comparison.
Indeed, we first test if we have a token.
As the value of the token is `'null'`, we pass the condition.

Solution:
It is necessary to have a token equal to `False` if the task has not token.
Therefore, whatever the value of the token (token value or `False`), we have to update the token.

opw-3217490

closes odoo/odoo#115947

X-original-commit: dd3a59fa28c5644be93cc2778e0c6854a4481d51
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-20 23:49:09 +01:00
gawa-odoo cca15af64a [FIX] analytic,account: analytic distribution should be indexed
We created an index in the mixin, but the `init` was never called
as there was a missing `super` in `account_move_line`.
We also remove the index in `sales_project`, as it now is done in
the mixin (and we don't want different names for it).

closes odoo/odoo#115948

X-original-commit: 98a556031180cf72680b4f082a5c5d7b491742b7
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-20 20:14:50 +01:00
tsm-odoo 53d4465521 [FIX] im_livechat: crash when opening a chat from welcome bot
closes odoo/odoo#115945

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-20 20:14:47 +01:00
Didier (did) 7da61eaeeb [IMP] mail: defaultDisplayMode can be directly assigned
Part-of: odoo/odoo#115945
2023-03-20 20:14:47 +01:00
Didier (did) 580042a2f5 [IMP] mail: Move lastInterestDateTime to a getter
Part-of: odoo/odoo#115945
2023-03-20 20:14:46 +01:00
Alexandre Kühn 70b165a1db [FIX] mail: open call settings then select mailbox should not crash
Steps to reproduce:
- open Discuss app with "General" as active thread
- open call settings in the inspector
- open a mailbox as active thread

Crash:
```
Cannot read showOnlyVideo of undefined
```

This happens because discuss has a single thread view
that is shared for any selected thread. However, the
call settings menu only makes sense for thread that
have call feature, which applies for only channels.
Mailboxes should not have any call settings menu.

closes odoo/odoo#115769

X-original-commit: 6e98ed068f01903383aca3348c193b56b46c6f95
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-20 20:14:42 +01:00
Goffin Simonandkmagusiak <> 0248e490f6 [FIX] base: Commercial fields not syncing after changing parent_id
Steps to reproduce the bug:

Here are aliases for the used contacts:
- A: Azure Interior
- B: Gemini Furniture
- C: Gemini Furniture, Edwin Hansen
- D: (delivery address for Edwin Hansen)

1. Login on a runbot.
2. Set VAT of A and B to different values.
3. Open C, and create a delivery address: D
4. Check: VAT of D = VAT of B
5. Change the related company of C from B to A.

Bug:

The VAT of C = VAT of A, however VAT of D did not change.

When syncing the commercial fields of a partner, we also sync his childs.

PS: Due to function _compute_commercial_partner, the commercial partner is always updated for
all the childs.

So the condition child.commercial_partner_id != self.commercial_partner_id
is never satisfied in function _children_sync and the commercial fields were
never updated.

opw:3111493

closes odoo/odoo#115932

X-original-commit: df87448f2a39eead079cffea566cd760a8918542
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: kmagusiak <>
2023-03-20 19:15:27 +01:00
Florian Charlier 1353cd8687 [FIX] survey: fix _compute_allowed_triggering_question_ids
If the method were called on several new questions from different
surveys at the same time (can it happen?),
allowed_triggering_question_ids would include questions from all
surveys for each of them.

A unit test of the method is also included.

Introduced in b1d18562.

Task-3226408

closes odoo/odoo#115930

X-original-commit: e506e8b049c61d5b772370792541b6875d5e5d72
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
2023-03-20 19:15:25 +01:00
Walid HANNICHE (waha) c0d5908c6a [FIX] stock: set correct return quantity
Steps to reproduce:
-Enable multistep routes for manufacturing
-create a MO for 50 products
-In internal transfers from Stock to Pre-production validate
part of the tansfer (20 units) and create a back order
for the remaining qty (30 units)
-create and validate another pertail transfer (3 units)with a back order
for the remaining quantity (27 units)
-create a return for the last validated transfers

Bug:
the default qty for the return is set to -20 where it should be 3
this commit[1] deducts the previous transfers from the returned amount

Fix:
only deduct returns from current transfer

opw-3104699
[1]:https://github.com/odoo/odoo/commit/7b08f0ae0a39e8f575b21e744de16264b6365704

closes odoo/odoo#115929

X-original-commit: 0278a4a7ba5cdd7a722e5d576d22820a3ee64308
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-03-20 19:15:22 +01:00
xO-Tx d7501075b8 [FIX] website: fix SocialMedia option on snippet clone
Steps to reproduce:

- Go to a website page (edit mode) > Duplicate the footer (or any
snippet with a Social Media block).
- Save > Traceback.

Starting from [1], a `dbSocialValues` variable was used to update the
"Social Media" DB links for the current website (on save).

These URL values are fetched from database (see: `_fetchSocialMedia()`)
to "compute the widget state" and when the snippet is dropped
(`onBuilt()`).

The specific case of "snippet clone" will lead to a situation where the
editor is created with an `dbSocialValues === undefined`, leading to
trigger the website `write` method with an empty update value...

Remark: The "save" works correctly after calling `_computeWidgetState()`

The goal of this commit is to simply prevent triggering the `write`
update on `clanForSave()` when `dbSocialValues` is `undefined`.

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

opw-3204862

closes odoo/odoo#115912

X-original-commit: d3edef46426d1fefb31dae482f4c05dade4865a6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-20 18:13:31 +01:00
std-odoo a9b9b8cbfd [FIX] base: fix the email used to test the SMTP configuration
Bug
===
When the from_filter of an outgoing mail server contains a domain
(e.g. company.com), and when the system parameter "mail.default.from"
is a full email address, with a different domain name
(e.g. notification@example.com) we concatenate both value which produce
an invalid email (e.g. notification@example.com@company.com).

Instead, we always give the priority to the from_filter, and fallback
on "noreply" for the local part when needed.

Task-3230917

closes odoo/odoo#115890

X-original-commit: bf02481de9932de2e0246ac36fcf59f37a89b511
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-20 18:13:26 +01:00
Rohitkumar (roku) 869c7316cd [FIX] hr: fix the on/off boarding warning in employee
Steps to reproduce:
 - Install Employees App Configuration
 - Got to the Employees > Configuration > Activity Planning > Set the  On/Offboarding Plans
 - Create Test Employee With No Catch
 - Click on Launch Plan action
 - Check the Warning in Launch Plan Wizard

When employee's coach or manager empty then warning is appeared coach's/manager's
user is not set.In this commit we have shown in the warning that the coach/manager
is not set.

task-3193218

closes odoo/odoo#115889

X-original-commit: 421c238129676a83df63f00abadd539e82ced2eb
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-20 18:13:23 +01:00
Kevin Baptiste 2707556f5e [FIX] hr_holidays: fix access error for officer
Time Off officer would sometimes get an AccessError when requesting
leaves for many employees.

opw-3220920

closes odoo/odoo#115886

X-original-commit: f38a3d1ee398242f5dad6860bac95143256015b5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-20 18:13:17 +01:00
Maxime franco 0467440dbc [FIX] stock_account: adds missing parenthesis
It's causing an operator precedence error

original commit: 111a7f58728049431b1d011ce9b2af244c0a5aa4

closes odoo/odoo#115884

X-original-commit: 5253957ac3dfd94ed0e2ecb99a064e292789b387
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-20 18:13:14 +01:00
Victor Piryns (pivi) 1e737debbe [FIX] project: speed up name_search of tags on a task
Description:
The pop-up that shows suggestions when adding a tag on a task is
really slow (300~500ms per request on prod).

Cause:
`project.tag` has an override of `_name_search()`, which adds a
domain of the form
```python
['|', ('task_ids.project_id', '=', project_id),
 ('project_ids', 'in', project_id)]
```
which is expensive to compute.

Functional requirements:
- Suggest tags of the "project" first (those that are on tasks in the
  same project), then all the rest.
- Tag's name should be sorted alphabetically per result set (tags on tasks of
project first, sorted alphabetically, then all other tags, sorted
alphabetically)

Solution:
Construct a custom query that makes use of CTE and `UNION ALL` to sort
only on a subsets of the tags to speed up. Also `UNION ALL` with a
`LIMIT` is lazy evaluated, so we gain on speed of all tags are comming
from tags on tasks in the current project.

Affected version:
- 16.0
- saas-16.1
- master

perf-3209468

closes odoo/odoo#115867

X-original-commit: 9e4ed8942800a7fc6e980e79b3e744fc35bd2a0d
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-03-20 18:13:09 +01:00
Jorge Pinna Puissant c7aff4cb7d [FIX] web: remove translation alert banner
The translation alert banner is an old remaining edit/save feature that
is not relevant anymore with the new "always edit" and the "save when
leave" features.

closes odoo/odoo#115866

Task-id: 3232795
X-original-commit: dfd65d08ef3d76f9cd702927ee09dafe429d895a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-20 18:13:06 +01:00
Lucas Vermeulen (luve) b17acfc8ab [IMP] loyalty,*: loyalty cards statbutton on partners
Add a stat button on customers views to easily retrieve all
the linked loyalty cards.

task-3050152

closes odoo/odoo#107375

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-03-20 18:13:04 +01:00
Jorge Pinna Puissant fe5b5b479c [FIX] web: add tooltip with the name on many2one avatar field
Before this commit, when over a man2one avatar, on a task project for
instance, we don't have any information about the user.

Now, a tooltip with the name is shown, note that this was already the
behavior in previous versions.

task-id = 3148168

closes odoo/odoo#115865

X-original-commit: c361cff78ddb2ad6b1f1c1d80c71a3ab154c6789
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-20 16:51:49 +01:00
Antoine Guenet 6fddef5572 [FIX] web_editor: restore mass_mailing's Mail Debug tab's embedded style
An error during the conversion of the html field to Owl caused the
embedded style of the Mail Debug tab to be lost because they were inside
a `<link>` element rather than in a `<style>` element.

closes odoo/odoo#115863

X-original-commit: 218909a339b2f3937e6d6f72fd0c6ff62aa305ce
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-20 16:51:44 +01:00
uso-odoo dbc3b0b5d5 [FIX] mrp : prevent error when creating new record of mrp.workorder in tree view
while we are creating a new record of the mrp.workorder from the editable list
view (mrp_production_workorder_tree_editable_view), we are getting the singleton
error, as it is not taking any production record.

by applying this commit, it will resolve that singleton error

sentry - 3982694755

closes odoo/odoo#115862

X-original-commit: 91e7d36a48d58aea1d63999dd150b543983aeba1
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-20 16:51:41 +01:00
Joseph Caburnay d4ed17f7eb [FIX] web: image_field: should properly load the new image
**TO REPRODUCE**

- open contacts
- open a contact with a picture (for ex, douglas fletcher)
- change the picture => new picture is displayed
- click on cloud icon to force save => new picture is displayed
- repeat: After repeating, the old picture will be displayed.

**SOLUTION**

Before this change, `getUrl` is bound to the rendering context
instead of the component and it will write to the rendering context.
This is introduced in this commit: https://github.com/odoo/owl/commit/df59ec49aefce2e0913fdc1792d42b9680fb28b6

The following excerpt from the mentioned commit explains:

"A side-effect of this change is that now the rendering context is no
longer the instance of the component by default, but is always an object
with the component in its prototype chain."

To make sure that `getUrl` is properly bound to the component,
we should call it from the `this` of the rendering context.

closes odoo/odoo#115857

Task-id: 3204546
X-original-commit: 05898cdaaf2dbf628665f3fa4c24769f7c424efe
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-20 16:51:39 +01:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00