Commit Graph
169009 Commits
Author SHA1 Message Date
Victor Piryns (pivi) c92bdffd16 [PERF] account: index account_type to speed up reports
Description:
Add missing index to speed up queries related to the P&L reports. As the
report queries per `account_type` it's beneficial to have it indexed.
The field is not write heavy, and has low count of distinct values (
since it's a selection field), so there is little downside of having it.
It is meant to support the changes done in the related enterprise PR.

Reference:
opw-3659497

closes odoo/odoo#150775

X-original-commit: 01ec86ded9128ae9fd11d27285e64d139a0ce31b
Related: odoo/enterprise#54986
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2024-01-24 06:39:17 +00:00
lejeune quentin 013a0f6f65 [FIX] point_of_sale: Fix modules version for iot
When the IoT V23_11 checkout a Odoo DB 15.0, the newest module:

urllib3
PyPDF2
Werkzeug

Can't run this Odoo version.

So we fix the version of these module to match to Odoo 15 / 16 / 17

closes odoo/odoo#150708

Signed-off-by: Yaroslav Soroko (yaso) <yaso@odoo.com>
2024-01-24 00:16:52 +00:00
Hubert Van De Walle 28a954997f [FIX] spreadsheet_dashboard: prevent crash on chart double click
Steps to reproduce
==================

- Use a mobile viewport / device (small window)
- Go to Dashboard
- Double click on a chart

=> `this.env.openSidePanel is not a function`

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

On mobile, the MobileFigureContainer is used instead of the Spreadsheet component.
The both use `useSubEnv` but the mobile one was missing the
openSidePanel function.

Solution
========

Add an empty `openSidePanel` function that does nothing.

opw-3677552

closes odoo/odoo#150702

X-original-commit: 990452ad985b1515ba565ff1fe8c6bbaa14fb031
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-01-24 00:16:51 +00:00
Hubert Van De Walle a76641cb06 [FIX] web: prevent empty json field from passing the required check
Steps to reproduce
==================

- Enable analytic accounting
- Go to customer invoices
- Open a record
- Open studio
- Click on the Invoice lines > Edit list view
- Set the analytic field as required
- Close studio
- Create a new record
- Add a new line
- Click on the analytic field
- Close the popup
- Save the record

=> Even though we didn't set a value for the field, it is saved

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

The actual field value is an empty object.
The validity of a field is checked here [0].
An empty object is considered a truthy value.

When setting the required attribute directly on the python field
declaration, an empty object does not pass the check

Solution
========

Add a specific check for json fields. When the value is either false
(not set) or an empty object, the field is considered invalid.

---

[0]: https://github.com/odoo/odoo/blob/23f01c533512cbfb33e90509e22cd3c3c4f99d40/addons/web/static/src/views/basic_relational_model.js#L284

opw-3659763

closes odoo/odoo#150677

X-original-commit: 51b538b3f678298f27bbbf458de5696706c18349
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-01-24 00:16:50 +00:00
Claire Bretton (clbr) a5d169f1a8 [FIX] l10n_ch: fix data migration
In a previous commit we fixed Swiss localization's taxes data.
We changed two children taxes that had wrong tax_type_use since it depends
on their parents.
This could raise the python constraint `_check_children_scope()` which is preventing
some databases to correctly update their taxes.

See https://github.com/odoo/odoo/commit/7b07df873535446f97abc1de9176b9332de5cb07

closes odoo/odoo#150669

X-original-commit: 90e064140b88b77d75686558106f79664da4af48
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2024-01-24 00:16:49 +00:00
Xavier ALT 4c01f803be [FIX] hr_recruitment: "Generate Email" invisible on new link tracker
To reproduce on runbot:

- Log-in as admin
- Enable debug mode
- Go to Settings / General Settings
  and ensure that there is a alias domain configured for the
  current company

- Go to recruitment app
- on "Experienced Developer", open the option dropdown (meatball)
  and click on "Trackers"
- observe there is no button "Generate Email"

The `has_domain` field serve to check if the mail alias domain is
correctly configured, before odoo/odoo@638e0f658, is was computed
only from the `mail.catchall.domain` ICP, now we only consider
the alias domain from the recruitment source alias.

  But for new record there is no alias, so `has_domain` is always
falsy which prevent the `Generate Email` button to be show.

This commit fallback to the job's or user's current company mail alias
domain to check if mail alias is correctly configured when there is no
alias on the recruitment source.

closes odoo/odoo#150645

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-01-24 00:16:47 +00:00
Yosua Nicolaus 4544b4642f [FIX] l10n_ro_edi: CIUS-RO DocumentTypeCode rule
In one of the schematron rules for CIUS-RO, there is a rule for
DocumentTypeCode element in the XML that failed the validity test.

`
<rule context="cac:AdditionalDocumentReference">
  <assert id="UBL-SR-43" flag="fatal" test="((cbc:DocumentTypeCode='130') or
  ((local-name(/*) = 'CreditNote') and (cbc:DocumentTypeCode='50')) or
  (not(cbc:ID/@scheme) and not(cbc:DocumentTypeCode)))">
    [UBL-SR-43]-Scheme identifier shall only be used for invoiced object
    (document type code with value 130)
  </assert>
</rule>
`

This commit fixes the current behavior by applying this behavior:
- DocumentTypeCode won't show up when exporting Invoice XML
- DocumentTypeCode will show up with the value '50' when exporting
  CreditNote XML

closes odoo/odoo#150613

Task-id: 3649426
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-01-23 22:52:03 +00:00
Mehdi Outagant (MOU) 124bbda127 [FIX] website: prevent using multiple content menus with the same DOM id
Steps to reproduce (17.0+):

- Go to an event website page > go to “Site” > “This Page”.

- The menu item used to edit the page content menu “Edit Event Menu” is
duplicated.

After the event page refactoring in [1], a second template using the
same content menu ID was added to customize the UI for mobile.
And since the “Edit Menu” items generation is based on detecting current
sub menus from the DOM using the same ID (`data-content_menu_id`), we
get a new menu item in the nav bar for every menu template using it.

The goal of this commit is to fix this behavior by simply ignoring the
duplicated menu IDs (The same menu record will be edited anyway).

Remark: the behavior fixed by this commit was detected in 17.0, but we
target 16.0 to prevent any potential issue linked to duplicated menus in
the DOM, also, the duplicated data attribute will be removed in master
(one ID is enough for the content menu to be detected and edited.)

[1]: https://github.com/odoo/odoo/commit/9f2442d09b62fcb3f687ec39928ea0e3ac49557e

task-3645985

closes odoo/odoo#150568

X-original-commit: e8ebb33269cbb8d049ca3e4749c486b6d137e044
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2024-01-23 22:52:02 +00:00
qsm-odoo 941f63aa2a [IMP] website: support all menus edition from a mobile device
Commit [1] (later refactored by [2]) hid the buttons which allow to
edit the main website menu and custom website menus (as the ones in
event pages), when using Odoo on a mobile device. Reading the code and
related commits, this seemed to have been done for no apparent reason.
After testing 16.0, it appears that menu edition from mobile devices was
actually not working: the re-ordering UI was strangely hidden.

After investigation, it appears that this was solved by chance, thanks
to the unrelated commit [3] in 16.2. That commit indeed removes legacy
CSS which was hiding all jQuery.ui.sortable UI elements by mistake.

In 17.0, this was further improved anyway by not using jQuery.ui anymore
(with [4]) and thus editing website menus from a mobile device works now
perfectly... except that the buttons to open the menus edition dialogs
were still hidden. This commit enables them. It was chosen to do it in
17.0 and not 16.2 as it is more an improvement than a fix in the end.

[1]: https://github.com/odoo/odoo/commit/78c59afd133de8308f4eeb6e1a2a930d870878e7
[2]: https://github.com/odoo/odoo/commit/2dc82504e08cc370b67cdf1d580f26705870a085
[3]: https://github.com/odoo/odoo/commit/ee3e28987eb1ec23b8bacc7c4043d9690aada144
[4]: https://github.com/odoo/odoo/commit/a4b1c268131ed771dd68616a26a9f1ce50a189f0

Related to task-3645985

closes odoo/odoo#150530

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-01-23 22:52:00 +00:00
Florent de Labarre 3789a944ac [FIX] website_sale: internal user cannot go to shop page
- Create a company A with a ebsite
- Create a company B without website
- Create user 1 in company B only
--> Issue when user 1 go to /shop --> error 403

Due to security restrictions, you are not allowed to access 'Companies' (res.company) records.

closes odoo/odoo#150529

X-original-commit: be5bf24234955a4f9ccc044482b71ab37a44b8b0
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-01-23 22:51:59 +00:00
Jinjiu LiuandGoaman bc440ff045 [FIX] web_editor: blinky colorpicker when applyColor on removed fonts
Reproduction:

1. in Note, type ` abcd ` in an empty note
2. color the background of all the text, bold `abcd`
3. select from the end till the letter `b`, try to change the color,
traceback pops up

Fix: The main reason is we remove element in `splitElement`/
`splitAroundUntil`. In this special case, there are two selected nodes
which returns the same font element. The first font element will be
removed and replaced first. Because the first font element doesn’t exist
anymore, when recovering selection, the second element considered as
collapsed and the recovered selection is a caret. Thus the color picker
is gone after applying the color (preview)

The fix is then, we always make sure that the font we have is still
connected to the page (exist in the page), otherwise it’s problematic to
apply color to a non-existing element and recover cursor from it. If
there is font element(s) that is not connected, we simply get the fonts
again, because new font element is created for the second node, it won’t
split (remove) the first node’s font element again

Task-3476494

closes odoo/odoo#150500

X-original-commit: 06a8b930176093e2c5a853b78431316af90f3550
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Signed-off-by: Jinjiu Liu (jili) <jili@odoo.com>
Co-authored-by: Goaman <nby@odoo.com>
2024-01-23 22:51:57 +00:00
Thomas Lefebvre (thle) aba7b00cd8 [FIX] hr_timesheet: add fallback to current company to get UoM
Steps to reproduce:
-------------------
- install helpdesk_fsm and sale_timesheet;
- to be in a multi-company environment;
- create a new helpdesk team with "Timesheets", "Time Billing";
- the newly created project has no company;
- create a service product that creates a task with UoM in hours
in the newly created project for the helpdesk team;
- create a sale order with this product with a quantity of 100 hours and confirm it;
- in the helpdesk app (in the new team), create a ticket linked to the sale order line
of the product (the customer is necessary);
- on the ticket the "Remaining Hours on SO" is 100 hours;
- create a timesheet directly in the tree view;
- the remaining hours of the sale order are reduced;
- create a timesheet from the timer;
- the remaining hours of the sale order are not reduced;

Cause:
------
During the link between the newly created timesheet and the ticket,
we write to the `helpdesk_ticket_id` field (during the flush) in the `account.analytic.line` record.
As a result, we pass in the override of the `write` method, which calls `_timesheet_preprocess`.
Without a company on the project (or on the analytic account if there is one),
the value `{'product_uom_id': False}` will be added to the values to be written to the timesheet.
Without a unit of measurement, the timesheet will not be used to calculate the remaining hours.

Solution:
---------
Add a fallback on the current company if no company is found.

opw-3651830

closes odoo/odoo#149917

X-original-commit: 2e5c13b0dea40f349e96cadf9d02fdb3c1746c7e
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-23 22:51:53 +00:00
Antoine Vandevenne (anv) 5cea9dddcc [IMP] payment: improve test coverage
Some logic of the `payment.provider` and `provider.method` models was
not properly covered by unit tests.

closes odoo/odoo#149833

Related: odoo/enterprise#54930
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-01-23 22:51:51 +00:00
Ali Alfie (alal) ba1706eca1 [ADD] l10n_es_edi_facturae_invoice_period: invoice periods for EDI
Patch module to add missing fields to the factura-e xml.

task-3673113

closes odoo/odoo#149362

Signed-off-by: William André (wan) <wan@odoo.com>
2024-01-23 22:51:50 +00:00
vava-odoo ff2906aaf0 [IMP] product,sale(_pdf_quote_builder): embed further pdf quote builder
This commit improves the user experience with pdf quote builder by
- showing document for both product template and product variants
- providing pdf example for headers/footers

task-3543479

closes odoo/odoo#146183

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-01-23 22:51:49 +00:00
Lucas Lefèvre (lul) aae6b72823 [IMP] spreadsheet: allow to sort month pivot headers
Currently, if you have a pivot grouped by a date field, aggregated by week
month or quarter, sorting all the pivot cells does not work as expected
when sorting based on the date header column.
"April 2023" would end up being before "March 2020" just because "A" is
before "M". Similarly, "W1 2023" is before "W2 2020" and "Q1 2023" is before
"Q2 2020"

With this commit, for months aggregates, the result of
`=ODOO.PIVOT.HEADER(1,"create_date:month","04/2023")` is currently the
string "April 2023".
The result now becomes a real date just like any other date value
in a spreadsheet. It's the number corresponding to the first day of the
month.

For week and quarter aggregates, we could move the year first ("W1 2023"
becomes "2023 W1"). However, we decided not to do it to keep consistency:
- with other places in odoo (pivot views)
- with the way we talk/think (quarter/week comes first)

closes odoo/odoo#139295

Task: 3570281
Related: odoo/enterprise#49300
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) 06920e4176 [REM] spreadsheet: remove unused method
Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) 943a2fb021 [FIX] spreadsheet: format pivot days header
This commit fixes 2 very similar issue.
See enterprise commit.

- Group a pivot by any date field, with the day aggregate
- insert it in spreadsheet
- autofill a pivot function
=> the autofill tooltip displays the day number instead
   of the day formatted as a date.

- on the same pivot
- click on menu "Data > Insert pivot > insert pivot cell > [you pivot]"
=> in the dialog, numbers appears for the headers.

Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) e55dad2d30 [REF] spreadsheet: factorize pivot value format
This commit factorizes how the format is computed for ODOO.PIVOT and
ODOO.PIVOT.HEADER functions. It was essentially duplicated.

Also move the date(time) format responsibilty to each time adapters,
instead of handling the different aggregate cases separatly.

This commit also prepares the next commit which fixes a formatting bug.

Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) 33b910fcfd [REF] spreadsheet: colocate special args in one place
For the ODOO.PIVOT.HEADER functions, "special" values such as measure and
total were managed in different places (total management  was also duplicated
 see enterprise commit).

Now the measure and total are managed in one place, in the high level method.
There's also now a dedicated method to get a measure display name. The method
`getGroupByDisplayLabel` was perverted at that purpose (see enterprise commit)

Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) fbfc5b2d5d [REF] spreadsheet: clean method names
Method names in the pivot data source/model are not particularly clear
and self-explanatory.

To commit renames some methods (and their argument names) with hopefully
more meaningful names.

I'm also moving `getDisplayedPivotHeaderValue` (now
`computeOdooPivotHeaderValue`) from the model to the data source. It's
a high level function, the implementation can be in the data source.

Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
visp-odoo 47ce4a3623 [FIX] web_editor: wrong time in history of changes
Before this commit:

When a user edits an article and selects the restore button to revert to a
previous version, the displayed time is incorrect because it shows universal
time instead of the user's timezone.

After this commit:

When a user edits an article and utilizes the restore button to revert to a
previous version, the timestamp will now reflect the time in the user's current
timezone.

task-3641579

closes odoo/odoo#149177

Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2024-01-23 19:49:34 +00:00
Shubham Thanki 8da12ebd75 [FIX] mail: stop the bubbling of various click events
Technical Reason:
- The events bound to the specific elements inside the `FileViewer` are
propagating/bubbling up and are triggering the `onGlobalClick`
(https://github.com/odoo/enterprise/blob/eaf40edbbacfc6a8eb9e0137c20e7f94b1f5d723/documents/static/src/views/kanban/documents_kanban_renderer.js#L36-L42)
event bound on the `DocumentsKanbanRenderer`.
(https://github.com/odoo/enterprise/blob/71dbc617d6fe533c4d0153361f9711bd4c9e4885/documents/static/src/views/kanban/documents_kanban_renderer.xml#L6)

After this commit:
- Only the events bound to the specific HTMLElements are now triggered.
- We successfully prevent the un-necessary call of the `onGlobalClick`
method mentioned above.

Refer the related enterprise PR for the test case of this fix.

Task-3489455

closes odoo/odoo#150257

X-original-commit: e321fe3a40dd470095c79e7abcd273d6fa0cfe7c
Related: odoo/enterprise#54752
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2024-01-23 18:27:45 +00:00
lejeune quentin c17917b8d2 [FIX] point_of_sale: Stop Odoo service during a checkout
Actually when we link a DB and the iot need checkout a
specific version of Odoo, the service odoo in the iot
is still active.

This can disrupt the checkout and make the box unusable.

So now we stop the odoo service before the checkout.

closes odoo/odoo#150190

X-original-commit: 3e6700c7be8e58f07791ab1ef2b7b77b7a0597e2
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Yaroslav Soroko (yaso) <yaso@odoo.com>
2024-01-23 18:27:43 +00:00
Nicolas Martinelli 85c06dd3ae [IMP] base: log job duration
Log the job duration of the usual `INFO` level for easier monitoring.

closes odoo/odoo#149881

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2024-01-23 18:27:42 +00:00
Louis (loco) be782ddde5 [FIX] web_editor, *: correctly display the hierarchy between elements
*website

Steps to reproduce:
- Drop a "Text-Image" snippet on the website.
- Click on a column and hide it on desktop.
- Click on the parent snippet and hide it on desktop.

-> The column is not a child of the parent in the invisible entry.

Since [1], invisible snippets are shown hierarchically in order to
better visualize the "parent-children" relation that could exist between
them. To do so, [1] based its logic on the `.o_snippet_invisible` to
find the invisible elements. However, since [2], a distinction has been
made between elements that are hidden only on desktop, only on mobile or
on both depending on some conditions. The goal of this commit is to take
the new `o_snippet_mobile_invisible` and `o_snippet_desktop_invisible`
classes into account at the creation of the invisible entry.

[1]: https://github.com/odoo/odoo/commit/922d3e63b597b1ef7fbbb5ebb4641a3ad8bdf4ed
[2]: https://github.com/odoo/odoo/commit/3103e0553011b5c1f4078972d7a88fa3fd4068b2

task-3679823

closes odoo/odoo#150512

X-original-commit: c8f247ee5fa178f012b2852cba3d0e9322a2c3a6
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2024-01-23 16:01:50 +00:00
roen-odoo d45e933a89 [FIX] point_of_sale: Correctly delete linked pos_printer to iot_box
Current behavior:
You couldn't delete an iot_box if a pos_printer was linked to it.
You always get a validation error saying that "Proxy IP cannot be empty"
To fix this we first want to check that the device_id linked to the
printer still exists. To do this we need to move the constraint to the
pos_iot module (because the device_id field is defined there)

Steps to reproduce:
- Install pos_iot
- Activate preparation printer in POS
- Create a printer and link it to an iot_box device
- Try to delete the iot_box

opw-3597370

closes odoo/odoo#150502

X-original-commit: 7b41e51043c1f80971f6cc698876f8bda35f07ef
Related: odoo/enterprise#54874
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2024-01-23 16:01:47 +00:00
snd 72c4a2352c [FIX] mrp: have a coherent flow for replenishing after scrap
When ticking 'Replenish' on a scrapping, the created move is unrelated to the
production order. This means that in a 2-steps manufacturing flow, validating
the move will not automatically reserve the product(s) on the production order
as is done when validating the moves created by the MO confirmation.
This is because the new move has no move_dest_ids.

This fix has 2 parts:
- first, add the new move to the already existing procurement group of the MO
so that it is easier to find.
- second, assign a move_dest_ids to that move so that when it is validated,
the quantity is automatically reserved on the MO.

opw-3560182

closes odoo/odoo#150499

X-original-commit: 71ae6392c3626da58b6c7440f93c8661e99fe314
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Stéphane Diez (snd) <snd@odoo.com>
2024-01-23 16:01:46 +00:00
Julien Castiaux 5a14c8d5a6 [FIX] mail: support hebrew charset iso-8859-8-i
One of our customers is receiving emails with headers and attachments
encoded using the "iso-8859-8-i" charset instead of "iso-8859-8" which
is natively supported by Python. Both encoding are using the same
character set[^1] and only differ in the way the text is rendered on
screen[^2][^3] which is not revelant for Python.

Add an alias for iso-8859-8-i so that the emails that this customer
receive stop failing in Odoo. Note that there is a PR opened on
CPython for exactly that, see [bpo-18624].

opw-3653210
[bpo-18624]: https://bugs.python.org/issue18624
[^1]: https://encoding.spec.whatwg.org/#legacy-single-byte-encodings
[^2]: <data:text/html;charset=iso-8859-8,hello%20%E0%E1%E2%E3>
[^3]: <data:text/html;charset=iso-8859-8-i,hello%20%E0%E1%E2%E3>

closes odoo/odoo#150467

X-original-commit: 5a025467a605ca4fa963b79bae254c823518d54c
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2024-01-23 16:01:43 +00:00
shsa-odoo 59e252c715 [FIX] web_editor: font styles shows active while selecting cells
Before this commit:

-Font styles shows active while selecting cells.

After this commit:

-Font styles should not be active by default.

task-3547652

closes odoo/odoo#150443

X-original-commit: d026f4d7160ec00b6cb27b4cf5b34afc9dbfda13
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2024-01-23 16:01:42 +00:00
Benoit Socias 140e58c5a6 [FIX] web_unsplash: ignore received duplicates
When obtaining several batches of images for the same string query on
Unsplash, sometimes the same image appears in several batches.
Because of this the `t-foreach` in the `web_unsplash.ImagesListTemplate`
template fails when duplicate records appear in the list of images.

This commit ignores duplicates received from Unsplash to avoid the
issue.

task-3637756

closes odoo/odoo#150511

X-original-commit: 78cad00e169e42d13aecf37ffb19615d725f4e2d
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2024-01-23 09:47:24 +00:00
Yolann Sabaux 6e56b09573 [FIX] account_edi_ubl_cii: strip phone number ubl
Steps to reproduce:
[l10n_sa_edi]
- create a SA customer with phone number e.g.:`+971 56 777 7777`
- create an invoice
- Zatca Process it

Issue:
Error: "The Buyer’s contact phone number (BT-57) shall start with “0“ or “+”, followed by a maximum of 15 number and minimum 4 character after the “+“ or “0“ , if exist."

Solution:
For Saudi Arabia, it is not necessary to have the phone number.
For other locations, I assume that stripping the phone number could not harm the process.

opw-3666195

closes odoo/odoo#150495

X-original-commit: c8d93c7574f97ddd8924ed80031327db36c1c336
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2024-01-23 09:47:23 +00:00
visp-odoo 2bb2349e49 [FIX] web_editor: can't get out of inline code block
Before this commit:

If we entered text within a inline-code block and pressed the backspace key,the
zero-width space (zws) at the end of the inline-code block would be deleted.
Consequently, there was no way to exit the inline-code block.

After this commit:

Users can now navigate out of the inline-code block by using the right or left
arrow keys when inside an inline-code block.

task-3613340

closes odoo/odoo#150453

X-original-commit: 31c73e9dd53fa0f7379d87e9c9970b2788e454cd
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2024-01-23 09:47:22 +00:00
sesn-odoo 3ca0e0c55f [FIX] l10n_ph: ensure string input in regex substitution
Steps to reproduce
------------------
* install `l10n_ph`
* switch to a Filipino company
* create a vendor bill with a line with no product and a tax that has a
  "Philippines ATC" defined (ex: 5% WI010 - Prof Fees)
* attempt to generate the `BIR 2307 Report` through the action menu

You should be met with a traceback.

opw-3683037

closes odoo/odoo#150566

X-original-commit: c1ab55fd1e0eecb9848392995f91d994ad6d4d4c
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2024-01-23 07:07:55 +00:00
Olivier Monnom (mool) d5822a1f72 [FIX] point_of_sale: Select the NetworkManager or directly wpa_supplicant
Above IOT Image 23.09, the Debian "bookworm" distribution is used. This
distribution uses the NetworkManager configuration tool suite to setup
the network. This break the code used until 23.09 included.
In this PR, the code check the Image version and switch to NetworkManager
if necessary.

Before: Conflict with wpa_supplicant management in Debian "bookworm"

Now: The network management tool is choosen in relation to image version

mool

closes odoo/odoo#150560

X-original-commit: 8f96e05c851a748c93caa7577e9af87f724adad1
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2024-01-23 07:07:54 +00:00
Achraf c096cccb4d [FIX] web: usable *_activity widget in many2many subview
Example of steps:
	- Install `web_studio`
	- add a `many2many` field from res.partner
	- create a record
	- add a line by selecting a partner

In this case `_parseServerValue` will crash

https://github.com/odoo/odoo/blob/29d55e44035b6e6c6aba6fa4a114d555a766b7c7/addons/web/static/src/legacy/js/views/abstract_model.js#L101-L111

Because `field.selection` is undefined
this code is getting field from this line

https://github.com/odoo/odoo/blob/d3ef5891e8e92636dd61b8f2b7186ad139e8b42a/addons/mail/static/src/web/fields/kanban_activity/kanban_activity.js#L14
Instead of specifying `selection: []` in the fieldDependencies
this pr fixes this issue generally and prevents these kind
of fixes https://github.com/odoo/odoo/pull/125052

opw-3671417

closes odoo/odoo#150445

X-original-commit: 139e107a58ff4be4f03a57df07806355cb7d6236
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2024-01-23 07:07:53 +00:00
Naman Shah 32c6377563 [FIX] l10n_in: invisible the l10n_in_pan field if company is not indian
Before this commit:
If Indian-Accounting is installed in the user's system but the user is in
another company, still the l10n_in_pan(PAN) field is visible.

Technical Reason:
attrs was not there to invisible the field.
Adding invisible attrs if the active company is not Indian.

After this commit:
l10n_in_pan(PAN) field is not visible if the active company is not Indian.

Task-3635445

closes odoo/odoo#149496

X-original-commit: 5fb795f5ab3b54b2c37fe1b734f949cc3ce9a6de
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Naman Shah (nash) <nash@odoo.com>
2024-01-23 07:07:52 +00:00
Dylan Kiss (dyki) 708088d5ad [FIX] account: no default taxes on cutoff entries
When creating a cut-off entry with an account that has a default tax
configured on it, we don't want that tax to be computed on the cut-off
entry again. Reason is both that we don't want to impact the tax report
again with these taxes, and it would also create an auto-balancing line
to balance out the computed tax on a suspense account, which is pretty
confusing to the user.

task-3650271

closes odoo/odoo#150446

X-original-commit: acf21ee79cb97470c014e0897316f0c59e2ee485
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2024-01-23 05:56:22 +00:00
Florian Charlier c3b7eac631 [FIX] website_forum: avoid search in a loop for last post
Computation of the last post shouldn't be done with a
db request for each forum but can be batched.

Technical note:
As it is likely that `post_ids` is not yet fetched when we're
accessing `last_post_id` we chose not to early return if no
forum in `self` included posts already.

Version choice:
We chose this version to merge this as it is the one where
forum was taken over, and _read_group refactored.

A test for this computation is also added.

Task-3685002

closes odoo/odoo#150444

X-original-commit: ba3af942deee4818edb32d08b9bb07652253a029
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
2024-01-23 05:56:21 +00:00
Alexandre Kühn e5d7c4fef2 [FIX] mail: squashed message don't grow on mousehover
Before this commit, when a message without bubble layout
is squashed (e.g. with `/who` command twice in a channel),
mouse-hovering on the squashed message pushed increased the
height of the message.

This happens because the sidebar of squashed message contains
the date and it uses 12-hour format with AM/PM.

This design requires cautious use of content in the sidebar,
and had 24-hour format to make it work. A recent refactoring
changed it to 12-hour format as localization was a better concern.
However, the UI is not designed for it, and there's not much value
in having 12-hour format rather than 24-hour format. Indeed,
users assume AM if no AM/PM is shown, except if hour is greater
than 12 which is quite obvious the current time.

12-hour format is best for some users, but we can't have it without
overhauling parts of the UI which is not worth it at the time of
this commit. Therefore using 24-hour format is the better tradeoff.

Also took the opportunity of this PR to better align the date and
seen indicator in squashed message sidebar.

Task-3637270

closes odoo/odoo#150369

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-01-23 04:41:44 +00:00
Philipp Walter 3d0c3a4262 [FIX] account: fix account demo data import
Steps to reproduce:
- Re-install Odoo 17 with custom account demo data (e.g. account.account.csv)

Issue:
TypeError: 'ABCMeta' object does not support the context manager protocol

Cause:
In load(), commit 2ca15862a731a84560f761fc5e7b65e6d2885c54 introduced the line `manager = nullcontext`, which must be `manager = nullcontext()` (https://docs.python.org/3/library/contextlib.html#contextlib.nullcontext).

closes odoo/odoo#150364

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-01-23 04:41:43 +00:00
Philipp Walter 399a43d25e [CLA] INFOSERVE GmbH CLA
Part-of: odoo/odoo#150364
2024-01-23 04:41:43 +00:00
Simon Genin (ges) e4dda761ed [FIX] web: kanban column quick create validates on enter
When creating a new column in kanban view, the user should be able to
either hit enter or click the add button. This launched the validation
process to add the column.

There has been a fix in owl that would force a t-model.trim to be lazy.
This was causing problems in this case as the "enter" pressed by the
user was detected through the hotkey system. This was causing the
change event not to fire, resulting in the behavior of the feature being
broken.

We fix this by using the t-on-keydown directive instead of the hotkey.
We also remove the t-model directive as it is no longer of any use.
The trim is done in the validate function.

task id 3691208

closes odoo/odoo#150297

X-original-commit: e3ad26632b00d0b0dded25282e4dc910983ef9dc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2024-01-23 04:41:41 +00:00
Carsten Wolff (cawo) 683a51bd27 [FIX] http: close request resources when done
Currently, when a worker (process/thread) has finished processing a request, it
will keep handles on resources held by the werkzeug `Request` object. This
includes open filhandles to temporary files, e.g. those of uploaded files. On
platforms supporting `O_TMPFILE`, these files are not visible in the
filesystem, but keep using up space in `TMPDIR` until werkzeug finally closes
the file handles when the next Request is being handled.

In some contexts, e.g. the upgrade platform, it can happen that there are
multiple workers that only handle rare requests that upload big files (multiple
GiB), kept open after the upload has finished:
```shell
lsof -nP | grep -E 'odoo\/tmp.*(deleted)' | grep -vE 'GeoIP'
python3 213853                odoo 13u REG 252,3 1064251 926275 /home/odoo/tmp/#926275 (deleted)
python3 213853 213865 python3 odoo 13u REG 252,3 1064251 926275 /home/odoo/tmp/#926275 (deleted)
```
This can pose problems, because often the filesystem on `TMPDIR` is not very
large and idle workers holding on to large files can increase the chance for
ENOSPC.

This patch changes the behavior such that the resources held by the werkzeug
`Request` object are being closed[^1] after the response has been sent out.
This also has the advantage that this work is done at potentially idle time
instead of within handling the next request.

[^1]: https://werkzeug.palletsprojects.com/en/2.0.x/wrappers/#werkzeug.wrappers.Request.close

closes odoo/odoo#150029

X-original-commit: a920ddca57e7bf9353611396f1c0b1060c8cb044
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2024-01-23 04:41:40 +00:00
Pedram (pebr) e18a2daa42 [FIX] point_of_sale: use journal account when income account is missing
Prior to this commit, when the product income account was absent, and
the product category income account was also missing, PoS would fail to
create an invoice. Now, it correctly utilizes the PoS config journal
default account.

opw-3615194

closes odoo/odoo#149816

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-23 00:52:39 +00:00
roen-odoo 956cd636b0 [FIX] pos_restaurant: make sure split bill product list is scrollable
Current behavior:
When the list of order line is too long in the split bill screen there
was no scroll bar to see the last order lines.

Steps to reproduce:
- Open PoS restaurant
- Create a new order
- Add a lot of order lines
- Click on the split bill button
- The list of order lines is not scrollable

opw-3676165

closes odoo/odoo#149800

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-22 21:10:48 +00:00
Romain Derie 41e2c4859b [FIX] website: properly filter website.page records on list/kanban view
Note: This fw-port commit cherry-picked and squashed commit [2] directly
      as it was fixing this original commit before it had the chance to
      be forward ported.

Since commit [1], which adapted the website pages list view to OWL, the
records listed on screen are filtered according to the active website
filter. However, the full list of records is still used behind the
scenes for all potential actions.

Steps to reproduce:
1. Go to the pages list view.
2. Select a specific website (if it's not already the case).
   => The total of records in the upper right corner does not match the
      number of pages on that specific website.
3. Click on the "Select all" checkbox.
   => All the pages are selected, including those that do not appear on
   screen.

This is because the records were just visually hidden with a `t-if`.

[1]: https://github.com/odoo/odoo/commit/940f4ee875332dafa1f379970a7683be6b3ee606
[2]: https://github.com/odoo/odoo/commit/db670f64f4c2190f1655f9077ea62885049a3c84

Courtesy of @robinlej and @detrouxdev

Related to task-3676124
opw-3554064
opw-3658648

closes odoo/odoo#149547

X-original-commit: 8d78a916dc8c0eca82e8a6a2c6f5541938709930
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-01-22 21:10:46 +00:00
Andrea Grazioso (agr-odoo) 772e713317 [FIX] hr_expense: allow minor edits in expense payment
Create an Expense Report
Add an expense paid by company
Submit to manager > Approve > Post journal entries
Choose the payment method to be Checks
Open Accounting dashboard, in Bank card click on 'Checks to print'
Select the check
Print the check

Issue: Action will be blocked by error
"You cannot do this modification since the payment is linked to an expense report."
This occurs because the system does not allow writing to the payment record
once it has been linked to the expense

This commit allow to edit fields that would not trigger a move
synchronize

opw-3633035

closes odoo/odoo#149440

X-original-commit: fa89fcf7a30edf760bbba1920966ed4595e45fe8
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2024-01-22 21:10:45 +00:00
Julien Castiaux 09093a51ae [FIX] survey: bad orm.read usage when updating attendees count
Start a live session, on the manager side stay on the welcome page (the
one that counts how many attendees joined). Using several other private
browsing tabs join the live session. On the manager side, the number of
attendees never changes.

During a previous refactoring of legacy rpc => orm, an error slipped,
instead the records and fields as separated arguments, the two were
passed together as a list in a single argument.

We used the opportunity to increase the verbosity in case of errors and
to enrich our test cases.

Fine tunning of 7422eb6 ([IMP] *: remove legacy rpc)

Task-2834638

closes odoo/odoo#149427

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-22 19:01:03 +00:00
william-andre b4ccdb34b6 [FIX] account: performance of reconciliation
Instead of trying to find the reconciled lines recursively, we can use
the `matching_number`, since it now has a distinct value for each
subgraph of reconciliation even for partials graphs.

The situation in 16 was computing the graph by doing one query per level
of depth. In 17, before this commit, only one query was done but
computing the graph from each node, leading in a worse time complexity.
The result was that for small batches, it was slightly faster in 17 than
16 but considerably slower for bigger batches.
This commit just makes things go zoom in all cases.

closes odoo/odoo#149336

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-01-22 19:01:02 +00:00