Commit Graph
149917 Commits
Author SHA1 Message Date
Alexandre Kühn 03b59ae410 [IMP] mail: move component handlers to models (step 5)
This commit moves some handler methods from components to models,
as a step closer to having most of business code in models.

Having business code in models is desirable so that the code is much more maintainable:
easier to change and more robust code.

Task-2579306

closes odoo/odoo#88878

Related: odoo/enterprise#26277
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-15 19:08:35 +02:00
qsm-odoo 1f3683a83a [FIX] web_editor: properly display colorpickers in all languages
Before this commit, the tab labels of the colorpickers were too long
in some languages (e.g. German) making them overflow and making the UI
impossible to use in some cases. Indeed, the bug was different depending
on where the colorpicker was:

- In the text tools, the colorpicker overflew the whole panel, making it
  impossible to use

- In the snippet options, the colorpicker buttons were cropped without
  ellipsis making them impossible to read

- In the backend, as the toolbar is floating, it was ok but the code was
  quite dependent of the other colorpicker-related scss

This commit solves those problems and unifies the way colorpickers look
independently of their position (always full width, the buttons fill the
available space, if the buttons are too long they are cropped with
ellipsis, they have a title on hover and are always aligned on the
left of the tabs area).

opw-2786778

closes odoo/odoo#88844

X-original-commit: a4755218f239e5c00e9c6a23321654a3ab029470
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-04-15 19:08:31 +02:00
Adrien Schoffeniels 04f8331d18 [FIX] survey: Fix cropped out timer on mobile devices.
This commit fixes the timer that was cropped out when taking a
survey having a time limit on mobile devices.

Task-2810299

closes odoo/odoo#88910

X-original-commit: 6c7f8eeb275d8de9e06fe70cde293e18beb8fc01
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-15 18:08:00 +02:00
Agustín Castro Bugallo e2a2e9a5bb [FIX] hr_holidays: Explicitly set permit on rule
In v15, the rule `hr_leave_rule_employee_unlink` has been modified.
Because of that, during an upgrade to v15, the rule is reloaded from the
security xml.

If the rule had been edited and `perm_unlink` was set to False, since its
value is not explicitly stated in the xml, the upgrade will fail by
violating the constraint `ir_rule_no_access_rights`.

Related:
https://github.com/odoo/upgrade/pull/2127
https://github.com/odoo/odoo/pull/65361

closes odoo/odoo#88908

X-original-commit: b3994a0277a165ceedd2e8df1f31da7044b8d33e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-04-15 18:07:56 +02:00
Sébastien Theys 9a21cb48e4 [IMP] im_livechat: legacy: remove obsolete seen code
task-2825192

closes odoo/odoo#88904

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-15 16:45:48 +02:00
jlzhou 294a9b7a7a [FIX] mail: fix "you are not allowed to delete 'Listeners of a Channel' (mail.channel.partner) records" issue:
To reproduce:
1. Start a meeting in Discuss or start a group conversation of V15, then try to leave this channel by clicking channel's x button in the page's left side `DIRECT MESSAGES` list.
2. After clicking `Leave` button in Confirmation dialog you will get Access Error prompt: Due to security restrictions, you are not allowed to delete 'Listeners of a Channel' (mail.channel.partner) records.

Cause and Solution: the computed field value:
Since in the middle of process, outdated.channel_id.channel_partner_ids doesn't contain current env.user, to bypass access rule restriction we need to use sudo().unlink()

closes odoo/odoo#88897

X-original-commit: b3d371a4380305a2ea8fd14c30432e6ddbd9cb35
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-04-15 16:45:44 +02:00
Nicolas (vin) cb63a0bc52 [FIX] account: duplicate bank account redirect action
There is an issue where we redirect to a list view/form view of
res.partner but with id's from res.partner.bank, thus redirecting to
the wrong views.

closes odoo/odoo#88865

X-original-commit: a1cce790fcd2d1823fb9e3d5c3c3e916d34568e5
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-04-15 15:28:55 +02:00
Alexandre KühnandSébastien Theys d81c77234d [IMP] mail, *: tests: use mail.channel.partner for seen indicator
* = hr_holidays, im_livechat, website_livechat

Task-2810539

closes odoo/odoo#87587

Related: odoo/enterprise#25911
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2022-04-15 15:28:49 +02:00
Alexandre Kühn 75b75fbced [FIX] mail:tests: ignore deleted records in removed record of _updateComodelRelationalFields
Part-of: odoo/odoo#87587
2022-04-15 15:28:48 +02:00
Dossogne Bertrand a5ff710a8b [IMP] hr_holidays: improve mobile experience
- The dashboard list view is replaced by a kanban view.
- When you have a time off with a joined document when you click on it, the attachment view is now kanban and not list. The dropdown in the kanban card allows to download the file.

taskID #2658415 [Time Off] Mobile experience

closes odoo/odoo#84667

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-04-15 15:28:43 +02:00
Merlin (megu) 39ef0e91c4 [FIX] website_slides: show lesson content's resources correctly
Additional resources of a lesson content are displayed twice, once as a
link and an other time as a file

Steps to reproduce:
1. Install eLearning app
2. Go to the website
3. Go to Courses and open course 'Basics of Gardening'
4. Open the first chapter 'Gardening: The Know-How'
5. Exit fullscreen (on the top right)
6. In the course content, the file 'Document' is displayed two times and
the link doesn't work

Solution:
Display the resource as a link or file depending of its type

opw-2811279

closes odoo/odoo#88879

X-original-commit: 924c3e849f9f5b2408cefc913ee1d72243417feb
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-04-15 14:27:15 +02:00
Nemael 3b87a36683 [IMP] im_livechat: split public_livechat.js into many files
Follow-up of: https://github.com/odoo/odoo/pull/87597

This is the 2nd and final step of splitting public_livechat.js
into several files.

This is part of refactoring public livechat so that it uses
essentially the same codebase as discuss in the web client.

Splitting in smaller files helps following steps to refactor
the code.

Task-2818675
Part of Task-2212347

closes odoo/odoo#88654

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-15 12:30:45 +02:00
anhe-odoo c225996bb0 [FIX] delivery: remove wrong currency conversion for delivery carrier price
Observed Behaviour

When using a pricelist with a fixed price for all products with a different
currency than the one of the company, adding shipping cost in a sale order
using this pricelist will give a wrong value of the shipping cost

Expect Behaviour

The computed shipping cost added in the sale order should be the same as the
fixed price defined in the pricelist

Reproducibility

This issue can be reproduced using the following steps :
1. Define a pricelist PL1 with a fixed price for all products and a different
currency than the one used in the company (eg fixed price to 15KR)
2. Create a sale order and select PL1 as pricelist
3. Add a product and add a shipping cost

The shipping cost should be the defined fixed price (15KR) but it gives
another value, depending of the company currency

Fix Description

This fix remove a useless currency conversion coming from the fact that since
https://github.com/odoo/odoo/pull/86484 we get the delivery price from the SO
priceliste (using  pricelist.get_product_price) giving us a price that  is
already converted to the correct currency

Related issue/PR

opw-2810506

closes odoo/odoo#88861

X-original-commit: 25e2f403e88172d67ea6ce382ac1e3f5e0e37835
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Hendrickx Anthony (anhe) <anhe@odoo.com>
2022-04-15 11:31:59 +02:00
oco-odoo 430722daf1 [FIX] l10n_ch: use consistent name on QR bill when using acc_holder_name on bank account
When setting acc_holder_name on the bank account receiving the payment of a QR-bill, acc_holder_name was used instead of the company's name inside the QR-code, but not on the summary text displayed next to it. This fix replaces the company name there as well. The behavior is unchanged when acc_holder_name isn't set.

closes odoo/odoo#88804

X-original-commit: e37d43d52d56e55291f9deb0eb76b5cd3863739e
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
2022-04-15 11:31:53 +02:00
Odoo's Mergebot 68ef2a36f4 [IMP] {,website_}sale: improve inheritance capabilities
This PR introduces multiple changes to improve potential inheritance regarding
products.

Purpose
======

Be able to sale products on eCommerce that have some specificities regarding
their price computation. For example, accommodation price depends on the duration
of stay, or rental product price depends on the duration of the rental.

Specifications
===========

This PR introduces some hooks or methods as :
- Add kwargs to price compute methods in order to give some additional parameters
- Allow adding optional parameters to product/cart rpc to give additional information
  concerning product.
- Make the cart-quick-add button displayable with a given condition on the product.
- Regarding stock on eCommerce, improve the inheritance of the cart quantity and
  the free quantity computation (which may depend on the temporality). It also allows
  to increase the inheritance potential of the computation of the max quantity of products
  that can be added to cart.
- The stock warning field is now added in the eCommerce module to allow other
  eCommerce modules to take advantage of this message prompt.

task-2382027

See also https://github.com/odoo/enterprise/pull/23741

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#83359

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-04-15 11:31:44 +02:00
Patrick Hoste a73393d1b5 [IMP] website_slides_forum: avoid error message when selecting forum
SPECIFICATION

Before this commit when setting a forum which was already selected
by another course one got an error message when saving.
This commit avoid this error message by only displaying the forum
which have no course attached to them.

LINKS

Task-2791247
PR : odoo/odoo#86584

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-15 10:32:45 +02:00
Audric Onockx (auon) d42e7e1991 [FIX] hr_holidays : keep leave out of approver's calendar
Steps :
Install modules hr_holidays and google_calendar;
Log into Odoo with two different users, one manager and one employee (subordinated): f.e. Admin e Demo;
Set Google Client ID and Google Secret with a OAuth2.0;
Check if in Odoo's Calendar the Synched with Google tag compares on the right (with manager);
From employee user, go to Time Off -> My Time Off -> My Time Off Requests and Create with a date;
From manager user, go to Time Off -> Managers -> Time Off and accept the time off created;
Go to manager's Google Calendar.

Current behavior:
Google event is created and visible for manager, employee has an event since is an attendee of the first.

Expected behavior:
Google event is created and visible for employee, manager is not involved.

Fix:
Group the leaves with user and create events with this user.
We could not modify easily the behavior of the calendar sync modules.
The following approach was tested: odoo/odoo#86385
But it has some side effects on recurring events, oultier events
(events not following the recurrence) and could bring performance issues.
The solution of this fix was chosen because it is less intrusive.

opw-2761158

closes odoo/odoo#88607

X-original-commit: ce96dd4f7488ce66d3fda5fd09a4566424c52bd2
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Onockx Audric (auon) <auon@odoo.com>
2022-04-15 09:26:41 +02:00
Nicolas Lempereur (nle)andNasreddin Boulif 35b74b1b42 [FIX] web: use latin as numbering system for dates in sample datas
Steps to reproduce:

  - Set a new DB without demo data
  - Install Ecommerce
  - Switch language to Arabic
  - Try to open website module

Issue:

  Traceback raised.

Cause:

  When generating random sample data for website dashboard, it will use
  the current local to generate dates (in the given format), who in this
  case have a non-latin numbering system, and therefore will break when
  trying to parse field value.

Solution:

  Use `serializeDate` or `serializeDateTime` to format datetime (with
  `latn` as `numberingSystem`).

opw-2743243

closes odoo/odoo#88840

X-original-commit: 5597912ad65e0b98c498f95ba884b9581a737211
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Co-authored-by: Nasreddin Boulif (bon)<bon@odoo.com>
2022-04-14 21:34:47 +02:00
Xavier BOL (xbo) 4b9bec96d0 [FW][FIX] project: add same rules than project.update for milestones
Before this commit, the internal user can access to all milestones
created in Project app even if he has no access to the project related.

This commit adds the rules for the project.milestone to filter the
records when the user is not a Project Manager.

closes odoo/odoo#88819

X-original-commit: 6438d8e690229b27ab08ecac436e54a85096eb0f
Forward-port-of: #88546
Forward-port-of: #88509
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-04-14 19:56:03 +02:00
Xavier BOL (xbo) 82b992fb89 [FW][FIX] project: remove uneccessary read access for portal user
Before this commit, the portal user can read the `project.update`
and `project.milestone` records but there is no reason to grant this
access for those models.

This commit removes the read access for thoses models since we don't
show the data in its portal.

X-original-commit: f0331531826974ddaab5dff28739115c37a351c0
Forward-port-of: #88546
Forward-port-of: #88509
Part-of: odoo/odoo#88819
2022-04-14 19:56:03 +02:00
John Laterre (jol) 2c19d2c78b [FIX] account: trigger show_credit_limit on partner creation
The Credit Limit group on the res.partner record
doesn't appear until you save the record.

This means you have to perform extra clicks
if you want to edit this value.

The goal is to show the `credit` field on the accounting tab
on creation if `res.partner` is a company and
Credit Limit setting is activated.

task-2817650

closes odoo/odoo#88830

X-original-commit: 0ac5f58d4d4786a0b86bf0b71406d7d2c5d470bf
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: John Laterre <jol@odoo.com>
2022-04-14 18:57:48 +02:00
gawa-odoo a0830a3b74 [IMP] l10n_pk: adding icon
Adding icon module with Pakistani flag

closes odoo/odoo#88810

X-original-commit: e043cf744fbe55434ebc32687a0a6a92dd11e0a5
Related: odoo/enterprise#26236
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2022-04-14 18:01:45 +02:00
gawa-odoo eb5785c095 [FIX] l10n_pl: fix tax report Poland
Instead of doing the difference between output tax and input tax, the tax report was doing the sum.
This commit fixes this computation without revamping the rest of the report

closes odoo/odoo#88774

X-original-commit: df0372a168db184c03fd901359fec6abd08f5bdd
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2022-04-14 15:11:38 +02:00
Audric Onockx (auon) 6126add2fd [FIX] hr_holidays : set allocation with enough days left
Steps :
Create a Time Off Type T.
Create 2 Allocations :
	> Type : T
	> Start date : monday D
	> End date : /
	> Number of days : resp 4 and 1
	> Employee : Admin
Create 2 Time Off Requests :
	> Type : T
	> Dates : resp monday D to thursday and friday to friday.
Validate both.

Issue :
Allocation's days taken are resp 5.0/4.0 and 0.0/1.0.

Cause :
We set allocation to leave before validating.
To do so, we take the alloc with max allocated days.

Fix :
Take the alloc with max days left = allocated - taken.
Recompute the allocation before validating,
to check that enough days are left.

opw-2812534

closes odoo/odoo#88773

X-original-commit: b0bace129e3f9a4876c2cefb2c24cbcb76d8b0c6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-04-14 15:11:34 +02:00
Nicolas (vin) 66e0e4086b [FIX] account_*: payment method journal filter
Fix two issues linked to payment methods and their journal link.

SEPA Credit Transfer was marked as only available on EUR journals, but
from what we have been told, and we have seen, it should also be made
available for other currencies (CHF/SEK).
So we are changing the rule used to determine if SEPA Credit Transfer
is available on a journal to allow to use it on journals using CHF or
SEK as a currency.

There is another issue, where the filtering is done differently at the
journal creation and when the user add the payment method manually in
the lists.
The filter rules were not respected at the journal creation, which
would lead to incorrect default inbound and outbound payment method list.
For example, a new journal would have the company currency (let's say,
USD) but still have SEPA Credit Transfer (EUR,CHF,SEK) added on it by
default while it should not be available there.

opw-2777522

X-original-commit: 0ad8faf3bfc7b28e5668c3445fcc06c24ad98354
[FIX] account_*: payment method journal filter

Fix two issues linked to payment methods and their journal link.

SEPA Credit Transfer was marked as only available on EUR journals, but
from what we have been told, and we have seen, it should also be made
available for other currencies (CHF/SEK).
So we are changing the rule used to determine if SEPA Credit Transfer
is available on a journal to allow to use it on journals using CHF or
SEK as a currency.

There is another issue, where the filtering is done differently at the
journal creation and when the user add the payment method manually in
the lists.
The filter rules were not respected at the journal creation, which
would lead to incorrect default inbound and outbound payment method list.
For example, a new journal would have the company currency (let's say,
USD) but still have SEPA Credit Transfer (EUR,CHF,SEK) added on it by
default while it should not be available there.

opw-2777522

closes odoo/odoo#88677

X-original-commit: e2cd91ad8339f73b2547bc839e675443528f3adf
Related: odoo/enterprise#26172
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-04-14 15:11:27 +02:00
Thibault Libioulle efb0fca0c8 [REF] website_sale: factorize tax computation in combination info
This commit factorizes price computation in combination info to avoid
code duplication.

task-2382027
2022-04-14 14:33:23 +02:00
Thibault Libioulle 1518cd6ef9 [IMP] website_sale_{comparison,wishlist}: disable quick add to cart
This commit handles the disabling of the add to cart button optionnally.

task-2382027
2022-04-14 14:33:23 +02:00
Thibault Libioulle 3880bee744 [IMP] {,website_}sale_product_configurator: add hooks
This commit adds hooks to improve inheritability capabilities.

task-2382027
2022-04-14 14:33:23 +02:00
Thibault Libioulle c1ddbe2704 [IMP] website_sale_stock{,_product_configurator,wishlist}: add hooks
This commit adds hooks to give more flexibility and modularity.

It allows inherited modules to give their own definition of the cart
quantity and free quantity, which may be business specific (like for
rentals).

It also takes advantage of the definition of shop_warning in the
website_sale module.

This commit fixes a glitch when the wishlist message is displayed too
fast, faster than the stock message. The message is removed by the
promise in VariantMixin, _onCombinationChangeStock.

task-2382027
2022-04-14 14:33:23 +02:00
Thibault Libioulle a0e6ffc7dd [IMP] website_sale: improve inheritability on cart updates
This commit adds hooks to give more flexibility on cart updates. It
allows to add parameters when a product is added to a cart. It gives a
method to disable the quick add and multiple hooks for further smooths
developments.

task-2382027
2022-04-14 14:33:23 +02:00
Thibault LibioulleandVictor Feyens a7f30ce917 [IMP] product,sale: factorize price methods to improve inheritability
This commit adds an higher flexibility to pass optional args through the
price computation methods.

Those optional kwargs offer the opportunity to tune the price
computation, especially to tune the price_compute method on
ProductProduct and ProductTemplate.

On sale order line models, one can define some fields that should be
passed to the price_compute method in order to tune it.

task-2382027

Co-authored-by: Victor Feyens <vfe@odoo.com>
2022-04-14 14:33:23 +02:00
Thibault Libioulle 7ac5ffa8aa [IMP] product: factorize contextual price
This commit factorizes contextual price in order to ease further
inheritance.

task-2382027
2022-04-14 14:33:22 +02:00
roen-odoo d8568944b4 [FIX] website, website_blog: remove stars from blog description
Current behavior:
When adding a "Heading" in the first 200 characters of a blog with
/Heading, the short description of the blog preview would have
unwanted stars (*) around the heading

Steps to reproduce:
- Create a blog article
- In the first 200 characters of the blog use a heading (e.g. /Heading1)
- Go back to the blog list, the description of the new article contains
  unwanted stars (*)

opw-2798595

closes odoo/odoo#88352

X-original-commit: 6cb57d2f1ffb0adceaa3199cc0bf5140589d9328
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-04-14 14:07:05 +02:00
Thanh Dodeur 557bb28cff [FIX] mail: ensure that voice threshold is updated across tabs
Before this commit, updating the voice activation threshold in one tab
would not affect the other tabs as the localStorage was only read when
discuss was initialized.

This commit fixes this issue.

task-2679234

closes odoo/odoo#88154

X-original-commit: 80c81c70787952eb4fdc4b81210bdf2893210e1a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-14 14:07:01 +02:00
Guillaume (guva) 71050fb0fe [FIX] l10n_nl: traceback on purchase journal creation
With l10n_nl, create a purchase journal -> traceback
Ids was appended to ORM command list, instead of the ids list.
Moreover, it was filled even if there were no missing value.

opw-2801012

closes odoo/odoo#88732

X-original-commit: 2d6d6e81f53239942f549b16b11faf1b8f77cf41
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-04-14 13:04:52 +02:00
Goffin Simon a110ddc509 [FIX] delivery: Terms not translated in the partner lang
Missing translation

opw:2782254

closes odoo/odoo#87891

X-original-commit: 863537b927d3fa502385e03c58741efccd9e2545
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Simon Goffin <sig@odoo.com>
2022-04-14 12:01:47 +02:00
Tom De Caluwé e73fa8f671 [IMP] web_editor: test adding nested editables
Commit e834173314f00e36cb3a1f99690d9f220584682c fixed an issue where editable
elements could not be removed if they were nested in a non-editable element,
because the editor considered them to be an editable root.

However, the same logic also applied when doing a history step after adding
such an element. Adding a nested editable element would make the history step
invalid and result in a rollback.

Such a situation can be encountered when adding a recaptcha legal notice to a
website form. The footer of the form is a non-editable paet of the document,
however the legal notice can still be updated by the user. This commit adds a
separate test for the addition of such editable elements that were previously
considered unremovable.

opw-2723017

closes odoo/odoo#88733

X-original-commit: f693e8ed27f753a728d903dfe4d7d10ae1334526
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-14 10:50:07 +02:00
abd-msyukyu-odoo 42a42ebcfb [IMP] web_editor: flag only editable as unremovable
Prior to this change, if a contenteditable=true element was a child of a
contenteditable=false element, it was always flagged as unremovable=true.

In fact what should happen is that this.editable should be unremovable, but one
of its subchildren can be contenteditable=true while having a parent
contenteditable=false and not be unremovable.

Task-id: 2794990
X-original-commit: 72e2fd7439a0d6e44b5082def35079019371a3b7
Part-of: odoo/odoo#88733
2022-04-14 10:50:07 +02:00
Benoit Socias 0c5c2a37a5 [FIX] website_blog: remove negative word spacing in blog snippet
Since [1] when the blog layout was refactored between 12.0 and 13.0, a
negative word spacing was introduced in the blog post snippet with the
big pictures layout.

This commit removes this negative word spacing.

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

task-2822436

closes odoo/odoo#88729

X-original-commit: c0e86be9074a0d72e6119801c7992232e9e32068
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-04-14 09:38:51 +02:00
Guillaume (guva) 4432ce5f7f [FIX] purchase_stock: price diff on vendor bill
Steps to reproduce:

• Create Record: Product Category
- Costing Method: Average
- Inventory Valuation: Automated
- Specify a price difference account (may create new account).
- Ensure Stock Interim (Received) account is reconcilable.

• Create Record: Product
- Product Type: Storable
- Cost Price: 1.01
- Product Category: New Product Category

• Create bill with this product, for a quantity of 10.5

-> The is price difference of 0.1

Issue comes from this commit 286ea6b681e9ba77357f91b546052449f6342f20
which doesn't round if there is a discount.

With this commit we isolate the latter case in order to keep the
price unit rounded if there is no discount.

closes odoo/odoo#88734

X-original-commit: 643d91ef5ebfb29fde142294ced82c470d42c136
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-04-14 07:17:53 +02:00
Nasreddin Boulif (bon)andRomain Derie a50465bb3c [FIX] website_sale: archive pricelist if website have another available
Steps to reproduce:

  - Install eCommerce module
  - Select company A and set only one pricelist with:
    - company = company A
    - website = website of company A
  - Select company B and set multiple pricelist.
  - Switch to company B
  - Archive a pricelist

Issue:

  Error: "With this action, "Website of company A" website would not
  have any pricelist available".

Solution:

  Use sudo() when searching websites to don't use multi-company
  compliant ir.rule `product_pricelist_comp_rule` (in website_sale) when
  getting pricelist_ids (and therefore allow checking all pricelists for
  all websites in all companies).

opw-2759069

closes odoo/odoo#88703

X-original-commit: 4b3404087f4541cf52b84ef668da4055da5ad9e2
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
2022-04-13 22:13:09 +02:00
William Braeckman 84d8bf8167 [FIX] hr_work_entry: fix multi calendar issue with global time off
When creating a global time off in one resource.calendar A , it will be
propagated on any new resource.calendar B.
However the reverse is not true, if I delete the global time off in
calendar A it will not be deleted in calendar B.
During the work entry generation this is not taken into account, a
contract using calendar A will generate leave work entries because of
the global time off in calendar B.
This is due to a change in PR odoo/enterprise#15091.

The domain is now correct and will only fetch the right leaves.

TaskId-2627378

closes odoo/odoo#88725

X-original-commit: 0bac1d33a25e37ebece69de030b9fd72caa43a02
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-04-13 20:42:46 +02:00
Thibault Francois 0597ec0512 [FIX] sale_timesheet: make order_id on analytic line readonly
A field order_id has been introduce on account.analytic.line
in https://github.com/odoo/odoo/commit/dc9ef81ab21cbbf232eca1771ab94dd5a54e9345
to allow to group by order

This field was introduce as related readonly=False.
It has the side effect of modifying the order_id on the sale.order.line
each time a timesheet is created and thus trigger computed field that
are based on that field.

Since the field is only declared for a group by it's pointless to
make it modifiable, it will save a lot a useless computation and avoid
some issue with computed field wrongly triggered

closes odoo/odoo#88714

X-original-commit: 6916e541d272fea64fbc49e451f065b9cd614134
Signed-off-by: Thibault Francois <tfr@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-04-13 19:46:26 +02:00
Alexandre Kühn 3d924aa379 [IMP] mail: move component handlers to models (step 4)
This commit moves some handler methods from components to models,
as a step closer to having most of business code in models.

Having business code in models is desirable so that the code is much more maintainable:
easier to change and more robust code.

Task-2579306

closes odoo/odoo#88692

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-13 18:52:46 +02:00
Nicolas Bayet b995a777ac [FIX] sale: properly cycle through style
Before this commit
At each iteration, the `loop_cycle_number` was reset to 0.
This caused the cycle condition to always be the same.

After this commit
The cycle condition will properly make the style cycle.

closes odoo/odoo#88686

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-13 17:55:53 +02:00
Nicolas Bayet 6134880277 [FIX] web_editor: define toolbar fa button width
On mass_mailing, the button does not have a specifc width.
Defining a width to the button makes the styling more predictible.

Task-2781002

closes odoo/odoo#88679

X-original-commit: 5f5b806559e06aad7f67b66c8da96d15516fcd52
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-13 17:55:49 +02:00
Nicolas Bayet 3be6d3cb8c [FIX] mass_mailing: remove overflow on mass mailing container
The overflow: auto on the container in mass mailing generated a
scrollbar whenever the drag and drop of snippets because
of the drop zones.

Task-2781002

X-original-commit: 2af04ad4798e11bb2c08798dddb04ed32c42992e
Part-of: odoo/odoo#88679
2022-04-13 17:55:49 +02:00
Nicolas Bayet 503f817f0b [FIX] mass_mailing: reduce content of snippet s_call_to_action
Reduce the content of the title to make sure it fits in a single line.

Task-2781002

X-original-commit: 2b87e5617c4cb25c6593df03b752f0c90814a7ff
Part-of: odoo/odoo#88679
2022-04-13 17:55:49 +02:00
Nicolas Bayet 0ad3237767 [FIX] mass_mailing: remove s_mail_block_title_text
Task-2781002

X-original-commit: ab2ba08fc904fd6c9c05407852fe390fd20891f9
Part-of: odoo/odoo#88679
2022-04-13 17:55:48 +02:00
Tom De Caluwé b0108010d0 [FIX] web_editor: make buttons properly translatable
A mechanism is provided by the OdooEditor to circumvent certain problems while
editing links. More specifically, editable zones are patched when editing a
link. This avoids the cursor ending up outside the link whenever the link tag
is emptied.

However, the mechanism does not check if the link is also in the editable zone
before doing so. In translation mode, the editable zones correspond to the
individual translation strings. When translating link texts, this means the
anchor tag containing the translation string is outside the editable zone. The
patching mechanism still applies, resulting in the anchor tag becoming editable
as well.

This causes problems while translating links, for example oDeleteBackward
commands are being rolled back. Checking if the anchor tag is inside the
editable zone resolves the problem.

opw-2780312

closes odoo/odoo#88674

X-original-commit: 99050b26446bbbe949e1fa797210c2a8a68d94cd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-13 16:54:04 +02:00