Commit Graph
159035 Commits
Author SHA1 Message Date
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
Laurent Smet 955091e707 [IMP] account*: send&print with documents
Refactoring send&print wizard.
==============================

Main reason for this commit is that we want to let the user
decide when to generate the relevant documents / approvals
for its invoices. The natural choice is when the information
leaves Odoo. So now, each time the users decide to
download/send its invoices, he will be able to select the
relevant documents to be generated and the approvals to be
requested from the send&print wizard.

This used to happen automatically during the posting with lots
of undesirable behaviors (difficulty to update/revert, hard to
know exactly what will happen,...)

Main changes:

1/ Send&print wizard

- The model 'account.invoice.send' has been replaced by
'account.move.send' and became models.Model to handle
asynchrounous generation of documents (webservice,..) in
case of more than one invoice.

- The wizard is meant to be overriden in order to add
checkbox and document to be generated. A comprehensive exemple
can be found in account_edi_ubl_cii.

2/ Import invoice from attachments

- The decoding logic has moved from account_edi to account
on the attachemnts.

- The function _extend_with_attachments() serve as a common
entry point for import (from chatter, dashboard).

3/ Export invoice pdf / document

- All the specific actions to export attachments should be
implemented on the account.move and called from the wizard in
 _generate_documents()

- The official pdf for the invoice is now only generated once
 the user request it. In order to regenerate the pdf and
documents, it needs to be deleted.

task-id: 3117238
[enterprise](https://github.com/odoo/enterprise/pull/36757)
[community](https://github.com/odoo/odoo/pull/111857
)

[IMP] web: enable close on ir.actions.act_url in wizard

Before this commit, calling ir.actions.act_url on a modal
leaves the modal open. Which feels ackward in the send&print
wizard.

We now enable 'close' parameter on ir.actions.act_url. If set,
the wizard will close after act_url.

closes odoo/odoo#111857

Related: odoo/enterprise#36757
Related: odoo/upgrade#4387
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-03 19:10:10 +01:00
Katherine Zaoral 17d7b5199f [ADD] l10n_ar: Liquido Product document management
* Add refunds with liquido docs
* Add Is AFIP POS field (l10n_ar_is_pos)
* Adapt letter mapping
* Add unit test

closes odoo/odoo#111076

Related: odoo/enterprise#36322
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-03-03 19:10:01 +01:00
Benjamin Vray 44e9930557 [FIX] website_editor: fix items width in we-list when dragging them
This commit fixes an issue with the width of items in the we-list not
being correct when they are being dragged using jQuery's sortable
feature.

Steps to reproduce the bug:

- Drop a "Form" snippet on a page.
- Add a "Multiple Checkboxes" field in the form.
- Move an option from the list using the move button.
- Bug: while dragging the item, the width of the items is too small.

When an element is dragged, it is given an absolute position which takes
it out of the normal flow of the document, causing the input element
within the list item to no longer be able to correctly occupy 100% of
the available width.

task-3138662

closes odoo/odoo#114343

X-original-commit: e0a4ed0b21a9f87678e13609ff597cf1b3ae4189
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2023-03-03 18:11:05 +01:00
clesgow 3ec250e709 [IMP] stock: bypass quantity compute on replenish wizard
Currently, even if a `default_quantity` is given to the replenish
wizard, that quantity will be overwritten by the product's
`virtual_available`, which defeats the point of setting a
`default_quantity`.
This will allow to bypass that computation when a `default_quantity` is
given to the wizard.

Also makes it return a close action with some custom info when `Confirm`
is clicked, so it's possible to know which button was clicked to close
the wizard.

closes odoo/odoo#113394

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-03 18:10:57 +01:00
clesgow 724a00056f [IMP] {sale_}stock,mrp: bypass reads for forecast
Add a way to disable the read() done in the forecast report. While those
are useful to send the right data to the client, they have no use and
even slow down the process when the forecast report lines are generated
for a python-side use.

Part of task-3059467

Part-of: odoo/odoo#113394
2023-03-03 18:10:57 +01:00
clesgow 1ef03b92a0 [IMP] {purchase_,}mrp: Add MO Overview
Adds in a new report that allows the user to monitor the entire
production of a product, including the resupply of the components (i.e.
subassemblies, purchases, ...) in a single view.

Task-3059467

Part-of: odoo/odoo#113394
2023-03-03 18:10:57 +01:00
Yolann Sabaux c823f477aa [FIX] stock_account: prevent reconcile move_lines in draft
Steps to reproduce:
- create two storable products (Great Product - Super Product) - automated avco
- create rfq with the two products - confirm -receive products
- create Bill - set qty of one Great Product to 0 -> save
- create bill for the Great Product - confirm

Issue:
User Error You can only reconcile posted entries

Cause:

`_get_all_related_aml()` fetches all aml related to the `stock_moves` with the product in the bill we want to post.
It retrieves the aml of the bill in which we have put the product quantity to 0 but that it is still in draft.
And we try to reconcile this draft move_line in
https://github.com/odoo/odoo/blob/d0fdc38385f5f259da259d21e9137494e6d7c17d/addons/account/models/account_move_line.py#L2308

Solution:
filter the `product_account_moves(_lines)` so we don't take into account moves that are still in draft

opw-3180209

closes odoo/odoo#114328

X-original-commit: b1a74a1841c05e4e37643e17f6b97dfff11555cd
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-03-03 17:05:43 +01:00
John Laterre (jol) f2c0bc321b [IMP] account: remove default account on misc journal form view
It was added in the context of this commit (https://github.com/odoo/odoo/commit/a3e9ca9586cba9d6161d4c05a7bfff9beeeddea7),
to auto-balance unbalanced moves.

But it's no more necessary and not only users can't select any account;
but further it is pointless.

task-3208909

closes odoo/odoo#114309

X-original-commit: eae96580f6da537d31ec43f018880bc6be82091a
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-03-03 17:05:35 +01:00
Valentin Vallaeys (vava) c5d9f4ee14 [FIX] sale: compute price unit on downpayment line
For the moment, the price unit of the down payment line on the sale
order is not always correctly computed. If the price unit is updated on
the down payment invoice, it is not updated on the sale order; or if a
regular invoice is created, the price unit of the down payment is set to
zero on the sale order.

This commit corrects the behavior by using the unit price of the invoice
line.

opw-3140740
opw-3160406
opw-3160420

closes odoo/odoo#114304

X-original-commit: 755c517fcab89df51e8b0ee4529894372b4d4ec1
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-03-03 17:05:33 +01:00
abd-msyukyu-odoo 033f14f533 [FIX] web_editor: refresh behaviors after editor reset and external steps
Dispatch events `onExternalHistorySteps` and `historyResetFromSteps` so that
they can be catched by the html_field to trigger a `refresh_behaviors`, in order
to refresh (instanciate) Behavior components.

Task-3208896

closes odoo/odoo#114262

X-original-commit: 9c6ed77988e20855ca67c5f1e03d9d2e274442cf
Related: odoo/enterprise#37745
Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-03 17:05:26 +01:00