Commit Graph
165095 Commits
Author SHA1 Message Date
Chong Wang (cwg) f0efebee4d [FIX] core: fix typo for TranslationImporter
fix typo to log correct error message when the imported file is badly formatted

X-original-commit: 75606b0f92a26b64ee281792dfa32d47f135f46d
Part-of: odoo/odoo#135277
2023-09-13 12:19:10 +00:00
Chong Wang (cwg) 506d0cc4ec [FIX] core: fix cached translations
before this commit:
translations updated by `update_field_translation` api cannot be detected by
t-cache and some cached data whose model overrides `write` with an extra
'clear_caches()'

Step to reproduce:
- Create a mega menu, select any template, `Odoo Menu` for the example
- Install another language on the website
- Go to the translated version of your website and enter translate mode
- Change "Camera" in the mega menu to something else
- Save

The change won't be replicated, looking like it did nothing.
From there, removing or adding `edit_translations=1` in the URL will
use different cache version of the page's views and you will see the
outdated value on one and the correct on the other one.

after this commit:
`update_field_translation` will call `write`
it does the following 4 important things
1. mark field as modified
2. execute logics in the override `write` method
3. update write_date if needed to support t-cache

opw-3305117

X-original-commit: 2beb466668e4eb80d7c3ca3947445fb1cb141cff
Part-of: odoo/odoo#135277
2023-09-13 12:19:10 +00:00
Guillaume (guva) c71b571b68 [FIX] base: superuser on company creation
When creating a new company, SUPERUSER_ID is not added in `user_ids`.
Therefore, when installing a new module, the newly created company
is not in `self.env.companies`, which leads to an issue when
computing `company_id`.

Steps:

- Install Accounting module
- Create a new company with any localisation
- Delete the tax closing entry
- Try to install `stock_account` module
-> Error: `_check_company` failed

With this commit we add the company newly created to
the superuser's `company_ids`

opw-3488788

closes odoo/odoo#135276

X-original-commit: 771fdaf25eefdc30443e96b03b029346bebb50be
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-09-13 12:19:09 +00:00
Lucas Lefèvre (lul) 945b96378f [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/5dfa942c [REL] 16.5.0-alpha.7
https://github.com/odoo/o-spreadsheet/commit/1bf08cca [REM] selection: removed `types/selection.ts` file Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/e7d85184 [IMP] spreadsheet: add header grouping feature Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/a498b5a6 [FIX] sheet: fix add/remove headers allowDispatch Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/decbd467 [FIX] grid: keyboard context menu position Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/be351a83 [REF] ot: simplify grid-dependant command transform Task: 3272931
https://github.com/odoo/o-spreadsheet/commit/e4a64149 [IMP] remove duplicate: add the remove duplicate functionality Task: 2984935
https://github.com/odoo/o-spreadsheet/commit/20600cda [IMP] commands: modify enum of CommandResult
https://github.com/odoo/o-spreadsheet/commit/4b1be76c [IMP] LineChart: cumulative chart
https://github.com/odoo/o-spreadsheet/commit/513ffcaf [FIX] SheetPlugin: Prevent deletion of all non-frozen headers Task: 3414127
https://github.com/odoo/o-spreadsheet/commit/cc408d7b [FIX] find_and_replace: remove useless tab index Task: /
https://github.com/odoo/o-spreadsheet/commit/34d34a19 [IMP] chart: use locale in chart labels/tooltips

closes odoo/odoo#135184

Related: odoo/enterprise#47343
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-09-13 12:19:08 +00:00
Morgane (morm) 4b111ad1e5 [FIX] web: fix listView text truncate on wrong cells
This commit fixes the text truncate that should not be applied on some of
the cells inside the `listView` (causing a dot next to graphical elements).

This issue was created by this commit (a6dd707).
The inline-block display of o_field_widget was the source of the issue.

We also changed the called mixin text-overflow to text-truncate for
cleaner code. The vertical align top is then removed, and we added a
vertical align middle to fix the wrong alignement of some elements.

Thoses modifications also fix the issue with where the tags were cut in
the `listView` when the window was smaller.

task-3455121
Related to task-3326263

closes odoo/odoo#134878

X-original-commit: 53f605399755f9355554c2582ea0f693c8f947b4
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-13 12:19:06 +00:00
stefanorigano (SRI)andBrieuc-brd 46dca09cc4 [FIX] web, crm, fleet, sale: font-weight
Establish a set of target font-weight values (may not directly match the
final result on screen).
Enable the system to naturally utilize the "bolder" font-weight.
Remove previous customizations designed for "Roboto" that clashed
with certain system-fonts.
Enforce the "normal" font-weight for icons, regardless by their parent
design.
Adapts some kanban titles.

closes odoo/odoo#134824

X-original-commit: 74fce06cad4000a3894757d4fef9074b64153b7b
Related: odoo/enterprise#47140
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
2023-09-13 12:19:04 +00:00
tsm-odoo 4775fedddf [FIX] im_livechat: fix history command
Before this commit, executing the `/history` command in a livechat
would do nothing. Indeed, the message was sent on the wrong target
through the bus so the history request was never received by the
visitor client. This commit fixes the issue by sending the notification
on the channel instead of the channel uuid.

closes odoo/odoo#135254

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-09-13 10:55:53 +00:00
Loukas Wets (lowe) b512d5f0b6 [FIX] point_of_sale: New mobile order list display
Prior to this commit the displayed order information in the order list
was inconsistent. This commit rearranges the displayed information.

Task-3502304

closes odoo/odoo#134969

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-13 10:55:51 +00:00
Pierre Paridans 7552284e78 [REF] web: replace jQuery UI Datepicker usage in Calendar view
This commit removes the jQuery UI Datepicker usage for the sidepanel's
mini-calendar in the Calendar View and replace it by our own
DateTimePicker component.

On the visual side, the styling has been aligned to the DateTimePicker
one and takes a bit more space to allow a better readability.

It also adds two props to the DateTimePicker:
- showWeekNumbers : allow to show or hide the week numbers' column, default to true.
- daysOfWeekFormat : allow to choose between the "short" or "narrow" (1
  letter) format for the week's days column header, default to "short".

task-3439226

closes odoo/odoo#134263

Related: odoo/enterprise#47114
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-09-13 10:55:49 +00:00
Harsh Modi 6a22ce9bde [FIX] pos_paytm: resolved issue of not receiving expected Paytm Error
Before this commit:
While using Paytm Terminal the expected behavior is to get an error
message from Paytm on payment failure but unexpectedly the cashier is getting
TypeError: this.env._t is not a function

After this commit:
The issue has been fixed, and the cashier will now receive the correct error
message from Paytm on payment failure

closes odoo/odoo#135258

Signed-off-by: Harsh Modi (hamo) <hamo@odoo.com>
2023-09-13 09:39:05 +00:00
Antoine Boonen 0b2ec2a39b [IMP] hr_expense: Don't hide taxes on hr.expense when product has cost
Problem
---------
In 15, taxes are hidden from hr.expense when the expense category has a
cost. They can however be configured and added. The current behaviour is
counter intuitive.

Objective
---------
Don't hide taxes when product has cost in v15.

Solution
---------
Remove the `hidden` attribute in the expense xml form as well as the
`groups` attribute.

task-3491868

closes odoo/odoo#135237

X-original-commit: 08405f0673fd19a8c278d095a141f53b935eb5f0
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
2023-09-13 09:39:03 +00:00
Andrea Grazioso (agr-odoo) 566b31c02a [FIX] sale_timesheet_margin: sale order line cost
Set Default UoM on Timesheet Settings page: Hours
Set [Employee] Timesheet Cost (HR Settings tab): 65.00/hour
Create a product [TEST] as follows:
- Product type: service
- Invoicing Policy: Based on Timesheets
- Create on Order: Project & Task
- Unit of Measure: Days
- Purchase UoM: Days
- Sales Price: 1.00
- Cost: 0.00
Create a sales order
Add an order line with product [TEST], quantity 1
Confirm. Project and task will be created
On the task add a 1 hour timesheet entry for [Employee]
Save and go back to the SO

Issue: SO line cost is incorrectly computed.

opw-3378688

closes odoo/odoo#135173

X-original-commit: dcf7b9fd7c5ae5653a368b9dc2219ce72818c6c1
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2023-09-13 09:39:02 +00:00
Pierre Paridans a94d337b1a [REF] web: remove dependency on Bootstrap Collapse in OnboardingBanner
This commit removes the usage of Bootstrap's Collapse widget and replace
it by the `useTransition` hook when discarding an OnboardingBanner.

task-3439226

closes odoo/odoo#133917

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-09-13 09:39:00 +00:00
vlst a869ee87f2 [REF] pos: use reactivity in ClosingPopup
The "ClosingPopup" relies on an error-prone pattern of calling
a "handle" function on each input change.

In this commit we refactor it's logic such that the calculation
is done reactively. 

This leads to much simpler code.

In addition, we remove multiple pieces of dead code.

closes odoo/odoo#131171

Task: 3499250
Related: odoo/enterprise#47323
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-13 09:38:58 +00:00
vlst f1dbd84e9d [FIX] point_of_sale: fix MoneyDetailsPopup
The MoneyDetailsPopup accepts the prop `total`. This popup is used to
keep track of the bills selected by the user and it's total should
thus simply be computed from the given bills information.

Passing the `total` prop and using it as `state` serves no purpose
and leads to bugs, such as the one addressed in this task.

Steps to reproduce:
1. Click on "Close Session".
2. Input a value in the "counted" field
3. Open the "MoneyDetailsPopup"
4. Observe the fact that the "Total" value is the one from the "counted"
   field, instead of "0".

This is caused because the `ClosePosPopup` has to also independently keep
track of this `total`, in order to be able to pass it to the
`MoneyDetailsPopup` on future calls.

In order to fix this problem from the root cause, we completely remove
the prop `total` and instead allow the popup to compute it from it's
information about the selected bills. This simplifies the code, preventing
future similar bugs.

Task: 3499242
Part-of: odoo/odoo#131171
2023-09-13 09:38:58 +00:00
vlst 60fb310696 [REF] point_of_sale: generic Input component
This PR introduces the generic `Input` component.
This component is meant to provide a "batteries included" api for working
with inputs. It is well suited to work as a `search bar` or as a `monetary input`.
It has no dependency on the pos app. It can then be used anywhere.

The `Input` component handles:
        - `debouncing`;
        - toggling between mobile and desktop views;
        - `autofocus`;
        - validation;

Example usage:
- As a search bar:
```xml
    <Input
        class="'ms-auto'"
        isSmall="ui.isSmall"
        placeholder="'Search products...'"
        icon="{type: 'fa', value: 'fa-search'}"
        callback.bind="(value) => pos.searchProductWord = value"
        debounceMillis="99"
    />
```
- As a monetary input:
```xml
    <Input
        icon="{type: 'string', value: pos.currency.symbol}"
        iconOnLeftSide="pos.currency.position === 'before'"
        isValid.bind="env.utils.isValidFloat"
        callback.bind="(value) => state.amount = value"
        autofocus="true"
        getRef="(ref) => this.inputRef = ref"
    />
```

In this pr we refactor the
    - `ProductsWidget`,
    - `CashMovePopup`,
    - `ClosePosPopup`,
    - `CashOpeningPopup`
components to use the
new `Input` component.

With the previous commit in which we introduced the `CategorySelector`
component and with the use of this new `Input`, the component
`ProductsWidgetControlPanel` was no longer needed and thus removed.

The use of the `Input` component allowed us to also remove the
error prone `useValidateCashInput` hook.

Task: 3459850
Part-of: odoo/odoo#131171
2023-09-13 09:38:58 +00:00
Denis Ledoux 67954c080e [FIX] sale: apply record rules on order cancellation subject and body
When rendering the sale order cancellation message,
the rendering should apply the current user record rules,
for instance the count of the partner sale orders should
match the count of what the salesman can see in his ui.
Otherwise he doesn't understand why he has a different count
in the UI and in the cancellation message.

In case you want the behavior of seeing all records
and not just the current salesman records only,
then you apply within the template itself the
`sudo()`.

Applying the `sudo` where you actually need it in the template,
and not computing the full subject/body as sudo,
offers more granularity.

closes odoo/odoo#135233

X-original-commit: 5d49a08f60b1f299784e2e983e87cdec178642c1
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-09-13 08:20:43 +00:00
FrancoisGe 87a4a85295 [FIX] web: relatedFields with column_invisible
Before to this commit, the activeFields of the fields in the x2many arch
were not merged with those of the relatedFields.

Problem:
When I have a custom x2many field that contains a many2one "x" field in its
relatedFields and this field is also present in the arch with column_invisible="True".
The field is considered invisible because its presence in relatedFields is ignored.

Solution:
Merge the field description in the arch with that in relatedFields.

Before:
Only the "id" of the many2one field is present in "web_read".

After:
The "id" and "display_name" of the many2one are present in "web_read".

closes odoo/odoo#135216

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-13 08:20:41 +00:00
Aaron Bohy 93938cfdf3 [IMP] web,*: remove assets_backend_prod_only
This commit reworks a little bit the backend assets to remove a
bundle and thus save a call at webclient startup. The bundle
"assets_backend_prod_only" existed only to allow to add files in
production, but not in the tests (typically, the file that spawns
the webclient).

This commit introduces a new bundle "web.assets_web" that contains
"assets_backend" and the few files that we only want in production.
In the /web page, we now load "assets_web" instead of
"assets_backend" and "assets_backend_prod_only". In the /web/tests
page, we keep loading "assets_backend", which is now directly
included into "web.tests_assets".

For the sake of consistency, this commit also renames the dark
mode bundle "dark_mode_assets_backend" into "assets_web_dark".

closes odoo/odoo#135204

Related: odoo/enterprise#47316
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-13 08:20:40 +00:00
Samuel Degueldre 4327c062d8 [REF] web, *: remove moment.js library
The moment.js library is officially done and no longer recommends its
use for new projects. As such, we have been progressively moving to
luxon instead. Until recently, we still had some libraries that depended
on it, and some leftover calls to it. This is no longer the case, and as
such, the library can be removed completely.

closes odoo/odoo#135182

Related: odoo/enterprise#47304
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-13 08:20:37 +00:00
abd-msyukyu-odoo 6b74a84e44 [FIX] crm: update progressbars after adding forecast column
Impacted versions:
16.3+

How to reproduce:
- open CRM > Forecast
- drag&drop a lead from a column to another
- click on "add next month" button

Current Behavior:
- the progressbars revert back to their state before the drag&drop

Expected Behavior:
- the progressbars keep their updated value after the drag&drop

Technical explanation:
After [1], the split of the progress bar logic from the relational model, only
notifying the model of a reload is not enough to correctly update the
progress bar values. It is therefore required to manually do it in the CRM
Forecast view after adding a column.

Master update:
Furthermore, after [2], the adaptation of the codebase to the new relational
model, the domain modification of the `forecast_kanban_model` was not
transcripted correctly: the domain modification for the fillTemporalPeriod
should be added by replacing the previous one if present, not simply added
(because then we have a constantly growing domain with contradictory leaves).

Also, since the new `RelationalModel` makes it mandatory to render the view
after a `DynamicGroupList.load` because `DynamicGroupList` is `Reactive`, to
avoid `progressBars` flickering when adding a forecast kanban column, the
`ProgressBarHook._updateProgressBar` should store the result of its
`read_progress_bar` call in `_pbCounts`. This makes it so that when the
`DynamicGroupList.load` is done, already computed progressBars will keep their
value and not switch back and forth between the previous state of `_pbCounts`
computed in `loadProgressBar`.

[1]: https://github.com/odoo/odoo/commit/58ca40b03215ef4c6c575267494dc8bccc30a033
[2]: https://github.com/odoo/odoo/commit/218ad8456a06503dd508e7216edcffdc90b35cac
task-3497579

closes odoo/odoo#135149

X-original-commit: b53b46ec36818615b7beb1d24fd44c9f8d69063a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
2023-09-13 08:20:36 +00:00
Loukas Wets (lowe) 03547479f7 [FIX] point_of_sale: inconsistant ui when popup
This commit fixes the ui of the pos. When a popup was open in pos, elements
were rendered at the same level as the popup.

closes odoo/odoo#135124

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-13 08:20:35 +00:00
Abderraouf Ghrissi (abgh) d63e9c71d1 [FIX] sale_timesheet: default_service_policy not working in product form
Before this commit:
- There is a bug in odoo enterprise.
project.project form view > invoicing notebook > services created using create and edit
should be configured by default with an 'invoicing policy' set to 'based on timesheets'.
Technically, while we're using 'default_service_policy' with the right value, we're
getting a different value in the form.

After this commit:
- The bug is fixed.

closes odoo/odoo#134552

X-original-commit: 6bb68d9f3263c2154eb87ec22559d142e880c084
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Abderraouf Ghrissi (abgh) <abgh@odoo.com>
2023-09-13 08:20:35 +00:00
std-odoo 925daad7f3 [IMP] mail_plugin: do not allow portal user to use the addin
Purpose
=======
Show an error during the login process if a portal
user tries to use the Outlook / Gmail addin.

Task-3344536

closes odoo/odoo#134450

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-13 08:20:33 +00:00
Loukas Wets (lowe) 27d51c1f10 [FIX] pos_self_order: acces without access token restriction
Following this PR https://github.com/odoo/odoo/pull/131140 when the self
order is accessed without access token the access restrictions are not
applied anymore. This commit aims to restore the previous behaviour
implemented in the following PR https://github.com/odoo/odoo/pull/122901/.

This commit also add a test to verify the flow of accessing the self order
without an access token. While doing so a the tour util cannotAddProduct
was fixed since it did not behave as inteded.

closes odoo/odoo#133595

X-original-commit: ae1dbc1d34fd622959540ec84bcefe795e15552b
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Loukas Wets (lowe) <lowe@odoo.com>
2023-09-13 08:20:33 +00:00
Thomas Lefebvre (thle) 1112f6aa4a [FIX] event: translate ICS file
Issue:
------
After registering for an event, you can download the '.ics' file.
This file is not translated into the current user's language.

Solution:
---------
Use the default user language and, if public,
use the language selected on the website.

A user may wish to have his calendar in his preferred language
by using the English website.

opw-3193663

closes odoo/odoo#135251

X-original-commit: b06c56b9cc3bdca1ac405eb9a7844a43deebd87c
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-09-13 07:04:39 +00:00
Vivek Pathak e1a9f3f23e [FIX] website_forum: modify notification message
Before Commit:
Currently, when a user marks their answer as the best answer in the forum, an
error notification appears with the message 'Sorry, you cannot vote for your own
posts' However, this error message lacks clarity and does not clarify
the underlying issue.

After Commit:
Now the error message is modified to 'Sorry,
you cannot select your own posts as the best answer'

Task-3481264

closes odoo/odoo#135193

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-09-13 06:01:14 +00:00
Alexandre Kühn 4e79a9ec0b [FIX] mail: do not autoscroll attachment box when initially open
Before this commit, when a form view choose to open attachment box
initially and chatter is at bottom, opening the form view was
scrolling down to the attachment box.

The auto-scroll to opened attachment box is desirable when the
user explicitly interact with the attachment button, to show
the attachments. However, it should not be triggered when opening
the form.

This commit fixes the issue by limiting auto-scroll to attachment
box only when explicitly chosen by the user.

closes odoo/odoo#135234

X-original-commit: 7415e24a918ab06d2902bb68932878619d623019
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-13 04:37:07 +00:00
Nishit Thakkar ce169a38ed [FIX] tools : Save translation for record with no model data record
According to standard flow when a record is created by user we do not make
a model data entry and if he does any changes in standard record we change the
noupdate to true on conditional bases to keep the data same while upgrading
but in the case of user created record where there is no model data entry the
engine should consider it as noupdate true but without the model data entry
select query gets null resulting into engine considering it false and the update
case are designed to consider true or else  so for null case it falls under else
part hence creating issue in product_template name and cowed website menu
So,we have updated the case accordingly.

closes odoo/odoo#135218

X-original-commit: 880538db4ac4833322e57adb3b4d8239eb382547
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-09-13 04:37:06 +00:00
Jinal Patel 6cb30f599e [FIX] tools: Avoid to delete translation for website
- If default language of website is not en_US then it's
  translation will be lose after upgrade as till now we are
  considering en_US as a default language for all the records.

- In this commit, we have added translation for website which
  is having different default language.

Opw: 3186741, 3418725
X-original-commit: 2575dff9362ba6dd2a97db8911ac8b867b126e08
Part-of: odoo/odoo#135218
2023-09-13 04:37:06 +00:00
Brieuc-brd 761320ae45 [FIX] web: adapt scroll on setting app selector
Prior to this commit, the setting page had 2 vertical scrollbars, which
wasn't clear to use on mobile.

This commit changes the scrolling orientation of the app selector on
mobile to make it easier to use in small screen.

task-3349528

closes odoo/odoo#135214

X-original-commit: 4b8d93799c32a62f16200a88ad32000203918d63
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-13 04:37:04 +00:00
Alexandre Kühn d064d3728d [FIX] mail: do not autoscroll attachment box when initially open
Before this commit, when a form view choose to open attachment box
initially and chatter is at bottom, opening the form view was
scrolling down to the attachment box.

The auto-scroll to opened attachment box is desirable when the
user explicitly interact with the attachment button, to show
the attachments. However, it should not be triggered when opening
the form.

This commit fixes the issue by limiting auto-scroll to attachment
box only when explicitly chosen by the user.

closes odoo/odoo#135205

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-13 04:37:02 +00:00
sofiagvaladze 7e20111e48 [FIX] hr_homeworking: show location correctly
current behavior:
If you have a weekly location defined on the employee,
and a exeptional, location for that day defined on the Calendar,
the presnece icon shows weekly and not the exceptional.

Expected behavior:
Presence icon should be based on the exceptional location,
and if there are none, take the weekly one.

task-3482527

closes odoo/odoo#135191

X-original-commit: cbb4d588e3a1dd1f89f19ac3a413bd531f8a5729
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-13 04:37:01 +00:00
Didier (did) 8e2d0e9f8d [IMP] mail: port test from 135122
This PR import the test created in https://github.com/odoo/odoo/pull/135122

closes odoo/odoo#135183

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-13 03:38:09 +00:00
Nasreddin Boulif (bon) 42203ac2f2 [FIX] mail: return str instead of bytes when post processing attachment
Steps to reproduce:

  On Odoo:
  - Install `Documents` module
  - Go to `Settings` and set a Custom Email Server(ex. `mydomain.com`)
  - Ensure an alias exist for the model `document.document` with `inbox-financial` as alias name

  In mail client:
  - Send a mail with an image in the body to the following email: inbox-financial@mydomain.com

Issue:

  Mail not received (traceback in logs)

Cause:

  Since we use the email alias `inbox-financial`, we process the mail
  through the `document.document` model where we have an override of the
  `_message_post_after_hook` method that is called after that the
  `msg_values` values are post-processed and where we do another
  message_post() for the new document create for the attachment (in
  this case, an image).

  https://github.com/odoo/enterprise/blob/2c3596e4e18c201809558d3ea878b141e366a027/documents/models/document.py#L305

  During the parsing, the mail values are updated through the
  `_process_attachments_for_post` method:

  https://github.com/odoo/odoo/blob/6c0d2d7a9d44459f3e09a38bd80ef9b018e8c946/addons/mail/models/mail_thread.py#L1881-L1904

  On posting the first time, the original type of the `body` value is a
  `str`, but the post-processed value (because there is some CIDS in the
  body) is of type `bytes` (because using `encoding='UTF-8'` with
  `lxml.html.tostring`).

  https://github.com/odoo/odoo/blob/510a997017a9cbe14522a0013a578f6d1d9b257a/addons/mail/models/mail_thread.py#L2209

  Then in the `_message_post_after_hook` we call post again on the
  newly created document record by using post-processed value of body
  who is of type `bytes`.

  On posting the second time (for the document record), the `body`
  value is of type `bytes` and when checking if the body is empty with
  `is_html_empty` that received a string as param, an error is
  raised.

Solution:

  Use `encoding='unicode'` to return a string instead of bytes.

  https://lxml.de/api/lxml.etree-module.html#tostring

opw-3273583

closes odoo/odoo#135172

X-original-commit: 394031561179af6930eb71fcf7017f8f9d285aed
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-09-13 03:38:08 +00:00
aliya e12e0b0caa [FIX] account: fix the bank account onboarding
If a bank account is added through the onboarding step and the user creates one instead of linking it,
the dashboard is not reloaded to show the completion of the step and the new account.
To make sure that the view is reloaded to show new data,
the easiest fix would be to return a reload action in `validate`.

task-3431961

closes odoo/odoo#135170

X-original-commit: cc793b303da5ea2dbe931bac1da266a121429ede
Related: odoo/enterprise#47302
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-09-13 03:38:05 +00:00
Saurabh Mishra a96e9fa184 [FIX] l10n_ch: display qr bank options in ch localization
When a user having CH Company tries to Add a Bank Accout then they will face the
issue.

Steps to produce:
- Install `l10n_ch`.
- Change company to CH Company.
- Invoicing > Configuration > Banks > Add a Bank Account.

Applying this commit will solve the issuse by allowing the user having
CH Company to add a bank accout. The user was facing the issue because
of the code:
https://github.com/odoo/odoo/blob/2476a3ae2e3ed66875a2ea855be640d127b58cf2/addons/l10n_ch/wizard/setup_wizards.py#L21
In above code `self` is passed in as an arguement in the compute function
while calling the function which is invalid.

Error: `TypeError: ResPartnerBank._compute_l10n_ch_display_qr_bank_options()
takes 1 positional argument but 2 were given`

sentry-4389863088

closes odoo/odoo#135169

X-original-commit: aa22fd8c51b635dd084520e108eb7452a91ca032
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Mishra (sami) <sami@odoo.com>
2023-09-13 03:38:01 +00:00
Nicolas Martinelli 95de052040 [FIX] website_sale: add index to website_sequence
On a DB with 2M+ products, the computation of the
`_default_website_sequence` [1] takes several seconds. In case of a
product creation in batch, it can negatively affect the whole
server performance.

Adding an index solves the problem.

[1] https://github.com/odoo/odoo/blob/1b9c7fecc5b4031c5d7b9bbe4f26e1e510063d12/addons/website_sale/models/product_template.py#L368

closes odoo/odoo#135164

X-original-commit: 44c707814f1d415a5b13086942188629b0bb7d28
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2023-09-13 03:38:01 +00:00
Eteil Djoumatchoua(etdj) 81136e4dc9 [FIX] stock_account: Display the value field on StockQuant list view
Steps to reproduce:
- Go to Inventory -> Reporting -> Location.
- Enable the 'Value(value)' to be displayed on the view.
- Group by Location.

Issue:
There is no value displayed under the 'value' column

Reason:
When overriding the ``_read_group()`` in ``StockQuant``, in the stack it's called by the ``BaseMode.read_group()`` where the
aggregated fields are computed. As ``StockQuant.value`` is a computed field(not stored), it will never be part of it
https://github.com/odoo/odoo/blob/6d785a9cacf9f592eb76e8edccabf514bf348f08/odoo/models.py#L2516.
So when entering the ``StockQuant._read_group()``, ``{'value:sum'}.isdisjoint(aggregates)`` will always be true.

opw-3440766

closes odoo/odoo#135150

X-original-commit: 4fb6415c8ddfbcf691b92441e72fbfda6f2f3875
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Eteil Junior Djoumatchoua (etdj) <etdj@odoo.com>
2023-09-13 03:37:59 +00:00
Gauthier Wala (gawa) 4a24d76170 [FIX] l10n_pl_jpk: rename table of tax offices
_name should have a separator ".", separating the model and the module.

closes odoo/odoo#135144

X-original-commit: e1672460399bc6ce53431450d24b6f345e062640
Related: odoo/enterprise#47293
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2023-09-13 03:37:57 +00:00
Gauthier Wala (gawa) 7582e66c71 [IMP] l10n_pl_{jpk/sale_stock}: Add fields necessary for JPK
For the JPK and the EDI, a lot of additional informations are needed.
We provide them in community, so it's available later for EDI.

The delivery date is needed in Poland, and we compute it if
sale_stock is installed. It will be done later for all localizations,
but not in stable, so we will merge it with the other ones later.

X-original-commit: 8b14d098a65b84a842514e644b262a0d714f4b48
Part-of: odoo/odoo#135144
2023-09-13 03:37:57 +00:00
Gauthier Wala (gawa) 4f3b6a1dfc [FIX] l10n_pl: tax report and tax changes for JPK
Some taxes and tax report lines are needed for the export of JPK
(and EDI that will be done later)

X-original-commit: c496d5b85d7ec226f4a28db95b07f747c6b6ec37
Part-of: odoo/odoo#135144
2023-09-13 03:37:57 +00:00
tsm-odoo 4be75dd002 [IMP] im_livechat: allow visitors to receive calls
task-2900771

closes odoo/odoo#135109

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-13 03:37:56 +00:00
Vraj Panchal eaf7e6d581 [IMP] mrp_subcontractiong: hide action button on portal
Remove the cogs icon on the subcontracting portal page.

task-3471491

closes odoo/odoo#135090

X-original-commit: f02aeeb30180bdc096442fcf82df6f0a0c70fdb9
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-09-13 03:37:55 +00:00
miad-odoo 5a6fbaacc7 [FIX] mass_mailing: fix finding duplicate mails
Before the commit, the _get_seen_list() function in the mass_mailing module was
not able to correctly identify all the duplicate email addresses in a given mass
mailing. This was because the function chose and used only one way to find an
email address for each record in the mailing list, even though there are many
ways to find an email address for a record.

For example, a crm.lead record might have an email address in its partner_id
field, but it might also have an email address in its email_normalized field.
This can vary from record to record.

To fix this issue, the _get_seen_list() function was updated to only look at the
email address to which emails have already been sent, rather than trying to
fetch it from the record itself. This ensures that all duplicate emails are
correctly identified and that no duplicate emails are sent in the mass mailing.

Task-3234378

closes odoo/odoo#135081

X-original-commit: 66f9aa25af049aa3faf0f76475a4a2b63b5d0903
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-13 03:37:54 +00:00
padh-odoo c29d8ea52b [IMP] sale: improve sale product catalog button color
Improve the color of quantity selector and add button.

- Currently, if we look at the selected quantity, it is not that visible on the
  projector.
- The color of the quantity selector and button change to primary and secondary
  respectively.

closes odoo/odoo#134244

Task: 3489423
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-13 01:34:55 +00:00
Katherine Zaoral 0a41d64d18 [ADD] l10n_ar_pos: new module
closes odoo/odoo#133881

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-12 22:12:54 +00:00
Miquel Raïch c93a57ccab [IMP] models: only log "long name constraint" when the constraint is added
This way, we avoid spamming the log each time new constraints are added in the constraint's table.

closes odoo/odoo#132681

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-09-12 22:12:53 +00:00
Gabriel de Paula Felix (gdpf) 69d23262f8 [IMP] microsoft_calendar: Credentials module and don't sync old events
Before this commit, when the first synchronization with Outlook Calendar was done or when the synchronization was restarted, all events previously created in Odoo (before synchronizing) were being synced with Outlook, triggering lots of emails and notifications for attendees. Additionaly, all microsoft credentials information were concentrated within the res_users file, difficulting updates in this file.

After this commit, only events created or updated after the synchronization starts (or restarts) are synced with Outlook Calendar, with 5 minutes of time acceptance for avoiding network delay issues. Moreover, a Microsoft Credentials module was added for gathering microsoft credentials in one place.

closes odoo/odoo#128150

Task-id: 3410651
Related: odoo/upgrade#5047
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-09-12 20:52:14 +00:00
Nasreddin Boulif (bon) 3f55f57c44 [FIX] calendar: allow admin to edit any event
Steps to reproduce:

  - Install `calendar` module
  - With demo user, go to calendar and create a new event
  - With admin user, go to the calendar and try to edit the event

Issue:

  Admin can't edit the event.

Cause:

  Only allowing the user who created the event or who is in the
  attendees list to edit it.

Solution:

  Allow to edit the event if user is admin (or created the event
  or is in attendees list).

opw-3185743

closes odoo/odoo#135071

X-original-commit: bf79086886e053c9f7fa2f784297bcb9b1e8d51d
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-09-12 17:16:29 +00:00