Commit Graph
169768 Commits
Author SHA1 Message Date
Jeremy Kersten ea6aad812e [FIX] base: ir.qweb.field.contact handle null value
In case where display_name is null, the widget contact crash
 - AttributeError: 'bool' object has no attribute 'split'

On odoo.com we have around 3K of partner that have name with null value.
So calling so widget Contact on linked res.users will crash since the
display name is False

closes odoo/odoo#155735

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2024-02-29 12:13:38 +00:00
omra-odoo fe4b0febaf [FIX] web: add close button in daterange picker
Current behaviour
- when we access the daterange picker it was observed that the apply button
  appeared flatter and was not vertically centered.

Expected behaviour
 - add h-100 on buttons container to ensure they are vertically centered and no
   longer appear flatter
 - add close button in which  action is similar to pressing ESC or clicking
   outside the popover

Task-3624556

closes odoo/odoo#148812

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-02-29 12:13:37 +00:00
Louis (loco) fb2296adec [IMP] *: improve accessibility of website pages
*: base_import, gamification, hr_skills, mass_mailing, portal,
portal_rating, survey, web, web_editor, website, website_sale,
website_slides

The goal of this commit is to improve the accessibility of the website
pages. This has been made by implementing and correcting ARIA
(Accessible Rich Internet Applications) roles and attributes. More
precisely:
- An `aria-label` attribute has been added on progressbar elements to
avoid a warning of type `ARIA progressbar elements do not have
accessible names`. It has also been added on iframes to avoid a warning
of type `<frame> or <iframe> elements do not have a title`. Furthermore,
`aria-label` has been incorporated on some anchors to avoid a warning of
type `Links do not have a discernible name`. Finally, it has been added
on elements that have the `dialog` role to avoid a warning of type
`Elements with role="dialog" or role="alertdialog" do not have
accessible names` and on elements that have the `listbox` role to avoid
a warning of type `ARIA input fields do not have accessible names`.
- To avoid a warning of type `Some ARIA parent roles must contain
specific child roles to perform their intended accessibility functions`,
`role="menuitem"` has been added on children of menu elements. As
explained in [the menuitem role documentation], "The `menuitem` role
indicates the element is an option in a set of choices contained by a
`menu` or `menubar`". To avoid this warning, `role="presentation"` has
also been added on elements located between `tablist` and `tab` and
between `menu` and `menuitem`. Indeed, as explained in
[the presentation role documentation]; "The `presentation` role removes
an element's implicit ARIA semantics from being exposed to the
accessibility tree". The goal is to inform the assistive technologies
that the default semantics of the element should be ignored. Finally, to
avoid this same warning, the `option` role has been added on elements to
identify selections a user can make in a `listbox`.
- The `aria-label` of some elements has been adapted in order to avoid a
warning of type `Elements with visible text labels do not have matching
accessible names`.
- The value of `aria-disabled` has been corrected to `true` (instead of
`disabled`) (see [the aria-disabled documentation]).

Still to improve the accessibility of the website pages, an alternative
text (`alt`) attribute has been provided for images.

[the menuitem role documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menuitem_role
[the presentation role documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role
[the aria-disabled documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled#values

closes odoo/odoo#140453

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-02-29 12:13:35 +00:00
Louis (loco)andqsm-odoo 8eb5d38b7e [IMP] website, *: add aria-label on social media anchors
*: website_hr_recruitment

In order to improve the accessibility of the website pages, an
`aria-label` attribute has been added on some social media anchors to
avoid a warning of type `Links do not have a discernible name`. The
`options.js` file has also been adapted in order to correctly set the
`aria-label` attribute of added social media anchors.

Part-of: odoo/odoo#140453
Co-authored-by: qsm-odoo <qsm@odoo.com>
2024-02-29 12:13:35 +00:00
Louis (loco) bedf4ba066 [IMP] website: add an aria-controls attribute on accordion tab elements
In order to improve the accessibility of the website pages, an
`aria-controls` attribute has been added on `tab` elements of the
"Accordion" snippet to avoid a warning of type `Elements with an ARIA
[role] that require children to contain a specific [role] are missing
some or all of those required children`. Indeed, as explained in
[the tab role documentation]; "An element with the `tab` role should
contain the `aria-controls` property identifying a corresponding
`tabpanel` (that has a `tabpanel` role) by that element's `id`". The
`_createIDs()` method has been adapted in order to handle the update of
the `aria-controls` attribute at the update of the `tabpanel` id.

[the tab role documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tab_role#description

Part-of: odoo/odoo#140453
2024-02-29 12:13:35 +00:00
Louis (loco) 0217eff341 [IMP] website: add a default meta description on website pages
The goal of this commit is to add a default meta description on website
homepage and "contact us" page in order to improve their SEO and avoid a
warning of type `Document does not have a meta description`. Of course,
it is still meant to be overridden.

Part-of: odoo/odoo#140453
2024-02-29 12:13:35 +00:00
Louis (loco)andqsm-odoo 0376073db7 [IMP] website: add an aria-label on the extra item anchor
The goal of this commit is to add an `aria-label` attribute on the
"extra item" anchor in order to improve the accessibility of the website
pages and avoid a warning of type `Links do not have a discernible
name`. However, as the logic responsible of the creation of this anchor
is in a non lazy loaded file, the translate function `_t()` (located in
a lazy loaded file) can not be used to translate the value of the
`aria-label` attribute. To solve the problem, this value has been put in
the `data-extra-items-toggle-aria-label` attribute on the header. The
translated value is then extracted and added in the `aria-label`
attribute at the extra items button creation.

Part-of: odoo/odoo#140453
Co-authored-by: qsm-odoo <qsm@odoo.com>
2024-02-29 12:13:35 +00:00
dise 110cce72e5 [FIX] project: fix project tour in mobile mode
The tour isn't working if you run it on mobile mode, it gets stuck at
some points.

To fix this issue, a mobile step was added, and one trigger was edited
to work with mobile mode as well.

task-3709501

closes odoo/odoo#155789

X-original-commit: 224d3dfb9bbcc53bd2902407800b6fa88d9b8716
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-02-29 10:34:25 +00:00
Khushi da287cc2f7 [FIX] mail: activity view model domain
Steps to reproduce:

- Go to activity view.
- Schedule an activity for one record. (Say 8 records are available)
- Schedule an activity for the second time. (Again 8 records are available)
- Try to schedule an activity for the 3rd time. (Only 2 records are available)

Issue:
Since 7682286, the existing props of activity model are being passed as params
while scheduling an activity. Currently, `["activity_ids", "!=", false]` is
being pushed to the domain of activity model in order to display only those
records on which activities have been set. As a result, after you schedule
activities more than once, `["activity_ids", "!=", false]` domain gets applied
and the list of records available for scheduling activity is restricted from
the third time onwards.

Fix:
This commit passes the props from searchModel as params to the 'load' method
while scheduling activity, instead of existing props, to ensure that the
existing params are applied as well as all records are accessible for
scheduling an activity, in `searchCreateDialog`
(i.e.["activity_ids", "!=", false] condition is not added as domain).

Task : 3721750

closes odoo/odoo#155700

X-original-commit: 339df084567206cff8a5487bbe9dec249671244a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Khushi Patel (khpa) <khpa@odoo.com>
2024-02-29 10:34:23 +00:00
Ethan Vincent 5e4e6e919f [FIX] pos_self_order: decode home images as sudo
**Current behavior:**
Trying to access the mobile order menu for a pos restaurant
with some non-default landing page images as a non-admin user
will result in an access error.

**Expected behavior:**
The images should load on this page for anyone who has a valid
access token for the page route.

**Steps to reproduce:**
1. Make a restaurant in the POS application

2. Enable mobile ordering and set a database user with `user`
     level access to the POS app to be the default user for
     this newly created restaurant

3. Upload a splash image for the restaurant

3. On the POS dashboard, select the three vertical dot button
     on the restaurant -> `Mobile Menu` to get the access error

**Cause of the issue:**
The default user on the restaurant POS will not necessarily
have access rights to the `ir.attachment` model/records.

**Fix:**
Get the images as sudo()- IMO there isn't a reason these should
be inaccessible to anybody considering they are intended to be
seen on the landing page by people trying to order.

opw-3748314

closes odoo/odoo#155589

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-02-29 10:34:20 +00:00
Yolann Sabaux 9c9552fd20 [FIX] account, mail: allow account custom sub model tracking
Steps to reproduce:
- Create an invoice and confirm it
- reset to draft
- change the account of an aml (product sales -> asset)
-> on the log note you will see the detail of the modification `Account: 400000 Product Sales -> 101000 Current Assets`
- connect with Demo
- go on the same invoice

Issue:
You will not see the details of the aml account change

This is problematic since Accountant and auditors should be able to see it.

Cause:
Sub-model tracking is not supported. Although we override this constraint in accounting (refer to https://github.com/odoo/odoo/blob/f56de22f10d09e6e34b25cbff04bbb6bf0823e54/addons/account/models/account_move.py#L5058-L5071), it remains inaccessible for users other than base.system. This is because we attempt to locate the account_id field on the model account.move defined in tracking.mail_message_id.

opw-3632295

closes odoo/odoo#155034

X-original-commit: 20f00a73cb280fd9a3636122c4a8a316abcee0d0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2024-02-29 10:34:18 +00:00
Gaetan Vanden Bergh (gavb) 61a5103eac [FIX] hr_skills: Page name already exist
Steps:
- In employee form
- Open studio
- Remove "Work Information" tab

Actual result:
- Traceback due to invalid xpath expression
- Invalid xpath due to duplicated name for a node

Expected result
- Tab is removed without traceback

opw-3754375

odoo/odoo@8e14972830

closes odoo/odoo#154891

X-original-commit: 950e9f89ed9c37097c6d929638eb339e0467851c
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Gaetan Vanden Bergh (gavb) <gavb@odoo.com>
2024-02-29 10:34:17 +00:00
Anh Thao Pham (pta) cb43b72ca6 [FIX] account, l10n_ar_withholding: fix install with multiple AR companies
Steps to reproduce:
- Install Accounting and l10n_ar
- Create 2 companies located in Argentina (e.g. Company A & Company B)
- Switch to Company A
- Go to Accounting settings
- Set Fiscal Localization to Argentina
  (e.g. Argentina - Argentine Generic Chart of Accounts for Excempt individuals)
- Switch to Company B
- Go to Accounting settings
- Set Fiscal Localization to the same Fiscal Localization than Company A
  (i.e. Argentina - Argentine Generic Chart of Accounts for Excempt individuals)
- Try to install "l10n_ar_withholding" module

Issue:
A User Error is raised:
"Incompatible companies on records:
- 'account.tax.repartition.line,1230' belongs to company 'Company A' and 'Account' (account_id: '1.1.4.03.020 SUSS Withholding incurred') belongs to another company.
- 'account.tax.repartition.line,1232' belongs to company 'Company A' and 'Account' (account_id: '1.1.4.03.020 SUSS Withholding incurred') belongs to another company.
- 'account.tax.repartition.line,1234' belongs to company 'Company A' and 'Account' (account_id: '1.1.4.05.030 Withholdings of Profits incurred') belongs to another company.
- 'account.tax.repartition.line,1236' belongs to company 'Company A' and 'Account' (account_id: '1.1.4.05.030 Withholdings of Profits incurred') belongs to another company."

Cause:
When installing "l10n_ar_withholding" module, each Argentine company is updated
with some tax data.
These data are "generic" (not linked to any company) and used for each company,
but some treatment is performed on them by the first Argentine company, linking them
to the account ids of that company.
The following companies are then updated with data linked to the first company.

Solution:
Compute the data for each company.

opw-3709819

closes odoo/odoo#154219

Signed-off-by: Cedric Snauwaert <csn@odoo.com>
2024-02-29 10:34:16 +00:00
Serge Bayet (seba) cc38e5e4c0 [FIX] website: search field in header not tabable
This commit resolves the accessibility issue where the search field
located within the header was not navigable (see [1]) via keyboard
tabbing, rendering it inaccessible to users relying on keyboard
navigation.

This fix ensures that users can seamlessly navigate to the search field
in the header using the keyboard, thereby enhancing the overall
accessibility and usability of the website.

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

task-3607481

closes odoo/odoo#153197

Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2024-02-29 10:34:15 +00:00
yosa-odoo eabcf88f82 [FIX] partner_autocomplete: display autocomplete createEdit
Steps to reproduce:
[account, iap credit]
- create a new invoice
- start to write "test" for the partner

Issue:
The partner autocomplete is not displayed

Cause:
in #150106 we add a condition for the quickCreate bypassing the possibility of having createEdit set to true

opw-3698400

closes odoo/odoo#155781

X-original-commit: 5f342b816c16fbbaefdb61d8bfac8376132dbfeb
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2024-02-29 08:58:00 +00:00
Abdelouahab (abla) d7da674803 [FIX] web: keep unchanged values in datetime fields
To reproduce:
============
- on Planning create new shift
- select a template
- change the end date
-> the end date is reset to the template value

Problem:
========
- `end_datetime` and `start_datetime` have the same compute method
- `template_id` depends on `start_datetime` and `end_datetime`
- so changing `end_datetime` triggers the compute method of `template_id`
that will read `start_datetime`
- reading `start_datetime` triggers the compute method of `end_datetime`,
that will check if `template_id` is set and if so, will take its values
-------
 why the compute method of `end_datetime` is triggered ? :

-------
- `start_datetime` is not protected from recomputing, at this
line : https://github.com/odoo/odoo/blob/saas-16.3/odoo/models.py#L6746
we only protect the fields sent by frontend (only `end_datetime`)
- frontend doesn't send `start_datetime` as it was not changed

Solution
========
as ORM fix can't be made in stable, we send `start_datetime` in the `onchange`
query even if it's unchanged to make sure both fields are protected

opw-3693206

closes odoo/odoo#155705

X-original-commit: 7081372e721387da983621b3dd2986ae0872e4c8
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2024-02-29 08:57:57 +00:00
Pierre Rousseau c85efc0473 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/ed67be7d1 [REL] 17.0.13
https://github.com/odoo/o-spreadsheet/commit/895edf0f0 [FIX] Migration: Propagate datafilter correction on every version Task: 3728009
https://github.com/odoo/o-spreadsheet/commit/b16809114 [FIX] migration: Fix migration steps Task: 3771209
https://github.com/odoo/o-spreadsheet/commit/fd9e140a7 [IMP] cssPropertiesToCss: don't use `Object.entries()`
https://github.com/odoo/o-spreadsheet/commit/df828b3d1 [FIX] selection_inputs_manager: arrow keys when broken ranges
https://github.com/odoo/o-spreadsheet/commit/799b7575e [IMP] formula: add INT function Task: 3756478

closes odoo/odoo#155731

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2024-02-28 19:49:14 +00:00
tsm-odoo 440e6a5b86 [FIX] mail: fix non deterministic bus subscription test
Before this PR, the `bus subscription is refreshed when channel is
left` test was sometimes failing. This actually reveals a real issue:
if a channel is joined a leave very quickly, the bus subscription is
not updated.

This occurs because we rely on the last subscription made and the one
that should be made to detect if channels differ. Since the
`updateBusSubscription` method is debounced, we can miss information.

This PR replaces the complicated `updateBusSubscription` method by a
`onAdd/onDelete`. This is much more reliable and more efficient since
there is no need to walk through every channel to detect changes.

This PR also remove a test that was redundant that the failing one.

fixes runbot-55292,57645,56232

closes odoo/odoo#155720

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-02-28 19:49:13 +00:00
Odoo's Mergebot 12409d635e [MERGE][IMP] mail, event: add test for batch emailing from template
PURPOSE

Mail: add tests for MailTemplate send_mail

Several flows use MailTemplate.send_mail() in batch, notably event email
scheduler which sends emails to event attendee in batch. This commit adds
tests around 'send_mail' method of MailTemplate model

  * add tests for batch: it is currently not supported hence using a loop but
    batch is going to be added soon, allowing to test the batch version works
    as intended;
  * add query counters, notably for batch mode and when dynamic reports are
    involved in templates;

Event: improve mail scheduler tests

Make them easier to improve and modify

  * use a dedicated setup (allowing to add specific unit tests on test data);
  * move initial asserts into its own unit test (to keep other tests shorter);
  * use available mocks for freezetime and sql.now;

Then add tests for registration emails, to check what happens for communication
scheduled right at registration time.

LINKS

Part of Task-3764894: Event: Allow using cron triggers for communication
Part of Task-3764891: Mail: Batch-ize MailTemplate send_mail
Part of Task-3164278: Mail: Batch send: ensure limit, avoid force
Part of Task-3084943: Event: Improve communication scheduler scalability

closes odoo/odoo#155717

Related: odoo/enterprise#57731
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-02-28 19:49:12 +00:00
Thibault Delavallée 15ecc92c84 [IMP] test_mail(_*): update query counters
Based on last runbot counters

Part-of: odoo/odoo#155717
2024-02-28 19:49:12 +00:00
Thibault DelavalléeandStéphane Debauche 80765a0c7f [IMP] event: improve mail scheduler tests
Make them easier to improve and modify

  * use a dedicated setup (allowing to add specific unit tests on test data);
  * move initial asserts into its own unit test (to keep other tests shorter);
  * use available mocks for freezetime and sql.now;

Then add tests for registration emails, to check what happens for communication
scheduled right at registration time.

Task-3084943: Event: Improve communication scheduler scalability

Part-of: odoo/odoo#155717
Co-authored-by: Stéphane Debauche <std@odoo.com>
2024-02-28 19:49:12 +00:00
Thibault DelavalléeandStéphane Debauche 544808d3a5 [FIX] event: fix mail scheduler tests
They fail at least in local as we don't patch env.cr.now. Forcing 'create_date'
is possible, but we now have a tool 'mock_datetime_and_now' mocking both
the cursor 'now' and use freeze_time for other datetime mock. It makes tests
more reproducible and less ORM-dependent when trying to manipulate creation
date.

Task-3084943: Event: Improve communication scheduler scalability

Part-of: odoo/odoo#155717
Co-authored-by: Stéphane Debauche <std@odoo.com>
2024-02-28 19:49:12 +00:00
Thibault DelavalléeandStéphane Debauche fcd6d1be61 [IMP] test_mail: add test for template 'send_mail'
Several flows use MailTemplate.send_mail() in batch, notably event email
scheduler which sends emails to event attendee in batch. This commit adds
tests around 'send_mail' method of MailTemplate model

  * add tests for batch: it is currently not supported hence using a loop but
    batch is going to be added soon, allowing to test the batch version works
    as intended;
  * add query counters, notably for batch mode and when dynamic reports are
    involved in templates;

Task-3764891: Mail: Batch-ize MailTemplate send_mail
Part of Task-3084943: Event: Improve communication scheduler scalability

Part-of: odoo/odoo#155717
Co-authored-by: Stéphane Debauche <std@odoo.com>
2024-02-28 19:49:12 +00:00
Pedram (pebr) 43cb6001d7 [FIX] point_of_sale: prevent double calculation of base amount
Before this commit, if a tax had multiple distribution lines, the
base amount was calculated for each line. This resulted in the base
amount being multiplied by the number of distribution lines. This issue
has been resolved by ensuring the base amount is counted only once for
each tax and line.

opw-3696800

closes odoo/odoo#155690

X-original-commit: f8842269cee1df62ff4378473dc59da6fca7eec5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-28 19:49:11 +00:00
Djamel Touati 98e51c2627 [FIX] stock: avoid a warning in internal transfer with tracked product
Steps to reproduce the bug:
- Create a storable product “P1”:
    - Tracked by “SN”
    - Update the qty to 1 in “WH/stock” with “SN1”

- Create an internal transfer:
    - Location: wh/Stock
    - Dest location: wh2/stock

- Mark as todo
- Try to select SN1 in the `stock.move`

Problem:
A warning is triggered:
`Existing Serial numbers. Please correct the serial numbers encoded:
(001) exists in location WH/Stock`

We do a search to find all the quants in every location to verify if
the same serial number is not being used, but we do not exclude the
source location.

opw-3734300

closes odoo/odoo#155651

X-original-commit: c6e5b2b4c98f702f9108e75bdc669397ae5e0081
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2024-02-28 19:49:09 +00:00
Pedram (pebr) e966722518 [FIX] point_of_sale: prevent order duplication due to quantity rounding
Before this commit, it was possible to capture an order twice due to
the rounding difference in quantity, especially when users use a scale.

With this commit, it uses a more relaxed condition and remove the
quantity from the orderline comparison. Given that the system checks
the payments and with the same product and price units, it's unlikely
that two orders will have the same payment amount.

opw-3735436

closes odoo/odoo#155612

X-original-commit: 9f1f8fcd272005eb2cba4bf6feee0ea0b2f2609f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-28 19:49:08 +00:00
Pierre-Yves Dufays 821156ce90 [FIX] {test_}mail: remove activity assignation check
How to reproduce:
- Install hr with demo data
- Create a user without access to hr and turn it into an employee
- Create a user for Abigail
- Assign Abigail as manager of the new user
- Click on "onboarding plan" in the chatter of the new user
- Then in the dialog, click on "Schedule" button

You get the error "Assigned user test has no access to the document and is not
able to handle this activity." because the new user has no access to the record
employee on which those activities are scheduled.

As activities for which the user has no access to the underlying record are now
displayed in the systray (with no access to the record), we remove the check
that prevent assigning an activity to a user on a record he has no access to.

Technical note: before odoo/odoo#149965, activities scheduled manually were
created with the flag "automated" set to True and when this flag is set the
check that ensures that the user has access to the record is skipped. With
odoo/odoo#149965, as the "automated" flag is set to False when scheduling
activities manually, an error is trigerred if the user has no access to the
underlying record. Here we always skip that test and mark the method as
deprecated because the user can see the activity no matter the access he has on
the underlying record.

Task-3598836

closes odoo/odoo#155576

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-02-28 19:49:07 +00:00
Sarah Bellefroid ad9dc537a8 [FIX] sale: remove redundant code
This is a fixup of: https://github.com/odoo/odoo/pull/149155

Warning is duplicated:

https://github.com/odoo/odoo/blob/8ccde3f101cdb6ca41fe29cc5b4252f13745774a/addons/sale/models/sale_order_line.py#L1223-L1232

In the case where some products are already added to the SO before selecting the catalog, the warning props will always be loaded. However, since the warning props is a String but sale_line_warn can be false, it only need no be added if sale_line_warn is set.

opw-3631511

closes odoo/odoo#155523

Signed-off-by: Sarah Bellefroid (sbel) <sbel@odoo.com>
2024-02-28 19:49:06 +00:00
Yosua Nicolaus 95a9cd2a46 [FIX] l10n_ro_edi: country code prefix on VAT / company_registry
This commit makes the CIUS-RO e-invoice emitted by a Romanian company
without VAT number compliant with the CIUS-RO requirements.

The validator for CIUS-RO (which extends the validations from the BIS3
Schematron) asserts a rule `[BR-CO-09]` where:

if the PartyTaxScheme/TaxScheme/ID == 'VAT',
  CompanyID must start with a country code prefix.

In Romania however, there are multiple types of "Tax IDs", and it is perfectly
valid in Romania to have a Tax ID without RO (country code prefix) in front of
them. They are not a subject to paying VAT, and it should still be possible to
generate CIUS-RO XML with their tax identifications.

We have to handle their cases by changing the TaxScheme/ID to 'something other
than VAT', preventing the trigger of the rule and allow Romanian companies
without prefixed VAT to use CIUS-RO.

```xml
<rule context="//cac:PartyTaxScheme[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']">
  <assert id="BR-CO-09" flag="fatal" test="( contains( ' 1A AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH EL ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XI YE YT ZA ZM ZW ',substring(cbc:CompanyID,1,2) ) )">[BR-CO-09]-The Seller VAT identifier (BT-31), the Seller tax representative VAT identifier (BT-63) and the Buyer VAT identifier (BT-48) shall have a prefix in accordance with ISO code ISO 3166-1 alpha-2 by which the country of issue may be identified. Nevertheless, Greece may use the prefix ‘EL’.</assert>
</rule>
```

This commit also fixes and clean some of the irrelevant constraints and tests
previously written in `l10n_ro_edi`.

closes odoo/odoo#155252

Task-id: 3649426
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-02-28 19:49:05 +00:00
Aaron Bohy d111e66525 [FIX] web: kanban progress bar: display correct aggregates
Before this commit, in a grouped kanban view with progressbars
and an aggregate field, after clicking on a bar to filter
records, the aggregate value was always 0 (at least when grouped
by a many2one or date(time) field).

This was due to a mismatch when trying to find the value of the
aggregate in the web_read_group result, as when grouped by a date
or datetime field, the key is `fieldname:granularity`, and we were
looking for the fieldname only. And for the many2one case, we were
comparing a pair [id, display_name] with an id.

This commit fixes the issue. It also fixes the mocked version of
read_progress_bar in the MockServer, s.t. we can correctly
reproduce the scenario in tests, as in the previous version, keys
in the returned object weren't computed the same way as in the real
read_progress_bar (e.g., "14,Mitchel", instead of "Mitchel"). A
similar fix has been done in [1]. This allows us to introduce a
test when grouped by many2one, which doesn't work as of 17.0.

[1] fd759f18d056844c486a68d0c394df5a03e789f0

closes odoo/odoo#155701

X-original-commit: 69b1809ed763d03560983bb0e4c996946dd694c5
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-02-28 18:30:16 +00:00
Lopes Marc (loma) 2bcccbfb91 [FIX] survey: fix global css print rules
PURPOSE
=======

The survey addon assets contain some global rules for print mode, that
are present in the global backend stack.

In Odoo 15.2, we put these rules in `survey_templates_results.scss`.
Then, in later versions of Odoo we updated it wih more 'print mode'
global rules.

As these rules are specific to the survey addon, we don't want them to
affect the (whole) Odoo backend.

HOW TO FIX
==========

It seems rules defined in `survey_templates_results.scss` are not
used in survey backend views, but specific to frontend views.

`survey_templates_results.scss` is also part of the
`survey.survey_assets` bundle. This bundle is loaded only for the
following frontend views:
- Survey: main page (take survey)
- Survey: custom 403 page
- Survey: void content
- Survey: login required
- Survey: expired
- Survey: Access Code page
- Survey: print page
- Survey: result statistics page

Among them, views that are not intended to be printed are not
negatively impacted by the css rules for print mode.

A solution would therefore be to remove
`survey_templates_results.scss` from the backend stack.

see 0364161
see #135683
see #146812

task-3666858

closes odoo/odoo#155126

X-original-commit: aba4b503b60b42c91191436491205a0c7575ecbd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-02-28 14:00:03 +00:00
Yolann Sabaux e2ad568e6c [FIX] l10n_ar: displays right amount of col
Steps to reproduce:
- create an invoice with an invoice line having a big amount
- confirm
- print invoice

Issue:
The alignment of total is not correct

Solution:
In l10n_ar, we need more cols to be able to display the correct information. In the base report, the difference is not important visually (the line total is slightly longer)

opw-3670830

closes odoo/odoo#155670

X-original-commit: fca032c6cc2d6b7eb9f8c4bc71b7b259c4ce93ce
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2024-02-28 08:15:25 +00:00
Romeo Fragomeli e14edcc224 [FIX] web: squashed/wrapped text in grid layout
Since Odoo v16, we also use grid in the form layout (inner group).
In a group we use the CSS `grid-template-columns` with the value of:
* `fit-content(150px)`: for the first column (TLDR: col max 150px)
* `1fr`: for the second column (TLDR: take the "remaining" max space)
```css
.o_form_view .o_inner_group {
  grid-template-columns: fit-content(150px) 1fr;
}
```
These rules at the first glance seem correct.
But due to "big word"/language, some unbreakable text is overflowing,
to avoid this, we have added the `text-break` BS class.

So now all text can be "squash"/wrap if there is no space available.

The problem is when we have a text be too long and unbreakable in the
second column, the label (first column) is squashed to see only one or
two characters.

In our case, the bug happens when we upload a file with a big filename
to an "Attachement" (`many2many_binary`) field.

On the `many2many_binary` field there is a custom CSS rules:
```css
.o_attachment .caption {
  white-space: nowrap;
}
```
that force the text to not wrap on the next line, and so the grid takes
the width of the file name as its min value for the width of the
second column, and "squash"/wrap the first column.

This commit fixes the issue by allowing the second column to be smaller
than the `max-content` width using the css `minmax(0, 1fr)`.

Steps to reproduce:
* Open "Marketing automation" app
* Create a New campaign ("New" button)
* Click on "ADD NEW ACTIVITY"
* Select the "Mail Template" field
* Create and edit a "Mail Template"
* Click on the "Options" tab
* Upload an attachment with a long name
  => BUG, all labels (first column) are "squashed"

Note:
* the `text-break` class is equivalent to:
```css
.text-break {
  word-wrap: break-word !important;
  word-break: break-word !important;
}
```
* when we use `Xfr` (X a positive numeric value `1fr` in our case)
outside a `minmax()` notation, the GRID specs[1] specifies that it
should be converted to `minmax(auto, Xfr)`.
* also the `auto`[2] in the case of `minmax(auto, Xfr)`the value
represents the largest minimum size (in our case, the file name).

[1]: https://www.w3.org/TR/css-grid-2/#valdef-grid-template-columns-flex
[2]: https://www.w3.org/TR/css-grid-2/#valdef-grid-template-columns-auto

task-3644267

closes odoo/odoo#155650

X-original-commit: dbf1794799f2be54e0a0da7719cde3e5069fcdd9
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2024-02-28 08:15:25 +00:00
sesn-odoo c02226e434 [FIX] l10n_din5008_repair: remove reference to deleted field
Steps to reproduce
------------------
* install `l10n_din5008_repair`
* set the document layout to din5008
* create a Repair order and attempt to print it

You should be met with a traceback.

opw-3718479

closes odoo/odoo#155597

X-original-commit: aca5b96a7ffd9811d8b90a04686eeeadc55156f5
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2024-02-28 08:15:23 +00:00
Daniel Kosky (dako) f9c209d356 [FIX] base: RDC/Congo phone codes
Phone codes for the Democratic Republic of the Congo (CD) and The
Republic of the Congo (CG) are the wrong way around, and ought to be
reversed.

This commit is based on a commit that was not merged in v14.0 in this

closes odoo/odoo#155680

Pr: https://github.com/odoo/odoo/pull/133287
X-original-commit: 230914dfce7de121ad81444d953a828620177eae
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2024-02-27 22:35:24 +00:00
yosa-odoo 4e9f542cb1 [FIX] analytic: display correct analytic when using arrows
Steps to reproduce:
- activate analytic
- Create two assets with different analytic distribution
- Open the first asset
- Navigate to the second asset via the arrow

Issue:
The analytic account will not be displayed correctly

Cause:
In `jsonToData` the record used is the previous one.

Solution:
Use the record that will efectively be displayed

opw-3698383

closes odoo/odoo#153681

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2024-02-27 20:15:14 +00:00
Kartik Chavda (kcv) a9ebd07b80 [IMP] web: validate button is missing in pivot view
Steps:
- Open Timesheets
- Go to To Validate > All Timesheets
- Pivot View is rendered

Issue:
The validate button is not rendered when the pivot view is loaded

Solution:
The changes introduced in these files are aimed at enhancing the customization
and flexibility of the Pivot component in the web application. By adding the
buttonTemplate prop to the PivotController and utilizing it in the PivotRenderer
template, developers can dynamically choose the template for
rendering buttons within the pivot view. This change is particularly beneficial
for scenarios where different button layouts or styles are required based on
specific use cases or user preferences. Additionally, the introduction of a
default value for buttonTemplate in the PivotView configuration ensures a smooth
fallback mechanism if a custom template is not explicitly provided.
Overall, these adjustments contribute to a more adaptable and extensible
Pivot component, catering to diverse application requirements.

Task-3623493

closes odoo/odoo#155547

X-original-commit: f7fa6d66758b7ccbb0ae44e9f977177e6b29da6e
Related: odoo/enterprise#57591
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-02-27 17:40:54 +00:00
zel-odoo aa87b65dc8 [FIX] mail: thread search works for all channels
1. channel mention should work for channels, chats, and groups, even if
there is a group restriction for the channel.
2. channel mention in livechat is disabled because the visitor can't get
access to the channel.
3. remove the fetch and search for channel mentions in livechat so that
there is no extra rpc call for unuseful data.
4. add a test for the channel mention in thread.

closes odoo/odoo#155380

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2024-02-27 17:40:52 +00:00
mathysPaulandVictor Feyens 865b6703a1 [FIX] product,sale(_*): pricelists multi-company checks
Since 83c52575d0, there
is no default pricelist in new database, and a magic
pricelist is created for each company when the pricelist
setting is enabled.

But, since this automatically created pricelist is restricted
to a specific company, you couldn't use it as 'Base' for
rules of other pricelists, which are, by default, shared
between companies, unless you set a specific company on them.

This commit changes that default behavior, to restrict
pricelists to the current company (unless the field is
manually emptied), to avoid those multi-company issues,
particularly in single-company databases where
multi-company issues are not expected.

Also, while testing this task, we discovered that a user
could change the company of a pricelist, even if it conflicted
with existing rules.  To avoid this situation, we now trigger
the multi-company check on the pricelist rules when the
pricelist company is updated.

task-3610823

closes odoo/odoo#147014

Related: odoo/enterprise#55857
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
2024-02-27 17:40:50 +00:00
Nicolas Viseur (vin) 9e6afbd114 [ADD] Starshipit as a delivery provider
Starshipit is the leading provider of integrated
and automated fulfilment solutions for online businesses
integrating with the main carriers used in Australia and
New Zealand, such as Australia Post, DHL, Aramex, CouriersPlease and more

This PR will add support to integrate with starshipit directly in Odoo,
providing rates and shipping for users who need it.

Task ID # 3041982

closes odoo/odoo#135839

Related: odoo/enterprise#47569
Related: odoo/documentation#7798
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-02-27 17:40:49 +00:00
Pedram (pebr) 2e62a211a3 [FIX] pos_loyalty: ensure partner name is printed on reprinted receipts
Before this commit, due to a recent change, the customer name was not
being printed on reprinted receipts. This was inconsistent with user
expectations, as they expected to see the customer name on the receipt,
regardless of whether a loyalty program was in place or not.

With this commit, we ensure that the customer name is always printed on
reprinted receipts, aligning the system behavior with user expectations.

opw-3760165

closes odoo/odoo#155543

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-02-27 16:16:09 +00:00
Brieuc-brd 9853e5814e [FIX] hr_holidays: adapt hovered color on mandatory days
Commit[1] introduced a fix on the mandatory day style. But it also
creates another color issue: when we hover a mandatory day in the month
view the mandatory color dissapears.

This commit adapts the selector to handle this issue.

[1]: d75343d7d8

task-3758658
Part of task-3575827

closes odoo/odoo#155201

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-02-27 16:16:05 +00:00
aath-odoo 49cb11c058 [FIX] mass_mailing_sms: fix phone number format call when excluding number
Before this commit:
Users encountered errors when attempting to unsubscribe a phone number from
receiving SMS.

After this commit:
Now,issue has been fixed, allowing users to successfully blacklist numbers
and opt out of receiving SMS notifications. It is due to a missing parameter
when calling format method, followup of odoo/odoo@adfdf5ab33)

task-3658380

closes odoo/odoo#152638

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-02-27 16:16:03 +00:00
Victor Feyens 463d21787c [REV] sale: avoid prices recomputation
This reverts commit 789186a43c.
The fix is not necessary in 17+ since the new onchange only
sends the necessary information and not the whole x2m record
data.

closes odoo/odoo#155550

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-02-27 14:41:48 +00:00
visp-odoo 974903c3d0 [IMP] web: convert condition into function
With this commit, overriding the `onWindowClick` function from `dropdown.js`
becomes much simpler. Previously, it necessitated overriding the entire function,
but now it can be done with minimal effort by just overriding this specific part.

task-3717014

closes odoo/odoo#155326

X-original-commit: edf3c7f5c566f530bed2f243a6f78fcf7d1196d2
Related: odoo/enterprise#57471
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2024-02-27 14:41:47 +00:00
Rahul Prajapati 96debc0764 [FIX] mail: squashed transient message has date
Before this commit:

Squashed transient messages had date displayed in the sidebar of the message.
This was introduced by this commit: 631ae1c

After this commit:

Squashed transient messages would not have date in the message sidebar.

closes odoo/odoo#154594

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2024-02-27 14:41:45 +00:00
Anh Thao Pham (pta) 3bd399e2ca [FIX] base_vat: display error from VIES service
Steps to reproduce:
- Activate  "Verify VAT Numbers" option in the Settings
- Go to Contacts and create a new one
- Enter a valid EU VAT Number

Issue:
It happens that VIES service could not process the VAT number for some reason
and returns an error.
That error is silently caught without notification to user and "Intra-Community Valid"
field is set to False.
The user will wrongly think that the VAT number is not valid, but it hasn't been
processed at all.

Here's the list of the potential errors returned by VIES service:
- INVALID_INPUT
- INVALID_REQUESTER_INFO
- SERVICE_UNAVAILABLE
- MS_UNAVAILABLE
- TIMEOUT
- VAT_BLOCKED
- IP_BLOCKED
- GLOBAL_MAX_CONCURRENT_REQ
- GLOBAL_MAX_CONCURRENT_REQ_TIME
- MS_MAX_CONCURRENT_REQ
- MS_MAX_CONCURRENT_REQ_TIME

Solution:
Log a note with the error (as it is done for some other error) to warn the user that
the VAT number hasn't been processed.

opw-3687968

closes odoo/odoo#155525

X-original-commit: a15e5430d46b48821f062ffe07fd979b2f19a234
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2024-02-27 12:59:45 +00:00
Djamel Touati 7dd1ea110a [FIX] stock: set delivered quantity in returns wizard
Steps to reproduce the bug:
- Create a delivery picking:
    - product: P1
    - Qty: 10
- Mark as todo
- Set “Quantity” to = 6
- Validate the picking without creating a backorder
- return the picking

Problem:
The qty to return is 10 instead of 6

opw-3726157

closes odoo/odoo#155508

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-02-27 11:21:29 +00:00
Adnan Saiyed 9424a3b964 [FIX] web_editor: hide toolbar when picking table
Current behaviour before commit:

When text is selected, applying table command through
powerbox makes toolbar appear along with tablepicker.
This happens because selection is not collapsed.

Desired behaviour after commit:

Now applying table command through powerbox opens
tablepicker only.

task-3482230

closes odoo/odoo#155504

X-original-commit: d090b889f648d1f454d7af0bab828dc57b2df167
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2024-02-27 11:21:28 +00:00
Adnan Saiyed 66ebf39410 [FIX] web_editor: page getting crash while creating table
Current behaviour before commit:

When text is selected, applying table command
through powerbox throws error.

Desired behaviour after commit:

Now when text is selected, applying table
command through powerbox creates new table
without any traceback.

task-3482230

X-original-commit: a3384f8708c07b25d092b03b671198fd6877d1d1
Part-of: odoo/odoo#155504
2024-02-27 11:21:28 +00:00