Commit Graph
159045 Commits
Author SHA1 Message Date
std-odoo da48700b59 [IMP] base: do not modify the cache when reading properties fields in batch
Purpose
=======
Do not modify the cache in order to improve the performance when we
read in batch. Instead we create a new batched method "convert_to_read"
that check existence in batch, and generate a dict with the result.

Now, all the properties field checks (many2one existence, selection option
still exists, tag value stiff exist, etc) and done in "convert_to_read".

It means that doing `record.properties` won't do all those checks.

Having the batched field fetch at the convert_to_record required too
many changes for the scope of this task, so "record.properties" having
the cache values unchecked is an acceptable tradeoff currently, hence
we batch convert_to_read.

Task-2980121

Part-of: odoo/odoo#101901
2023-03-07 01:59:04 +01:00
Maximilien (malb) df997b1d01 [IMP] l10n_mn:translation
Before this PR, all this localisation was written in Mongolian, but all the localisation have to be written in english and then translated back in the native language. This PR correct that.

closes odoo/odoo#113465

Task-id: 3166094
Related: odoo/enterprise#37442
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-03-07 00:31:13 +01:00
william-andre 871f35b089 [FIX] account: installation of CoA in UI
It was impossible to install a CoA in the UI because the selection field
didn't have any possible values. The cause was that when we tried to
fetch the values for `account_templates`, the `contains_field` was
returning True even though `get_records` was not returning anything.

Reproduce:
* Create a new company
* Go to Accounting Settings
* Select a fiscal localization and save

opw-3212601

closes odoo/odoo#114164

Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-06 23:34:50 +01:00
william-andre 8e6a3d7269 [REF] l10n_*: clean code
A lot of the separate files were kept up to now because it made the
process easier while applying the script to rebase.
The files can now be merged.

Some code is also cleaned by using CSV instead of a python dict.

Part-of: odoo/odoo#114164
2023-03-06 23:34:49 +01:00
baa ef5d43a4d2 [FIX] l10n_eg_edi_eta: fix the url within the qr code on the egyptian invoice
The URL computed by Odoo was not mathing the URL computed by the ETA system. The previous endpoint used was https://api.invoicing.eta.gov.eg instead of https://invoicing.eta.gov.eg. Also the url contained '/search/' which should not be there. Correct format should be https://invoicing.eta.gov.eg/documents/id/share/long_id

closes odoo/odoo#113937

X-original-commit: 70f6199401cfde0cdb7864910f9e8e14117981b6
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-03-06 23:34:46 +01:00
Shawcker 0a5583f07a [IMP] l10n_no: update Norwegian tax report
The Norwegian tax report is outdated as of January 2022 and currently displays values that do not fit directly into the new mandatory reporting system set up by the Norwegian Tax Authorities.

Change:
  - Update tax report tax lines to match the required fields

task id=2667013

closes odoo/odoo#113324

X-original-commit: da1e6c571d96dc6834c0e7710c6b237fd476f69c
Related: odoo/enterprise#37380
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-03-06 21:55:44 +01:00
Julien Van Roy ab0191dca2 [IMP] point_of_sale: add code on ticket to create invoice
Currently, it is possible to add a QR to generate an invoice for a pos
order at a later time (see
https://github.com/odoo/odoo/commit/14183883432e9d35c6240e1d7dc8c51d04cb93db).
When scanning the QR, the customer can fill various fields (including
potential l10n_* specific fields) and then generate an invoice.

This commit makes it possible to add a 5-digits code on the ticket. A
customer can go to `pos/ticket` and fills this code, the date and the
order reference written on the ticket. He will then be redirected to the
same flow as when scanning the QR code.

task-3178954

closes odoo/odoo#112285

Related: odoo/enterprise#36859
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-06 21:01:28 +01:00
Michael (mcm) 13fc4751a4 [IMP] web: allow to move dialog
After this commit, the user will be able to move dialogs
to see the content hidden behind the dialog.

closes odoo/odoo#111654

Task: 3132894
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 18:52:52 +01:00
Michael (mcm) 15200a122e [IMP] mail,*: revamp activity records UI
* hr_holidays,project

This commit revamps some activity records UI in different applications.

closes odoo/odoo#111373

Task: 3133150
Related: odoo/enterprise#36473
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 18:52:47 +01:00
Martin Maes 2b907e9f95 [IMP] deliver: add fixed margin
Removed the margin on rate when the provider is Fixed Price

Removed the margin on rate, free, amount when the provider is Based on Rules

Added a fixed margin for all the other providers

task-3043063

closes odoo/odoo#108794

Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-03-06 18:52:41 +01:00
std-odoo 97ca45e4f3 [IMP] mail, mass_mailing: store the bounce email and allow the user to read it
Purpose
=======
The bounce emails aren't stored in Odoo, which can complicate the
debugging of the email sending.

Now, we store this bounce email, and we allow the user to read it from
the interface, so he can easily find the issue when an email sending
fail.

Specifications
==============
The bounce email is stored on the mail notification for standard emails
sending, and on the mailing traces when using mass mailing.

For some email providers (e.g. Yahoo), the "Final-Recipient" header is
not present. Normally, it allows us to retrieve the original recipient
of the email which bounced and then the partner. So if this header is
not there in a bounce email, we take the first recipient of the parent
<mail.message>.

Change the way that we parse the email body, for the bounce email.
For most email providers, the first mail body is the one that contains
the error and the next one contains the parent email body. So, the
current logic might ignore this body for Outlook and Yahoo.

Task-2116296

closes odoo/odoo#105923

Related: odoo/enterprise#34051
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-06 17:47:29 +01:00
Jérémy Hennecart (jeh) a25ab87abe [IMP] crm: improve log meeting
When logging a meeting linked to a lead we now add a link to the
record. The link takes the place of the subject as it's the same
displayed value.

task-2984657

closes odoo/odoo#106546

Related: odoo/enterprise#32945
Related: odoo/upgrade#3974
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-06 17:47:18 +01:00
Thomas Josseandstd-odoo 0ffa2d64ba [IMP] gamification, website_forum, website_slides: karma tracking improvement
Purpose
=======
Some users found a way to farm karma points, so we want to be able to
track the source of the karma gain / loss.

Specifications
==============
Now, we added a reference field `origin_ref` which store the record
responsible for the karma gain / loss (e.g. a slide we just completed).

In addition to this origin, we also have a new field to store the
reason (e.g. "Slide completed") so we know exactly what happened and
how the user gains his karma.

Before, the `old_value` of the karma tracking has to be set manually,
but now it's done automatically based on the value of the previous
tracking of the same user. That way, it will simplify other part of
the code.

Add the karma reason in the website modules. Adapt those modules due
to the changes in gamification.

Task-2234179

closes odoo/odoo#76430

Related: odoo/enterprise#23702
Related: odoo/upgrade#3299
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Co-authored-by: std-odoo <std@odoo.com>
2023-03-06 17:47:09 +01:00
std-odoo f76e65118e [IMP] website_slides: remove the karma gain on vote
Purpose
=======
Remove the karma gain on vote, because it gives an incentive to like
all slides and to never dislike.

Task-2234179

Part-of: odoo/odoo#76430
2023-03-06 17:47:09 +01:00
william-andre 07ff047b9d [FIX] account: manage base locale in CoA loading
If we had a name that is translated in the template files with the base
locale instead of the fully qualified one (i.e. `fr` instead of
`fr_BE`), we would only store `fr`, which the ORM doesn't understand as
there is no fallback on the generic locale (only on `en_US`)

Instead of storing the translation values straight out of the record's
values dictionary, we are now doing something similar as the generic
`_load_module_terms`, loading only the languages being installed, and
using the fallback on the generic locale there.

closes odoo/odoo#113886

Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-06 15:18:54 +01:00
FrancoisGe 17a24020ac [REF] *: do not use activeFields in Field components
This commit is to replace all uses of activeFields in Field components
by passing fieldInfos to extractProps. We will therefore retrieve the
node-dependent information in the extractProps function.

Why?
This ensures that the info used is that of the correct node. Because the
activeFields function contains the information from the last node that
referred to the same field.

Example:
<tree>
    <field name="a"/>
    <field name="a" context='{'b':"yop"}'/>
</tree>

For the first field:
    FieldInfo.context = {}
    activeField.context = {'b':"yop"}

For the second field:
    FieldInfo.context =  {'b':"yop"}
    activeField.context = {'b':"yop"}

Part of task: 3179751

closes odoo/odoo#113874

Related: odoo/enterprise#37621
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 15:18:48 +01:00
David Monnom (moda) 3620ae22ba [IMP] point_of_sale: loading animation send and print receipt
Before this PR, the user was not sure that the sending of mail / printing
of the ticket was done because no animation was triggered when the button was clicked.

Now a loading icon replaces the original icon during the sending or printing of the ticket.

closes odoo/odoo#112899

Taskid: 3177518
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
2023-03-06 14:15:27 +01:00
Arthur Detroux (ard) f80e411f67 [FIX] website: give correct height to image gallery on smaller screens
Prior to this commit, the height of the Image Gallery snippet was set to
auto on screens smaller than 400px.

This ensures that the snippet looks the best on phones.

However, when using Bootstrap, what defines a smaller screen is not
any screen below 400px, but any screen below 768px.
This meant that the Image Gallery snippet did not look the same on an
iPhone 11 Pro max as it would on an iPhone 11 for example.

This commit fixes that by using the built-in mixin that relies on
Bootstrap's breakpoints (in this case MD).

Steps to reproduce:
- Go in edit mode and drop an "Image Gallery" snippet
- Open the dev tools and choose "iPhone 11" or 375x812
- The image gallery does not have white bands
- Change the resolution to "iPhone 11 Pro Max" or 414x896
- The image gallery has white bands / has a different layout

opw-2995100
task-2997119

closes odoo/odoo#114319

X-original-commit: 94a1a8535b9bd9590ff5212e1d15653a6a6ccdb7
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2023-03-06 13:13:22 +01:00
Aaron Bohy d79211d5c1 [REF] iap: remove unused legacy MockServer patch
The code has been converted to owl, and that monkey patch is no
longer useful.

closes odoo/odoo#114283

Related: odoo/enterprise#37750
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-03-06 13:13:16 +01:00
Guillaume (gdi) 13e4acd38f [FIX] website_blog: fix the view of the blogs filtered by tag
From [this commit], following these steps:
- Go to /blog
- Click on a tag of a blog post that has at least two tags (eg: hotels)
- Click on another tag (eg: adventure)

=> Instead of having hotels or adventure as a filter we just have
adventure. The problem is that some variables were cached since [this
commit].

[this commit]: https://github.com/odoo/odoo/commit/b0a2a41d78292cb8b9e53788d40c6dc5915a466d

task-3054970

closes odoo/odoo#114250

X-original-commit: 2e7cd8ae13195f9a7527ac6789d9d3aecc920a82
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2023-03-06 13:13:14 +01:00
uso-odoo 30310e7ae7 [FIX] spreadsheet_account: prevent key-error when click on 'See records'
This issue is caught by a sentry. When the user clicks on 'See Records' from the
spreadsheet user gets key-error 'codes'! When clicking on 'See Records' it tries
to get the domain and the domain takes 'codes'
in this function:- spreadsheet_move_line_action()

In this PR(https://github.com/odoo/odoo/pull/113359) they changed the key from
'code' to 'codes'.

sentry - 3961028578

closes odoo/odoo#114161

X-original-commit: 83a8d5437da5da3d5ff5e6395952214e8d08e8f4
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-03-06 13:13:11 +01:00
FrancoisGe 263066cbef [REF] *: rename fieldsToFetch to relatedFields
We take advantage of the change of api made in commit
145540921f to rename FieldsToFetch to
relatedFields.These two commits are in the same version of odoo (16.2).

FieldsToFetch is not a good name for defining the fields to be fetch for
relational fields. So we decided to rename it to relatedFields.

Part of Task: 3179751

closes odoo/odoo#113963

Related: odoo/enterprise#37651
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 13:13:05 +01:00
Thomas Lefebvre (thle) 75e9b2f383 [FIX] hr_holidays: allow archiving according to the context
Steps to reproduce:
Archive an employee who has allowances in the approved state.

Issue:
The error is triggered and that says we can't archive an allocation.

Solution:
Use the context to avoid triggering the error if the archiving
is part of another archiving process.

Introduced with the commit 1839bf83a14a12eb83a8f721f82ece7238319e43

opw-3211372

closes odoo/odoo#114385

X-original-commit: 19cbf1d68052f002bff4f1fd12f9f94d60c17df2
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-06 09:14:23 +01:00
John Laterre (jol) 33b40687fb [IMP] account_sepa: allow sepa on non EUR journals
Currently, SCT requires the journal to be in a set of determined currencies.
We want to allow using this payment method for all journals,
whatever their currency.

The only check that should be made is on the currency of the payment.

opw-3159737

closes odoo/odoo#114347

X-original-commit: ad1bcd01c84c71a0a79bf5231d9bbdeea69f87c6
Related: odoo/enterprise#37778
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-03-06 09:14:20 +01:00
Julien Van Roy 0d85631fe7 [FIX] account_edi_ubl_cii: change mapping for Buyer/Order Reference
The BuyerReference (BT-10) should be easily editable by the user, so it is read
from the `commercial_partner_id.ref`.

The OrderReference (BT-13) should also be editable by the user, it is read from
the `move.ref`.

The definition for both tags in the peppol doc defines these tags as:
"An identifier assigned by the Buyer used for internal routing
purposes".

The new tag SalesOrderId (BT-14) is added, and is the sale order's name
linked to the invoice.

opw-3175906

closes odoo/odoo#114379

X-original-commit: 0cb27f4c6a0eda02fdab15b11cbf671166497ecc
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
2023-03-05 20:04:00 +01:00
Ricardo Gomes Rodrigues (rigr) da019b6280 [FIX] account: add account move's name into the fields used by the hash
Currently, it is possible to resequence account moves which are hashed.
This should not be the case. Therefore, we are adding the name of the
move into the list of hashed fields.

However, since we are changing the hashing algorithm by including a new
field in its computation, we must add a versioning system to make sure
we don't break the integrity (data inalterability) report.

In practice, this means that prior to this commit, all hashed moves used
the fields of v1, and moves after this commit will use v2 (which adds
the name into the list of hashed fields). Thus, whenever we generate
the integrity report, we will run the v1 algorithm, and if it a
potential corrupted move is found, we will switch to v2 and check again.
If it also fails, this means the hash is indeed corrupted.

task-id 3102481

closes odoo/odoo#114376

X-original-commit: cb76725b071d89a9f3e81861f19d073138741b58
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
2023-03-05 16:30:57 +01:00
Raphael Collet 6ef3772847 [IMP] *: optimize code with search_fetch() and fetch()
closes odoo/odoo#112126

Related: odoo/enterprise#36782
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-03-05 15:12:57 +01:00
Raphael Collet 8c81074e60 [IMP] base: optimize code with search_fetch() and fetch()
Part-of: odoo/odoo#112126
2023-03-05 15:12:56 +01:00
Raphael Collet 8659a4e5a3 [FIX] test_mail: hack to make broken test work anyway
The test is based on a record that the user cannot read.  It used to
work by accident, because some side effect leaked data in cache.

Part-of: odoo/odoo#112126
2023-03-05 15:12:56 +01:00
Raphael Collet 44d336128d [FIX] mail: overrides of _search()
This is about the overrides of _search() on models mail.activity and
mail.message, which both make extra queries to implement their specific
access rights.  We combine both queries made in _search() to retrieve
accessible records.  This simply uses the API of the Query object to
retrieve the data that is necessary to restrict access to messages.

Move security check outside of _message_format() for performance.  The
call to check_access_rule() inside _message_format() was redundant in
many cases and generated more SQL queries than necessary.

Also for performance, accessing fields from records should not actually
check permission.  That's a bit freaky, but this reproduces the former
behavior of mail.message.

And finally, make method check_access_rule() on mail.message check
ir.rules, in order to make it consistent with method _search().

Part-of: odoo/odoo#112126
2023-03-05 15:12:56 +01:00
Raphael Collet ae31aebf09 [FIX] base: fix and optimize ir.attachment._search()
Make ir.attachment._search() consistent with method check() for access
checks.  Also make it generate less queries by combining the extra query
with the main query of _search().

Part-of: odoo/odoo#112126
2023-03-05 15:12:56 +01:00
Raphael Collet dc15044cc0 [FIX] base: visible menus is a search() feature, not a _search() feature
Part-of: odoo/odoo#112126
2023-03-05 15:12:55 +01:00
Raphael Collet 4e6f1d7805 [FIX] core: invalidate the cache of forbidden records when raising AccessError
Issue: checking access rules fetches some data in cache.  Sometimes,
accessing a forbidden record does not crash because of the data left in
cache.  This is the case when accessing a field on a record, like in the
field accessor method:

    try:
        records._fetch_field(f)     # (1)
    except AccessError:
        record._fetch_field(f)      # (2)

The field f is included in the data fetched to check access rules in the
prefetch set of record (1).  Therefore, when trying to fetch the same
field in (2), there is nothing to fetch and no access error occurs.

Part-of: odoo/odoo#112126
2023-03-05 15:12:55 +01:00
Raphael Collet e962860c6f [IMP] core: introduce search_fetch() and fetch()
This fulfills the goal of searching and fetching fields in a single SQL
query.  We introduce the new method search_fetch() for that purpose.
Also introduce method fetch() to fetch some fields for a recordset if
they are not in cache yet.

The call graph is as follows:

    search()        calls   search_fetch()
    search_read()   calls   search_fetch() and _read_format()
    read()          calls   fetch() and _read_format()

    search_count()  calls   _search()
    search_fetch()  calls   _search() and _fetch_query()
    fetch()         calls   _search() and _fetch_query()

The methods _search() and _fetch_query() are usually the ones to
override to implement business-specific logic.  The method _search()
returns a Query object to retrieve the records that satisfy the given
domain and are accessible for reading.  The method _fetch_query() uses a
Query object to retrieve fields from the database and store them in
cache.

Also use search_fetch() to save one query in search_read() and the
reading of one2many fields.

Part-of: odoo/odoo#112126
2023-03-05 15:12:55 +01:00
Raphael Collet 46c23fd64d [IMP] *: _search() always returns a Query
Goal: make _search() always return a Query object, in order to make
search_read() in a single query when possible

Adapt the overrides of _search() towards the given goal.

Part-of: odoo/odoo#112126
2023-03-05 15:12:55 +01:00
Raphael Collet c161177cb7 [IMP] core: _name_search() now takes explicit order and limit parameters
This API is much more sensible for making subqueries.  Specifically, one
can generate a subquery without the clauses LIMIT and ORDER BY.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
Raphael Collet 136eb34f07 [IMP] core: _search() no longer uses a default order
This simplifies the use of subqueries by avoiding some costly default
order on the model or the idiotic order='id'.  Method _flush_search()
has been adapted accordingly.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
Raphael Collet 7e6cff5479 [IMP] core: search() and _search() no longer have parameter count
The parameter in search() is redundant with method search_count(), and
was making the calls less readable.

The method _search() is aimed at always returning a Query object.  The
method can therefore never return an integer, hence the removal of the
parameter.  This does not actually remove any functionality from the
method; counting result is simply given by using it differently.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
Raphael Collet 789c643925 [IMP] core: improve Query for subqueries
The goal is to be able to use Query objects for both subqueries and
known ids tuples.  This provides a single API for injecting either a
subquery or its resulting ids into another query.

Part-of: odoo/odoo#112126
2023-03-05 15:12:53 +01:00
Raphael Collet 537a60ffd1 [IMP] core: quote field "id" in SQL queries
Part-of: odoo/odoo#112126
2023-03-05 15:12:53 +01:00
Raphael Collet 637cdc8ffa [IMP] test_performance: more tests and adapt query counts
Part-of: odoo/odoo#112126
2023-03-05 15:12:53 +01:00
822618fb17 [FIX] sale_project: improve performance for project update
Before this commit, when the user wants to see the project.update of a
project billable to see the project profitability, the project
profitability could take more 20 seconds to be loaded because of a
search on account.move.line to get the others revenues (that is, the
invoices manually created without any SO linked) for which the AA of
those invoices are the one of the project. The problem is the AA of a
account.move.line is stored as key in a JSON field called
`analytic_distribution` and so the fetch of related
`account.move.line` could be slower when there are many records
in the `account_move_line` table.

This commit adds a new index on `account.move.line` to spped up the
search in `analytic_distribution` field. By doing that, the project
update is loaded in less than 2sec instead of 15-20sec.

closes odoo/odoo#114301

X-original-commit: a0b608c3a45ca33bcd535cfb4b1c73b73fa17317
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
Co-authored-by: SEINLET Nicolas <nse@odoo.com>
2023-03-05 14:16:57 +01:00
9650671871 [FIX] project: improve performance to search tasks with milestone set
Before this commit, when the user goes to project update of a project
with many tasks and some tasks are linked to some miletones of that
project the the `_compute_can_be_marked_as_done` could take more than
500ms depending on the tasks and miletones in the project (when the
project update of that project is loaded).

This commit fixes the performance by adding an index on `milestone_id`
field in `project.task` model.

Test case:
---------
The sql query made in that compute method took more than 600ms before
that commit.

With the index, the query takes less than 1ms.

X-original-commit: 47e02120b1aa5607a7fc528853629438cecf3e64
Part-of: odoo/odoo#114301
Co-authored-by: Yannick Tivisse <yti@odoo.com>
Co-authored-by: SEINLET Nicolas <nse@odoo.com>
2023-03-05 14:16:57 +01:00
althaf shaik 3afc97c42e [FIX] account: expected currency value in compute tax total.
Expected singleton res.currency() trace back
that occurs in account/account_move : _compute_tax_total
was caught by sentry.
Because currency is not available when we remove journal_id in account_move.

In res.company currency_id is a required field.
So we are accessing currency value from res.company.

Sentry-3946448424

closes odoo/odoo#113927

X-original-commit: 326ae981b767a9ae3cacd50099dcce354df591d8
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-05 14:16:54 +01:00
momegahed 1d54dfad33 [FIX] base: Cannot print multiple checks
Steps to reproduce:

1. Settings > Accounting > Vendor Payments > Checks > Enabled with
Print Check (Top) - US
2. Accounting / Vendors / Payments
3. Create at least 2 vendor payments using "Checks" as the payment method
4. In the list view select both payments and click action/print checks
5. Error

Bug:

in `_render_qweb_pdf_prepare_streams`, in the case of multiple
documents on multiple pages, we can only split them if the pdf has an
outline, and it will have an outline only with templates that have a
header tag. For the ones that don't have them like
`l10n_us_check_printing.print_check_top`, it is not possible with the
current logic to unambiguously split them. (maybe we can add a
heuristic like if number of pages = number of documents we can assume
1 document/page)

thus the streams returned by `_render_qweb_pdf_prepare_streams` don't
contain the record ids and
`safe_eval(report_sudo.attachment, {'object': record, 'time': time})`
might fail based on the expression to evaluate.

Fix:
It doesn't make sense to save the attachment if we can't split the
attachments clearly anyway, so we can just continue and skip the saving
 if record is null

OPW-3124089

closes odoo/odoo#113863

X-original-commit: 1fac708bd335dce27eeb77e0a11e12883a83dac6
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2023-03-05 14:16:51 +01:00
xO-Tx 190b1b1609 [FIX] web_editor: fix icon update on mediaDialog
To reproduce the issue:

- Website (edit mode) > Drop a snippet with icons (e.g. "Steps").
- Open mediaDialog to change an icon.
- Select the same one (or click immediately on "ADD") > This will set an
empty icon (without any "fa" specific class).

The code on `MediaDialog` > `save()` adds CSS classes from the original
icon to the new created one then removes the old 'fa' classes from it.
(see `initialIconClasses`), as a consequence, the class will be deleted
(not replaced) when the selected icon is the same as the old one.

The goal of this commit is to fix this behaviour by simply closing the
dialog if the selected icon remains the same as the old one.

task-3210472

closes odoo/odoo#114345

X-original-commit: 0515e987b985622bc7b913dbbb37c0d0cd69eb4b
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-03-03 23:27:47 +01:00
MerlinGuillaume 9ea183bc39 [FIX] account: use currency to format tax
An error is thrown when trying to edit the tax in a vendor bill

Steps to reproduce:
1. Install Accounting
2. Go to Accounting and create a new Vendor Bill
3. Add product 'Large Cabinet' to the bill
4. Click on the pencil icon next to the tax in the total amount
5. An error is thrown

Solution:
Partially revert the erroneous fix in TaxTotalsComponent by adding the
currency getter. If there is no currency, floatFormat will fallback on a
decimal precision of 2.

Problem:
https://github.com/odoo/odoo/pull/108412 removed `currency` from
TaxTotalsComponent. This value was passed in the props of
TaxGroupComponent so it was undefined.

opw-3212170

closes odoo/odoo#114362

X-original-commit: 59a1d1f825cfbc1f720cccb80de212f6ee6d5404
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-03-03 22:23:51 +01:00
maximilien(malb) d55438187a [FIX] sms: invisible description when empty
Before this change, when the recipient_single_description field was empty (the field is then false), the field box was still displayed before the number. Since the field is not editable there is just a blank space.

This PR hides the field when it is empty to avoid having the empty space.

closes odoo/odoo#114354

X-original-commit: a7425a2d829a7bfe0e25619a3bd5c40d9e112bb0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-03-03 20:10:57 +01:00
Lucas Lefèvre 4217c5b3dd [FIX] spreadsheet: load async formulas without delay
Now the promise waiting for all async no longer relies on a setInterval.
It was a hack that can be better solved by listening to the data sources
event.

closes odoo/odoo#114348

X-original-commit: de1f42f98410bc796dfdbfd237b1e20be4496166
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-03-03 19:10:20 +01:00
Hansun (hale) d47b5c3fa7 [FIX] mrp: broken UI on Group By
1. Install [Manufacturing] on Apps
2. On [Settings]>[Manufacturing]
- toggle on [Work Orders], [Quality] & [Quality Worksheet]
3. Go to Manufacturing
- Work Centers (a.k.a WC) Overview should be visible
- if no W.C. by default, add from [Configuration]>[Work Centers]
- give tag to each W.C. (lengthy so as to test the overlap)
- click Manufacturing and [Group by] Tag (Custom)

affected branch: 16.0-master

opw-3177656

closes odoo/odoo#114303

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-03-03 19:10:18 +01:00