Commit Graph
170096 Commits
Author SHA1 Message Date
Antoine Dupuis (andu) 9d290e2b8c [FIX] l10n_pt: Minor fixes to CoA
In #87572, the CoA was refactored to follow the regulation for companies
under the general regime, which can be found at
https://www.occ.pt/fotos/editor2/taxonomiasplanocontas_fev2019.pdf

This commit fixes minor discrepancies between our version and the
published regulation.

taskid:3060790

closes odoo/odoo#157780

X-original-commit: 5625baa2dc2b078c6c534a9aa98f122e7f8f20dc
Related: odoo/enterprise#58709
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
2024-03-15 17:30:00 +00:00
Valentin Chevalier 5ac8fb18ca [FIX] sale: post processing issues when creating invoices
Before this commit, when the automatic invoice setting is enabled, a
traceback would be shown when customers pay and the post-processing of
the transaction tries to create an invoice. The problem is that the
 invoice is created in sudo, but it's unsudoed before logging invoices
in the chatter.

Now, the invoice will stay sudoed if the method is called in sudo.

opw-3700576

closes odoo/odoo#157779

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-03-15 17:29:59 +00:00
Akim Juillerat 92cebe3d78 [FIX] account: Do not select wrong partner sharing same name with another
In a single database, you could have two partners who are called John Doe.

Before this commit, any statement line where the partner_name was set
with 'John Doe' would return the last one being created, due to the _order
attribute on res.partner model, even if the statement line was generated
from a payment of the other 'John Doe' (ie first one created).

With this commit, we ensure that the wrong partner is not selected, in
case we cannot differentiate one from the other.

closes odoo/odoo#157754

X-original-commit: 421a0ae53de8c947d68fb1c22066d4d73c1ce9b7
Related: odoo/enterprise#58699
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2024-03-15 17:29:56 +00:00
roen-odoo fafd931990 [FIX] point_of_sale: wrong value in pos sales report
Current behavior:
The pos sale report is showing the wrong value in the "Total (VAT Exl)"
column. The value acutally shown is the total tax included.

Steps to reproduce:
- Create a product with a tax included in price
- Create a pos order with this product
- Validate the order
- Close session and print the pos sales report
- Check the value in the "Total (VAT Exl)" column.

opw-3684937

closes odoo/odoo#157753

X-original-commit: ba58ac0f86e10755f1ffbc80814c3722470517f9
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2024-03-15 17:29:55 +00:00
zel-odoo ac80ba9bcf [FIX] hr: be able to see profile button correctly
Currently, when the user and the target both are in multiple companies,
the profile button cannot be displayed correctly. Since the employee_id
uses `('company_id', '=', self.env.company.id)` rather than `in`.

This commit fixes the issue by checking employee_ids directly and if it
is found, the profile button will be displayed correctly.

We don't care about which employee_id is used if there are multiple,
since the user are in multiple companies as well. If looking for a
specific profile, the employee can be found in the HR application.

closes odoo/odoo#157741

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-03-15 17:29:54 +00:00
Valentin Chevalier 436c1c666b [FIX] website_sale: open configurator with only no variants attributes
Before this commit, the product configurator dialog was not shown when
adding to the cart, a product with only no variant attribute values,
using the buy button on the '/shop' page.

Now, if the product has configurable attributes (custom attribute, no
variant, and dynamic attribute can now be selected), the product
configurator dialog is shown.

opw-3736469

closes odoo/odoo#157737

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-03-15 17:29:54 +00:00
Hubert Van De Walle 43c0f6ea11 [FIX] mail: reload attachments after upload from dropzone
Steps to reproduce
==================

- Go to Accounting > Customer Invoices
- Open any record with no attachments
- Drag & drop a pdf attachment on the chatter

=> The PDF viewer is empty

Cause of the issue
==================

When uploading an attachment from the FileUploader, the parent view is
reloaded.

This is not the case when uploading an attachment from the dropzone.

opw-3748853

closes odoo/odoo#157232

Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-03-15 17:29:50 +00:00
Victor Piryns (pivi) 4685399212 [PERF] account: add missing index on tax_cash_basis_rec_id
Description:
Add missing index on FKey `tax_cash_basis_rec_id` to speed up
deletion of `account.partial.reconcile` records during reconciliation.
It's `btree_not_null` as the relationship is sparse.

Reference:
opw-3649801

closes odoo/odoo#157696

X-original-commit: 3852da88bb48e6bd82618839b5b351246129ebf6
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2024-03-15 15:28:04 +00:00
Yannick Tivisse 094ab73a2a [FIX] hr_work_entry_holidays: Prevent time off duration erasing
Purpose
=======

The time off duration is set to 0 when the related contract is set
as expired, then we remove the end date and set the contract back
to running.

That's because the check was done before calling super, hence the
contract is excluded from the candidates because it is still expired
without end date, which would make no sense when trying to retrieve
the related calendar.

closes odoo/odoo#157681

Taskid: 3806342
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-15 15:28:03 +00:00
Florent de Labarre 8a985113d8 [FIX] base: prevent random ordering
Before this commit, ir.actions.report can be randomed orderer.

closes odoo/odoo#157616

X-original-commit: 1a2b83d8a4fc956e07d6009eb7fc308eb16eedd2
Signed-off-by: Raphael Collet <rco@odoo.com>
2024-03-15 15:28:02 +00:00
ahmad(alah) b3a20345a3 [FIX] calendar: test calendar month view start hour displayed
The `test_calendar_month_view_start_hour_displayed` makes sure that start hour is displayed in calendar month view.
The test was failing before 09:00 AM because after creating the event, it sets the start time to 10:00 without setting the stop time or duration.
So when creating this event before 09:00 with a default duration of 1 hour, the stop time would be before 10:00, and it would raise an error.

This commit aims to fix this issue by adding a step to set the duration of the event, avoiding the potential error.

fixes runbot-59850

closes odoo/odoo#157263

Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-03-15 13:04:50 +00:00
Ethan Vincent 48f796f4d3 [FIX] product: set disp. name to New if creating
**Current behavior:**
When creating a new product template record, the tab title will
be *Odoo - False* until a new name is saved rather than
*Odoo - New*.

**Expected behavior:**
When creating a new record in a form view, the tab title will be
*Odoo - New* until the `name` field is filled out and the record
gets saved (at which point it will be *Odoo - <name>*).

**Steps to reproduce:**
1. Install `sale_management` and go to the product list view

2. Create a new product, observe the misnamed tab title

**Cause of the issue:**
In `product.template`'s _compute_display_name() method, some of
the default values can have a 'False' (str) value which will
evaluate to True (bool), setting the name to 'False'.

**Fix:**
Set the display_name field to a False (bool) value if the
current record does not have a name field set.

opw-3793588

closes odoo/odoo#157258

Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2024-03-15 13:04:49 +00:00
yosa-odoo e98af4fc26 [FIX] account: change typo constraint groupby
Steps to reproduce:
- accounting report > P&L > net profit: set the 'groupby' to 'account_id'
- save
- try to open the P&L -> Invalid Operation

Cause:
During the improvement of the report a small change has been forgotten
The `groupby` has been changed to `user_groupby`
https://github.com/odoo/enterprise/commit/99c82df3d24209de12e2442fd15d2472d9e968f6#diff-bc8d6ed5aa6dab6b7ba46566170cdb7297104580d9b8d6c7081f72e3c2a5a9c4R187-R191
and we forgot to change the `api.constrains`'s args

opw-3714626

closes odoo/odoo#156879

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2024-03-15 13:04:48 +00:00
Walid 3d5d5cc041 [FIX] stock: multistep reciept update quantity
Steps to reproduce:
- Enable 2 step reciept in warehaouse settings

Bug1:
- Create and confirm a PO qty = 1
- Open reciept update qty to 4 and validate
- The internal transfer qty is updated to 3 (the difference)

Bug2:
- In inventory overview create a new reciept and mark it as todo
- Update quantity and validate
- Internal transfer is not updated

Root cause:
Initially in version 17 product_uom_qty was changed to indicate the demand
before the move is done and it indicates the acutual done qty when
the move is done.
After https://github.com/odoo/odoo/pull/130342
product_uom_qty will always indicate the demand qty,
and qty_done will always indicate actually done quantity.

Fix:
updating the quantity will create a new move for the difference that is
used to trigger new push rule and then merged back in the original
when merging product_uom_qty is not updated to keep track of the intial
demand but pending linked moves should be updated to reflect the new quantity

opw-3708740

closes odoo/odoo#156331

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-03-15 13:04:47 +00:00
Sarah Bellefroid c07a0d2193 [FIX] hr_holidays: compute allocation name for manager
Currently when a manager goes to validate an allocation, the name/description of the allocation is not displayed. This introduces the need for manager to name each allocation manually to be able to validate them.

Steps to reproduce:
-------------------
* Open **Time off** app
* On the dashboard, select **New allocation Request**
* Save the allocation as it is
* Select **Management** > **Allocations**
  > Observation : The description field of the new allocation is not filled.
* Select the new allocation
* Validate
  > Observation: Unable to validate, description field required.

Why the fix:
------------
The description of an allocation corresponds to the field `name` in the model `hr_leave_allocation`.

https://github.com/odoo/odoo/blob/e2ad568e6cd4de2d721149eb76d04f58c8510191/addons/hr_holidays/models/hr_leave_allocation.py#L40-L45

In the compute method of this field, the name gets actualy computed in the context of `is_employee_allocation`.

https://github.com/odoo/odoo/blob/e2ad568e6cd4de2d721149eb76d04f58c8510191/addons/hr_holidays/models/hr_leave_allocation.py#L169-L177

We are in the context `is_employee_allocation` either by asking a new allocation from the dashboard, either by being on the `hr_leave_allocation_action_my` view.

https://github.com/odoo/odoo/blob/2bcccbfb910609f6cf54d607d198aae4c5b28b86/addons/hr_holidays/static/src/views/hooks.js#L62-L65

https://github.com/odoo/odoo/blob/2bcccbfb910609f6cf54d607d198aae4c5b28b86/addons/hr_holidays/views/hr_leave_allocation_views.xml#L456

On those two views, the description is computed and readonly. Since the name is readonly, it means that the inverse of the compute method will not get called, thus never setting `private_name`.

https://github.com/odoo/odoo/blob/2bcccbfb910609f6cf54d607d198aae4c5b28b86/addons/hr_holidays/models/hr_leave_allocation.py#L182-L186

When a manager goes to approve an allocation, he goes through **Management** > **Allocations**. The views used are either `hr_leave_allocation_view_tree` or `hr_leave_allocation_view_form_manager`. On those views, we are not in the context `is_employee_id`, the allocation name is no more readonly and the name is required in order to validate the allocation.

For a manager to be able to see anything in the description, the field `private_name` must be set.

https://github.com/odoo/odoo/blob/2bcccbfb910609f6cf54d607d198aae4c5b28b86/addons/hr_holidays/models/hr_leave_allocation.py#L164-L178

This fix aims to create consistency in the creation of allocations. We can observe that the name is not in `vals` in the `web_save` function when creating an allocation through the dashboard or the tab **My Time** > **My allocations**. However, when creating an allocation through **Management** > **Allocations**, name can be found in `vals`.

https://github.com/odoo/odoo/blob/764088d6d5a5a18be451ec26b886691718bef835/addons/web/models/models.py#L69C5-L69C75

`vals` corresponds to `changes` in this function:

https://github.com/odoo/odoo/blob/764088d6d5a5a18be451ec26b886691718bef835/addons/web/static/src/model/relational_model/record.js#L1045-L1051

To have the name added to `changes`, we ultimately need the following condition to be false.

https://github.com/odoo/odoo/blob/764088d6d5a5a18be451ec26b886691718bef835/addons/web/static/src/model/relational_model/record.js#L592-L599

In the manager flow, this is the case as `name` is not readonly. As a regular employee, the only possible way to hae this false while keeping the `name` readonly, is to make it an active field.

`name` in now in `vals` and thus in `vals_list` in the create method. This will thus allow to set `private_name` through the inverse function of name.

opw-3722093

closes odoo/odoo#155767

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-03-15 13:04:46 +00:00
MélanieandYannick Tivisse 941dc4cee0 [FIX] base,hr: Ensure employee/user image at creation
Ensure an avatar is generated based on the employee/user name
if no image is provided at the record creation (for internal users only).

closes odoo/odoo#147446

Taskid: 3637523
Related: odoo/enterprise#58646
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2024-03-15 13:04:43 +00:00
Guillaume-gdi 3e8f9ccbc1 [FIX] website: make font import consistent
[This other commit] introduced a method to serve Google fonts from the
local server. Then it has been back-ported to previous versions with
[this commit].
Unfortunately, the font was not identical when the user chose to load
the font from Google servers versus from the local server. This
discrepancy was due to a missing parameter when downloading the font
file to serve it from the local server. This commit fixes the issue by
adding the missing parameter.

Steps to reproduce the issue fixed by this commit:
- Drop a text block onto a website page.
- Make the text bold.
- Go to the theme tab.
- Change the font to https://fonts.google.com/specimen/Poppins

=> The text style changes depending on whether you checked the "Serve
font from Google servers" option or not.

[This other commit]: https://github.com/odoo/odoo/commit/b06ce21eba6388ce34bbffffadcb489f0e8557dd
[this commit]: https://github.com/odoo/odoo/commit/04ab4e255b7fef1608ee2c70a3a005f3064bc4f3

opw-3775683

closes odoo/odoo#157800

X-original-commit: be2d27e69d7928a46d49a7ef0a3c4b93932a36b8
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2024-03-15 10:43:56 +00:00
Florent de Labarre 7090d14152 [FIX] account_payment : don't copy the journal
During the copy of provider if the journal is set, it create a new account.payment.method.line, and if you change the company of the new provider you have an error when you try to create a new journal.

closes odoo/odoo#157767

X-original-commit: 0357c9ec749d893ba1d7913903fd0c45df400662
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2024-03-15 10:43:55 +00:00
Andrea Grazioso (agr-odoo) e9bdb99124 [FIX] account: payment wizard available journals with one payment type
Create an invoice to partner A, confirm
Create an invoice to partner B, confirm
From Invoice list view, select just one invoice and hit register payment
It will be possible to only select journals having inbound payment
method
Now select both invoices and hit register payment
It will be possible to select any Bank journal, even if both invoice
payments should be incoming

opw-3757686

closes odoo/odoo#157732

X-original-commit: 88f43a454f3cd9207aa62e2e58b67bcfdf0fcb59
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2024-03-15 10:43:53 +00:00
Archana Vaghasiya 114f09ba98 [FIX] microsoft_account: raise the Badrequest if the post data doesn't available
[FIX] microsoft_account: accessing the url without any post data
When a user tries to access the URL directly, at that time the value of
dictionary `kw` is not available. So the error will be generated.

Error : KeyError: `state`

This commit will solve the above issue by raising the `BadRequest` if the value
of dictionary `kw` does not available.

sentry-4377121133

closes odoo/odoo#157720

X-original-commit: 382b64c2f14073cfff1a8ef9290b5c7834d52188
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-15 06:12:46 +00:00
Tanguy Quéguineur 5921dc9c8c [FIX] mail_group: update template to QWeb
Steps to reproduce:
------------------
- Have Website and Mail Group installed
- Send Guidelines for a mailing list through the Website app

Issue
-----
{{ object.mail_group_id.name }} appears in the body of the "Mail Group: Send Guidelines" mail template instead of the actual mail group name.

opw-3778512

closes odoo/odoo#157772

X-original-commit: fe05e7c6acf02986a154af1235ac244a7686b30b
Signed-off-by: Tanguy Quéguineur (taqu) <taqu@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-15 05:03:01 +00:00
Louis Wicket (wil) 7e2f321b6a [I18N] l10n_es: update translations
closes odoo/odoo#157759

Related: odoo/enterprise#58700
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-03-15 05:02:59 +00:00
Romain DerieandAntoine db6f976683 [FIX] website: consider utm after cookies are accepted
Current behavior:
When the cookie bar is activated, the optional cookies are deactivated
by default, unless you click on I agree.
This causes issues regarding UTMs:
- You can have blocks to show only if an UTM cookies has been set
- UTM should be added on sale order for instance when reaching the
  website through a link with an UTM and then buying something

Steps to reproduce (utm on quotation):
1. Install ecommerce
2. Go to Settings/Website
3. Activate Cookies Bar
4. Open a private tab
5. Go to /shop?utm_campaign=Sale
6. Click on I agree on the cookie bar
7. Buy a product
8. Go back to Sales App in backend
9. Find the last public user quotation
10. Go to other info tab
11. The medium field is empty

Steps to reproduce (utm based visibility):
1. Drag & drop a snippet on a page (let's say the /page)
2. Set that snippet visibility to "Visible only if utm campaign is
   "Sale"
3. Repeat step 2 3 4 from above
4. Open /page?utm_campaign=Sale
5. You will see that the block is not shown despite accepting the
   cookies and having the correct utm set.

Note: we don't want that clicking on I agree reload the page, it would
      solve everything but would have poor usability.

Note that with the default cookies bar, you could still naviguate to
another page, and accept the cookies later, in which case the UTM would
never be set since they would not be in the URL anymore.
It's an acceptable limitation, if that's a real issue to someone, they
have to set the popup layout to a blocking one, not the small non
intrusive one.

Fix:
When closing the cookie bar, forcing the info in the URL to be stored in
the cookies if the key is a UTM.

opw-3681927

closes odoo/odoo#157711

X-original-commit: 8c31c2b08ed84ccdb97af628d9db7f6c67c6d830
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: Antoine (ande) <ande@odoo.com>
2024-03-15 02:34:46 +00:00
Anh Thao Pham (pta) 9248395e92 [FIX] stock_account: fix default stock accounts properties upgrade
Steps to reproduce:
- Create an empty database (without demo data)
- Install stock_account
- Go to Invoicing settings
- Select Austria as Fiscal Localization
- Go to Apps
- Try to upgrade stock_account module

Issue:
A traceback is raised.
The module tries to create the default stock accounts properties on
the main company, but they already exist, which triggers a violation
of the SQL unique constraint (ir_property_unique_index) of "ir.property"
on the combination of (fields_id, company_id, res_id) fields.

Cause:
When "stock_account" module is installed/upgraded, the default stock
accounts properties are created for the main company with forcecreate="True"
option, which means they will be created if their "xml_id" doesn't exist, even
if they are declared inside <data noupdate="1">.
In this case, they are created with their "xml_id" at the module installation
with the following values:
- company_id: [the main company]
- fields_id: ["property_stock_account_output_categ_id" field of "product.category" model]
- res_id: False (to be used as a default value)
- value: False
When the Austrian localization (or other localizations defining their own
stock accounts properties) is selected in the settings, these default properties
are deleted and replaced by those coming from the localization package with
some similar values but without "xml_id":
- company_id: [the main company]
- fields_id: ["property_stock_account_output_categ_id" field of "product.category" model]
- res_id: False (to be used as a default value)
- value: [depends on the localization package]
Then, when upgrading "stock_account" module, as the "xml_id" of the default
stock accounts properties cannot be found anymore, the upgrade process will
try to re-create them and will trigger the SQL unique constraint.

Solution:
Move the creation of the default stock accounts properties in a python function
to check if the default properties already exist based on the combination of
"company_id", "fields_id" and "res_id" fields and not based on the "xml_id".

opw-3682320

closes odoo/odoo#157703

X-original-commit: 7e710e4effae6dc812a9304090b5796b39fed640
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2024-03-15 02:34:45 +00:00
Victor Feyens 3c2a420851 [IMP] sale: discount should not be recomputed on confirmation
Add test to cover a problem fixed in `sale_subscription`

opw-3740645

closes odoo/odoo#157699

Related: odoo/enterprise#58673
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-03-15 01:04:09 +00:00
vava-odoo 48e1b9d0c5 [IMP] base_import_module: log info message if import succeeds
Before this commit, there was no message in the logs when the import of
a data module is finished. This commit adds a log info to state that the
module is now in the db.

closes odoo/odoo#157687

Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2024-03-14 20:42:42 +00:00
Joris Makauskis 38f37edad3 [IMP] purchase: allow matching on locked PO
This change allows for locked purchase orders to be matched with OCR

closes odoo/odoo#157569

Task: 3798080
X-original-commit: 59fe446aee1ee6d634aa286adc261a3c7f547d14
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
Signed-off-by: Joris Makauskis (jmak) <jmak@odoo.com>
2024-03-14 19:04:49 +00:00
Harsh Modi 34416ecf87 [FIX] pos_online_payment: prioritize pos order customer
Before this commit:
POS online payments uses the logged-in user or the public user,
even when a POS order customer might also be present.

After this commit:
We check the partner_id for POS orders and give it
precedence over both the logged-in user and the public user.

task-3805695

closes odoo/odoo#157562

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-14 19:04:48 +00:00
Tanguy Quéguineur a198d2dc1d [FIX] point_of_sale: translate POS session elements
Issue
-----
In a POS session, some buttons of the numpad and some fields in the client editor form are not translated.

opw-3783252
opw-3756593

closes odoo/odoo#157509

Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2024-03-14 19:04:47 +00:00
Tanguy Quéguineur f5cca46880 [FIX] lunch: avoid traceback in scheduled activity
Steps to reproduce:
-----
1. Have lunch app activated
2. Settings > Technical > Scheduled Actions
3. Run manually a scheduled action to send an automatic email to a lunch provider with "send order by" not equal to email.
** Traceback error **

Changes
-------
The user will see an UserError instead of a traceback.
opw-3751229

closes odoo/odoo#157305

X-original-commit: 13792ee52f96d739ef1b7af0f1323906b1a39ee4
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Tanguy Quéguineur (taqu) <taqu@odoo.com>
2024-03-14 17:36:47 +00:00
suth-odoo 6bc3368d3c [FIX] hr_timesheet: set 'My' filters at the top of the list in the search view
Steps to reproduce:
 - Install timesheets
 - click on all timesheets
 - open search view

Issue:
 - in search view 'my' filters block should be at the top of the list

Cause:
 - misplacing of the name month filter causes the issue.

Solution:
 - if we replace that filter below the group then the issue will be solved.

task-3772684

closes odoo/odoo#155714

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-03-14 17:36:42 +00:00
Benjamin Vrayandqsm-odoo 773aaf5c75 [FIX] website: fix searchbar snippets colors
Since this commit [1], the two searchbar snippets are broken.

The search bar input seems invisible because it shares the same color as
the default snippet background and has no border. This style matches the
search inputs used in apps (like the "/shop" search bar), which isn't
affected by the "Input fields" settings in the "Theme" tab.

To resolve this issue, this commit introduces a new option to choose
between the "light" style (similar to "/shop" search bars) and the
"default input style" for the 2 "Search" snippets.

The "default input style" is automatically applied when the "Search"
snippet (excluding saved snippets) is dropped to address the issue
caused by the light-on-light color scheme.

Steps to reproduce the issue:

- While in Website edit mode, drag and drop a "Search" snippet onto the
page.
- Bug: The input appears invisible due to the lack of a border and a
background color identical to the snippet's section color.

[1]: https://github.com/odoo/odoo/commit/6b1d11a60d8e70b33c63da860bb81b015ce5ea20

task-3662985

closes odoo/odoo#154435

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2024-03-14 17:36:40 +00:00
abd-msyukyu-odoo 20807fe800 [FIX] web_editor: don't sanitize recursively during safeSetAttribute
In Knowledge, embedded views anchors have a `data-behavior-props` attribute
containing information on how to render the embedded view. That attribute is
sometimes updated, and during a collaborative session, receiving such an update
as a collaborative step would trigger a full sanitization of the embedded view,
possibly discarding some transient content that could break the view, even
though it caused no security issue since it is all rendered on a per client
basis (each client fully renders its own view).

The proposed solution is to sanitize only the attribute of the node and not its
content during `_safeSetAttribute`, which is reasonable, because the node
content is already sanitized recursively for `add` mutations.

task-3060490

closes odoo/odoo#157669

X-original-commit: d9e3d7bdb6e13e6049a86ed08160daccf0fcbcc8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-14 15:43:46 +00:00
Odoo's Mergebot a0783f0b1f [FW][FIX] website_profile: fix karma wheel layout
How to reproduce:
- Install "French" for the website
- log out and log in as demo
- Go to the front-end and click on "Courses"

The design of the karma wheel is broken because the translation for "Get 7.5k< xp to level up!" displayed in the wheel is too large ("Obtenez 7.5k xp pour passer au niveau supérieur"). While in French the text go outside the wheel and it appears clearly broken, it is also the case in English as the rank name is hidden due to the length of the text (for example when gaining one karma: 7.49k is displayed instead of 7.5k which takes more place).

To avoid modifying the template "profile_next_rank_card" that could break community overrides, we solve this problem in css by increasing the karma wheel size and the precentage of width occupied by the text inside the wheel. We also reduce the vertical margin between the rank name and the descriptive text and reduce the line height to avoid the text to overlap with the wheel. And if the text is still too large for some language it will be truncated and an ellipsis will be used.

Technical note: we do the change in website_profile.scss (and not in website_slides.scss) because it applies to both karma wheel: the one on course home page and the one in the profile page.

[FIX] gamification: fix incorrect next rank

How to reproduce:
- Install website_slides with demo data
- Connect as admin
- Go to the front-end and click on "Courses"

The karma wheel shows 100%, "master" and a karma of 2.5k xp while it should be: 4% on the wheel, "Doctor", 2.5 / 10k (karma_min for master is at 20k and next level is doctor at 10k).

We solve that issue by fixing the method that determine the next rank (see technical note for more details).

Technical note: the problem occurs because the admin user has the rank 4 but its field next_rank_id is null while there is a level 5. In that condition, the method _get_next_rank returns an empty recordset while it should return the rank 5. We simplify that method to always return a rank if there is one suitable (if you reach the last level, there are no next level).

(Initial PR in saas-16.1: odoo/odoo#151372)

Task-3617054

closes odoo/odoo#157655

Forward-port-of: odoo/odoo#157585
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2024-03-14 15:43:45 +00:00
Pierre-Yves Dufays c46c60d398 [FIX] website_profile: fix karma wheel layout
How to reproduce:
- Install "French" for the website
- log out and log in as demo
- Go to the front-end and click on "Courses"

The design of the karma wheel is broken because the translation for
"Get 7.5k< xp to level up!" displayed in the wheel is too large ("Obtenez 7.5k
xp pour passer au niveau supérieur"). While in French the text go outside the
wheel and it appears clearly broken, it is also the case in English as the rank
name is hidden due to the length of the text (for example when gaining one
karma: 7.49k is displayed instead of 7.5k which takes more place).

To avoid modifying the template "profile_next_rank_card" that could break
community overrides, we solve this problem in css by increasing the karma
wheel size and the precentage of width occupied by the text inside the wheel.
We also reduce the vertical margin between the rank name and the descriptive
text and reduce the line height to avoid the text to overlap with the wheel.
And if the text is still too large for some language it will be truncated and
an ellipsis will be used.

Technical note: we do the change in website_profile.scss (and not in
website_slides.scss) because it applies to both karma wheel: the one on course
home page and the one in the profile page.

Task-3617054

X-original-commit: f32eabf55db4db4d46b45032c76bfa17dfce475f
Part-of: odoo/odoo#157655
2024-03-14 15:43:45 +00:00
Pierre-Yves Dufays 1164b90c5a [FIX] gamification: fix incorrect next rank
How to reproduce:
- Install website_slides with demo data
- Connect as admin
- Go to the front-end and click on "Courses"

The karma wheel shows 100%, "master" and a karma of 2.5k xp while it should be:
4% on the wheel, "Doctor", 2.5 / 10k (karma_min for master is at 20k and next
level is doctor at 10k).

We solve that issue by fixing the method that determine the next rank (see
technical note for more details).

Technical note: the problem occurs because the admin user has the rank 4 but
its field next_rank_id is null while there is a level 5. In that condition, the
method _get_next_rank returns an empty recordset while it should return the
rank 5. We simplify that method to always return a rank if there is one
suitable (if you reach the last level, there are no next level).

Task-3617054

X-original-commit: 6639005e660d0516a7624bd274c27e897797d614
Part-of: odoo/odoo#157655
2024-03-14 15:43:45 +00:00
Paolo Gatti (pgi) 826a472f0f [FIX] l10n_it: Translations of tax report VJ grid
Some translations were missing or incorrect for the VJ grid
in the Tax Report.

task-3724926

closes odoo/odoo#157622

Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2024-03-14 15:43:44 +00:00
Aungkokolin1997 4714124384 [IMP] stock_account: refactoring for checking owner_id
Refactored the owner_id check in the stock_account module to make it more flexible for future updates.
Before, any changes or additions to how ownership is checked required overriding the whole method.
Now, it's easier to extend ownership checks without such heavy modifications,
paving the way for more straightforward updates and customizations related to inventory ownership.

closes odoo/odoo#157614

X-original-commit: b01b73d58f57930bbfa705f5206e6e57f3816aa5
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-03-14 15:43:42 +00:00
Roy Le ed4bc1e838 [FIX] account: A traceback occurs because self.ids is empty in the
context of the creation of a new record

closes odoo/odoo#146019

X-original-commit: c3aea407ccf9903ea9b43edfdd0289b63c478ffb
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2024-03-14 14:02:07 +00:00
Romain Derie d11ece23e9 [FIX] website: correctly set theme bg img when slide over footer enabled
Steps to reproduce:
- Click on the footer and enable footer "Slide Hover" option
- In the theme tab, add a theme bg image
- Drag & drop a "Text - Image" snippet (or any snippet without a bg
  color set, or any snippet with a bg color set and just remove it)
- The snippets and page layout in genral will receive a forced color
  instead of using the bg image set.

This is because with the slide hover option, the bg has to be moved from
the `#wrapwrap` to the `main`. Indeed, it's the main which is scrolling
hover the footer, not the `#wrapwrap`. Without doing that, the elements
hover the footer would have a transparent background and would not hide
the footer.

But the bg image was not considered when doing it, only the bg color.

opw-3704746

closes odoo/odoo#157638

X-original-commit: 68c8a7f48ac955a8e9e4f1fc8cb1c76af54116b3
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-03-14 11:12:33 +00:00
utag-odoo 926cdda3ef [FIX] web_editor: fix overlay hidden after image cropping
Steps to reproduce:
 1. Go to the website
 2. Drag a snippet that contains an image
 3. Select the image block
 4. Go to customize the image
 5. Go to transform - select crop image
 6. Crop and apply changes -> Overlay is hidden

Before this commit, after cropping an image the overlay was hidden. To
make the overlay visible again, you have to click elsewhere on the
snippet and then click on the image again, because the overlay was being
hidden.

When we perform an image crop, we activate the `hide_overlay` action,
which subsequently eliminates the `o_we_overlay_preview` class. This is
due to the fact that, during the image-cropping process, the
`previewMode` is set to `false.` However, if we wish to keep the overlay
visible, We can simply avoid triggering the "hide_overlay" action.

task-3392225

closes odoo/odoo#157635

X-original-commit: 2075b4c957a8e2d03fcfd8bfab99be1e49c31ca9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-03-14 11:12:31 +00:00
asm 73019b135f [IMP] analytic: Add a function to get the analytic accounts off of analytic_distribution dict, this improvment is to avoid the rewriting the same code all over whenever we wanna get the accounts.
opw-3756270

closes odoo/odoo#156866

Related: odoo/enterprise#57159
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-03-14 11:12:28 +00:00
Benjamin Vray 226b5645c7 [FIX] web_editor: fix resize column outside of the iframe
Steps to reproduce the bug:

- Enter Website edit mode.
- Drag and drop an "Image-Text" snippet onto the page.
- Grab the right edge of the right column of the snippet and extend it
to the right until it overflows the iframe and hovers over the editor
panel.
- Release the mouse, then hover over the iframe again.
- Bug: The "mouseUp" event was not triggered, and the column resizing
still occurs.

This bug occurs because the "mouseUp" event was attached to the
<body> of the iframe and not to the window of the iframe.

Indeed, for mouse events to be triggered outside of an iframe, they need
to be attached to the iframe's window.

This fix is not necessary before the version 16.0. Before V16.0, the
page preview and the options panel shared the same window. It's only
since this commit [1], where we moved the page preview into an iframe,
that the bug occurs.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

taks-3562970

closes odoo/odoo#157627

X-original-commit: e6be732450d9ef662a48ba074e1ca1ad32e35c04
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2024-03-14 09:27:14 +00:00
Laurent Smet dea48f80ef [IMP] l10n_mx: Don't allow to uninstall l10n_mx_edi from settings
closes odoo/odoo#157608

X-original-commit: ed209b840c45faa20fcab4f7498cbb5285662fce
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-03-14 08:06:26 +00:00
Claire Bretton (clbr) d5ccb8dff1 [IMP] account,l10n_es_edi_facturae,l10n_it_edi: Send & Print only given options
Add the possibility to call the send & print with *only* a set of options.
All other checkboxes are therefore set to False, instead of their default computed value.

closes odoo/odoo#157532

Related: odoo/enterprise#58574
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-03-14 08:06:24 +00:00
Andrea Grazioso (agr-odoo) d7cfc3844c [FIX] account: new line balance computation
Create a new Journal Entry
Add a 100$ debit line 1
Add a 100$ debit line 2
Add a new line: system will suggest 200$ credit line 3
Save
Delete line 3
Change line 2 amount into 50
Create a new line

Issue: the system will compute a credit amount of 50$
This occurs because in the onchange we work with a new record
representing the set of changes
Commands sent by the orm are:
- DELETE of line 3
- UPDATE of line 2
So in the new record we don't have information on line 1.
A solution is to recover the data from the stored record

opw-3757415

closes odoo/odoo#156875

Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2024-03-14 08:06:22 +00:00
AH-Yussef 58790d58e1 [FIX] web: correctly align column values with column header
Steps to reproduce:
- Install planning app.
- Go to planning app, and convert the view to List.
- Group by Resource -for example-.
- Notice how the allocated time values are mis-aligned with the header label.

Investigation:
- in the planning tree view, notice the property `open_form_view` set to `True` https://github.com/odoo/enterprise/blob/418ea2114c7d935865dc52e5fd5a30d626987190/planning/views/planning_views.xml#L8
- In the `getGroupNameCellColSpan` method:
	- the `firstAggregateIndex` is `1` belonging to the `allocated_hours` (Allocated Time)column which set the `colspan = firstAggregateIndex = 1`
	- as `this.hasSelectors` is `true`, `colspan = colspan+1 = 2` (which is the correct value)
	- but now as the `open_form_view` was set to `True`, the `this.props.onOpenFormView` exists and so the `colspan = colspan+1 = 3` which makes the value be misaligned to the right by one column.

The proposed fix:
- As the `open_form_view` option add a View button to the end of the row, it makes sense to do the check with the `lastAggregateIndex` inside `getGroupPagerCellColspan` method.
- In our case:
	- the `lastAggregateIndex` is `1` belonging also to the `allocated_hours` which set the `colspan = this.state.columns.length - lastAggregateIndex - 1 = 3 - 1 - 1 = 1`
	- as we don't display optional fields this check fails https://github.com/odoo/odoo/blob/5af3cfc2b9ce648ae4aff69150266e4ad519050d/addons/web/static/src/views/list/list_renderer.js#L1025-L1027 and the `colspan = 1`
	- Now we check the `this.props.onOpenFormView` condition which set `colspan = colspan+1 = 2` which is correct.
- But what if we wanted to show the optional field `allocated_percentage` would this fix still work? Yes!
	- the `lastAggregateIndex` is `2` belonging to the `allocated_percentage` which set the `colspan = this.state.columns.length - lastAggregateIndex - 1 = 3 - 2 - 1 = 0`
	- as we do display an optional fields= this check works https://github.com/odoo/odoo/blob/5af3cfc2b9ce648ae4aff69150266e4ad519050d/addons/web/static/src/views/list/list_renderer.js#L1025-L1027 and the `colspan = colspan+1 = 2`
	- Now we check the `this.props.onOpenFormView` condition which set `colspan = colspan+1 = 3` which is correct.
- One last case, what if we have no aggregates
	- both firstAggregateIndex` = `lastAggregateIndex` = -1
	- we go into the else clause inside `getGroupPagerCellColspan`, making the `colspan = this.state.columns.length > 1 ? DEFAULT_GROUP_PAGER_COLSPAN : 0 = True ? DEFAULT_GROUP_PAGER_COLSPAN : 0 = DEFAULT_GROUP_PAGER_COLSPAN = 1
	- if the `open_form_view` was `True`, the colspan becomes `colspan = colspan+1 = 2`.

opw-3764616

closes odoo/odoo#156647

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-03-14 08:06:21 +00:00
Lucas Lefèvre (lul) 2d7ed635e5 [FIX] spreadsheet: fetch currency field
Get to a list view where there's a monetary field AND the related currency
field in the same list.
Then insert the list in a spreadsheet.
=> Either the currency format is not fetched or the currency name, depending
on the order in the list.

Bug introduced by 8777973e

opw-3770057

closes odoo/odoo#157623

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2024-03-14 06:39:31 +00:00
Maira Salazar (srma) 210e249b77 [FIX] account: allow negative days in payment terms
Negative days are no longer allowed in the Payment Terms since 16.2, although it was possible before.
There is no need to block user behaviour if they require negative days (for example, days before end of the month), as the payment term works as expected with negative days.

To fix, we remove the constraint _check_positive.

To reproduce the issue:
- Go to Accounting -> Configuration -> Payment Terms
- Edit/Create a Payment Term with a negative value in the 'After' column
- When saving, a Validation error appears

task-3751491

closes odoo/odoo#157600

X-original-commit: fe1399a1821a05638c638fc4f0437a7aed70e260
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2024-03-13 21:09:54 +00:00
Jeremy Kersten 6f4cb8d1c6 [FIX] website_blog: useless redirect on tag in sidebar
In all cases, we will fetch the record since we display the name, so it
has no extra cost to slug the record instead of the id, and it will
prevent an extra redirect from /tag/1 to /tag/name-1 on click.

opw-3752989

closes odoo/odoo#157578

X-original-commit: c406220277a3005cde34a44ba733d470769c2dc4
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-03-13 21:09:53 +00:00