Commit Graph
159630 Commits
Author SHA1 Message Date
tsm-odoo 08278d582b [FIX] mail: crash when message has no author
This commit fixes a crash that occured when a message has
no author. The author avatar url was assuming an author
would always be given while it is not the case.

closes odoo/odoo#116306

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-23 21:13:05 +01:00
Damien Bouvy dbc6b60839 [IMP] web: 'edit stage' vs 'edit' wording confusion
When grouping a kanban view by a m2o field, a configuration menu
('cog' menu) is available with actions available on the target
record.

This menu contains the entries 'Fold' and 'Delete' which have very
generic wording, and for some reason 'Edit Stage', which of course only
makes sense if the target record is a stage of some kind. Often, it
might not be - there is no reason to use such restrictive language.

Task-3244415

closes odoo/odoo#116299

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-03-23 20:12:48 +01:00
Thibault Delavallée 2c5738d7ab [FIX] website_forum: assign value for computed 'karma_flag' field
Before this commit, the compute method was not returning the value for the
field karma_flag field, and thus it was returning compute method failed to
assign value error.

After this commit, the compute method will return correctly set the value
for karma_flag field from the forum.

closes odoo/odoo#116281

X-original-commit: odoo/odoo@bfa3f2d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-23 20:12:45 +01:00
Maximilien (malb) deee288909 [IMP] l10n_{latam_invoice_document,ec,ar,cl}: translate
In the following task (https://github.com/odoo/odoo/pull/112803) there is two commits. One of them remove a change made in the other by mistake. We did a PR in saas-16.2 to revert the impacted localisation (https://github.com/odoo/odoo/pull/116292). The goal of this pr is to add back the translation for latam invoice documents.

closes odoo/odoo#116224

Task-id: 3244168
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-03-23 19:13:49 +01:00
Tom De Caluwé 41e3411776 [FIX] website, *: keep table of contents title and menu entries in sync
*: web_editor

The table of contents menu entries are generated automatically which
poses a problem in translation mode. The menu translation entries
are not be editable separately, but the users might be trying to.

This commit shows a notification when the user clicks on the menu
entries while in translation mode, explaining that they are generated
from the title entries.
It was initially intended to use a tooltip - but the amount of code
needed to display a tooltip without marking the DOM as modified is
needlessly complex.

To avoid that styles applied on a plain text during translation were
also appearing in the navigation menu, an attempt at adding a span
around them to make sure that their translation was distinct from the
one inside the main content. But this led to the risk of losing
existing translations.
Because of this, and because that situation seems unlikely, any
remaining style in the navigation menu is instead stripped when the
table of content is started to maintain consistency with what is shown
during translation.

An `o_translation_without_style` class has been introduced to indicate
to the synchronization mechanism that only the text must be replicated
for those elements.
For labels that have a different `data-oe-translation-initial-sha` than
their related header, that value is temporarily kept in another
variable, the value is replaced by the one from the header, which make
the synchronization mechanism properly associate them, then on save
the initial value is restored so that the translation is saved for the
right slot.

task-2752391

closes odoo/odoo#116270

X-original-commit: 5776a358e1b42186d2c26c9bc25010a12811f416
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-03-23 12:14:54 +01:00
Saran440 afcf0fba8d [FIX] purchase: default currency from context
closes odoo/odoo#116238

X-original-commit: ba6f90c2d664b7cef7f7ecd619b763ad6fe2138b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-23 12:14:51 +01:00
vishal padhiyar 78b7e9cca9 [FIX] web_editor: image cropping gives traceback
Before this commit:

The traceback appears after cropping an image and then trying to crop it again.

After this commit:

Cropping an image and then cropping it again won't give us tracebacks anymore.

Task-3134764

closes odoo/odoo#116262

X-original-commit: 83cf218b131c47b711327a224b0a0fd81406e8c3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-23 10:05:50 +01:00
Jurgen (jugj) f020b58f3f [IMP] hr_holidays : Log note when manager changes the time off type
task - 3195707

closes odoo/odoo#116253

X-original-commit: 268a2dca9eda9c29b965d4e413de82dd9bdbb1b6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-23 09:07:05 +01:00
pedrambiria f5067bc472 [FIX] point_of_sale: show the promotion line for the refund
Before this commit: if you wanted to refund an order that contains a
promotion line, it did not show the promotion line to refund. The
problem was that, during the initialization of an order from JSON, it
calls `set_partner` and `set_pricelist`. It causes a call to
`_updateRewards()` inside the `pos_loyalty`, which will remove the
promotion line. But it doesn't need to update the rewards when it
creates the order object from JSON.

The solution is to prevent calling `set_partner` and `set_pricelist`
when it creates the order object from the JSON.

opw-3111578

closes odoo/odoo#116236

X-original-commit: a03fa619f1388fb8033128a44eeb5451ef150890
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-03-23 09:06:59 +01:00
Jorge Pinna Puissant 04d5fb2255 [FIX] *: simplify concrete field API - remove update prop
Since [1], the update props is not used anymore in the field API. Some
utilization were missing in the refactoring.

[1]: https://github.com/odoo-dev/odoo/commit/b5db53b5df6403d2d9b57771854bc36aa5d83583

task-id 3241162

closes odoo/odoo#116229

X-original-commit: d212e46119a187452eb6c6d52b8592f28a633dd0
Related: odoo/enterprise#38579
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-23 09:06:52 +01:00
Corentin Thaon (thco) f130a37470 [FIX] account: state dependency _compute_amount
Reintroduction of the dependency on the state of the account.move for the _compute_amount method.

Some customers are experiencing problems following the migration to version 16. If they had draft 'account.move' before the migration, the 'amount_residual' field is set to 0 during the migration. When they validate the move after the migration, it goes directly to the paid status because the field is not recomputed.

opw-3182437
opw-3196490
opw-3229872

closes odoo/odoo#116180

X-original-commit: 3c7f6c3e39c05d7dfd24dd1b73f7bb3f19230f72
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-23 09:06:44 +01:00
Nicolas (vin) 783733cf33 [IMP] hr_expense: avoid adding wrong expense_line_ids
You cannot validate and expense report having expense_line_ids of
different payment mode.
But so far, it was possible to select these lines, and it would
be blocked upon saving.

We will improve this behavior by extending the domain on the
expense_line_ids field and disallowing to add lines that would lead to
an error later in the process.

It will also correctly handle the creation of new line via the expense
report form view, and add the paid by field as optional hidden in the
view in order to allow to find more easily the expense line that are
causing issues.

task id # 3221780

closes odoo/odoo#116077

X-original-commit: ec18bd414c831a9af67802dcd5d7181ef8d43049
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-23 08:01:08 +01:00
niyasraphy 7f2e9b852a [FIX] l10n_fr_pos_cert: 'account.bank.statement' object has no attribute 'state'
before this commit, in the code it is referenced
to non existing field state in account.bank.statement model
and thus it raise exception.

after this commit, the exception wont be raised and
validation error will be done based on the state field
state in account.bank.statement.line

closes odoo/odoo#115888

X-original-commit: ecdc3cb32bd96ecc859f385d3541eb2f5e4bad4d
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-22 23:56:08 +01:00
Alexandre Kühn d07f29613d [FIX] mail: emoji picker category selection should not cut emoji
closes odoo/odoo#116254

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 21:47:49 +01:00
Alexandre Kühn 9f61697411 [FIX] mail: smaller follower subtype dialog
closes odoo/odoo#116251

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 21:47:46 +01:00
Alexandre Kühn 8a2a7f2dd4 [FIX] mail: chatter takes whole width in marketing app
closes odoo/odoo#116249

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 20:46:57 +01:00
Alexandre Kühn 5bc42ddc32 [FIX] mail: no member-list and settings buttons on folded chat window
They make sense when the chat window is unfolded,
as it changes the content. But when folded, the buttons have no
visible affect. Better hide them in that case.

closes odoo/odoo#116242

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 19:44:44 +01:00
Alexandre Kühn d8c217363a [FIX] hr_holidays: proper im status alignment
closes odoo/odoo#116240

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 18:09:08 +01:00
Aurélien Warnon baef8dee44 [FIX] survey: fix invite modal layout
This commit fixes a small issue in the survey invite modal layout.

The label and the associated field for the share link did not have a matching
attrs configuration, leading to an extra label which broke the form visually.

Oversight of 220e0271bf

Task-3203875

closes odoo/odoo#116234

X-original-commit: c68b56254005eb94ad90192e6cf8648866aca55d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-22 18:09:05 +01:00
Alexandre Kühn e9db06c106 [FIX] mail: use 24-hour format for squashed message timestamp
closes odoo/odoo#116216

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 18:08:59 +01:00
tsm-odoo 7eab007771 [FIX] mail: do not allow click on message delete dialog
Since the discuss refactoring, clicks are not disabled in the message delete dialog.

This commit fixes the issue.

closes odoo/odoo#116215

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 17:03:52 +01:00
Alexandre Kühn fb34115b81 [FIX] mail: less spacing in composer suggested recipient
closes odoo/odoo#116213

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 17:03:49 +01:00
Audric Onockx (auon) fb59fa279a [MOV] project_{mrp,purchase,sms,hr_expense}: update files per model
In previous commit, we just copy/move the files.
In this commit, delete the part of each file
that is not related to its model, and some style.

task-3244226

closes odoo/odoo#116165

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-22 17:03:46 +01:00
Audric Onockx (auon) 978037a74b [MOV] project_{mrp,purchase,sms,hr_expense}: copy/move files per model
In this commit, we just copy/move the files.
In next commit, delete the part of each file
that is not related to its model.

task-3244226

Part-of: odoo/odoo#116165
2023-03-22 17:03:46 +01:00
Alexandre Kühn 64f9693407 [IMP] mail: recent emoji in emoji picker
Task-2982627

closes odoo/odoo#116067

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 17:03:42 +01:00
Joseph Caburnay 5460c87c7b [FIX] point_of_sale: remove unnecessary step in tour
The last step of PaymentScreenTotalDueWithOverPayment tour is not
really needed and it randomly breaks in runbot. Better to remove it.

closes odoo/odoo#115802

Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-03-22 17:03:39 +01:00
Julien Banken c721e29acc [FIX] web: add safe check when reading parent property definition
When loading a view, the system will populate the related property field
with the values stored in the datapoint of the record. Currently, the
system does not do any safe check when reading those values. The system
can hence raise an error if the view does not load the record storing
the property definition of the current record.

This commit will fix that issue by adding a safe check when populating
the related property field with the values of the datapoint.

task-3218435

closes odoo/odoo#115100

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-22 17:03:36 +01:00
Odoo's Mergebot 90ad9c46d4 [MOV] website_forum(_*): lint and reorganize module
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Split python files / model. It is easier to have a global view of a module
organization and content when looking at the models directory. Each model
now belongs to a single file.

Do the same with data, views.

Split templates by main usage. Files have been duplicated previously, they
are now cleaned to keep only content relevant to their usage. Split is done
according to
  * base file: layouts for main actions not specifically managed in other
    sub-files: display a forum, manage tags, post a new question or edit
    a question;
  * '_forum_all': 'all' page in multi-forum display, displaying the list of
    available forum;
  * '_layout': layouting templates. Modifications to global layout and forum
    specific page header used through all main templates;
  * '_moderation': moderation tools;
  * '_post': display a forum post;
  * '_tools': tooling and utility blocks, used as black boxes in various
    main templates;

Rename other files according to guidelines.

Reorganize main content of python code
  * group compute fields on top, order them following fields definition;
  * add section separators, to separate compute methods / CRUD methods /
    business methods / Mail methods / Tooling in file and have a way to
    sort a bit the code out;
  * rename compute methods to start with '_compute', to match guidelines
    and be coherent with global odoo naming;
  * perform some relining in fields definition, don't enforce any char
    length but try to stay aligned with Odoo apps;

Finally, provide some fixes or code improvements (batch, performance,
poorly written or named code) that are quick-wins.

LINKS

Task-3240082 (Forum: Reorganize and lint module)

closes odoo/odoo#114841

Related: odoo/upgrade#4456
Related: odoo/enterprise#38469
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-22 17:03:30 +01:00
Thibault Delavallée e33f28de85 [FIX] website_forum: fix website/forum count synchronization, rename field
Currently 'forums_count' field on website is not correctly updated. Test
introduced recently show that

  * at website create, counter is not computed;
  * at forum create, counter is not computed;

Only updating a forum active flag, website value, or unlinking it recomputes
the counters.

Note that manually updating counters is required as forum with False website
are global forum, valid for all websites.

Finally rename 'forums_count' into 'forum_count'. Fields in Odoo are rarely
plural (more like 'forum_ids' / 'forum_count' for example, even if in our
case the 2many does not exist due to shared behavior).

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:29 +01:00
Thibault Delavallée 64d5cc3899 [IMP] website_forum: add tests for website/forum count
Add tests for website.forums_count field that should be synchronized manually
with the actual number of forum. Seems it is not working as expected, as
the manual update is not done at forum creation, and the default seems not
correctly computed.

Those tests are therefore red without the upcoming fix.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:29 +01:00
Thibault Delavallée 86dec3b0d2 [FIX] website_forum: fix missing translation
Gamification data used in some emails to add links and shortcuts is not
correctly translated. Let us fix it.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:29 +01:00
Thibault Delavallée 24cb6d2caf [FIX] website_forum: use read_group to compute user statistics
Instead of doing 1 search_count / user in the loop, use read_group to fetch
data in batch.

Also remove an unnecessary import.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:28 +01:00
Thibault Delavallée 0e089316cb [REF] website_forum: rename views according to guidelines
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Rename main views and actions according to guidelines. Having standardized
names eases process of finding and updating views.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:28 +01:00
Thibault Delavallée 870a5d12e3 [FIX] website_forum: correctly translate default welcome message
Default value is currently not translated, which is sad. We therefore move
it into its own default method, use translation marks, and Markupize the
whole result.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:28 +01:00
Thibault Delavallée 97929d53c8 [FIX] website_forum: improve forum FAQ display
Better have a correctly formatted content looking like all other HTML fields.
This is achieved by using sanitize parameter which cleans up html content
according to our standards.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:26 +01:00
Thibault Delavallée 639f6195c2 [FIX] website_forum: avoid mutable as default method parameters
That is how you end up with funny results.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:25 +01:00
Thibault Delavallée f8c2d84024 [FIX] website_forum: better string manipulation for tags
A strange manipulation is performed when trying to create tags. In this
commit we simply make styling happy by trying to first prepare data
(strip, content) then use it. Feature is untouched currently.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:24 +01:00
Thibault Delavallée 112622db70 [FIX] website_forum: improve / cleanup computed fields
Notably add missing triggers for unstored fields depending on 'uid'.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:24 +01:00
Thibault Delavallée 264f0dcb4e [REF] website_forum: reorganize tests
Mainly reorganize them alphabetically so that execution order matches the
definition order. It helps when debugging.

Also clean some tests from odoo/odoo@f9c2716b3e because they either test nothing
either are not understandable by standard humans. Other tests are left
untouched.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:24 +01:00
Thibault Delavallée 45a5ecd08f [REF] website_forum: reorganize main python code, lint it quickly
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATION

Reorganize main content of python code

  * group compute fields on top, order them following fields definition;
  * add section separators, to separate compute methods / CRUD methods /
    business methods / Mail methods / Tooling in file and have a way to
    sort a bit the code out;
  * rename compute methods to start with '_compute', to match guidelines
    and be coherent with global odoo naming;
  * perform some relining in fields definition, don't enforce any char
    length but try to stay aligned with Odoo apps;

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:24 +01:00
Thibault Delavallée 20565afc46 [REM] website_forum: remove dead view
'post_reply' template seems not used anywhere.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:23 +01:00
Thibault Delavallée 11df1af102 [MOV] website_forum: rename remaining files
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Rename remaining files: controllers, sub-modules, tests, ...

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:23 +01:00
Thibault Delavallée 232f1dba23 [MOV] website_forum: split templates per main usage
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Split templates by main usage. Files have been duplicated previously, they
are now cleaned to keep only content relevant to their usage. Split is done
according to

  * base file: layouts for main actions not specifically managed in other
    sub-files: display a forum, manage tags, post a new question or edit
    a question;
  * '_forum_all': 'all' page in multi-forum display, displaying the list of
    available forum;
  * '_layout': layouting templates. Modifications to global layout and forum
    specific page header used through all main templates;
  * '_moderation': moderation tools;
  * '_post': display a forum post;
  * '_tools': tooling and utility blocks, used as black boxes in various
    main templates;

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:23 +01:00
Thibault Delavallée a66f6aae7a [MOV] website_forum: duplicate 'forum_forum_templates.xml', prepare split
Purpose is to try to keep history before splitting frontend templates into
separate files. We first copy the file, then remove extra content in each
of them. Let us see if this works.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:23 +01:00
Thibault Delavallée 2ad0ed3add [MOV] website_forum: move, split and rename (backend) views
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Rename and split backend views / model. It allows an easier manipulation and
management.

Templates (frontend) files are renamed but not split. It requires a more
in-depth check of their content before splitting into sub-files (to have
tool templates separated from main templates notably). This will be done
in the next few commits.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:22 +01:00
Thibault Delavallée 00a626deb8 [MOV] website_forum: move, split and rename data files
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Split data files / model. It is easier to have a global view of a module
organization and content. It also allows to see technical data impacted
by the module installation (like ir_actions, mail_message_subtypes, ...)

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:22 +01:00
Thibault Delavallée b7d8df8ff1 [MOV] website_forum: split models per model
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Split python files / model. It is easier to have a global view of a module
organization and content when looking at the models directory. Each model
now belongs to a single file.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:22 +01:00
Thibault Delavallée 38bf03b255 [MOV] website_forum: duplicate 'forum.py', prepare models split
Purpose is to try to keep history before splitting models into separate files.
We first copy a file, then remove extra content in each of them. Let us see
if this works.

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:22 +01:00
Alexandre Kühn b84ee02e01 [FIX] mail: more readable placeholder in activity popopver
closes odoo/odoo#116210

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-22 15:59:18 +01:00
Touati Djamel (otd) fe1443885a [FIX] mrp: print structure & cost BOM's of archived products
Steps to reproduce the bug:
- Create a storable Product “p1” with BoM:
    - Add a component and a byproduct:
- Archive “P1”
- Go to BOM Overview
- Filter -> see archived BoM
- Print BOM Structure

Problem:
A traceback is triggered,`ValueError:
Expected singleton:product.product()`

The `_match_all_variant_values` function is called but without the
product, while it takes at least one:
https://github.com/odoo/odoo/blob/15.0/addons/mrp/models/mrp_bom.py#L456
https://github.com/odoo/odoo/blob/15.0/addons/mrp/models/product.py#L286

The product must be set in the `_get_pdf_line` function, in our case,
the function does not receive it as an argument, so we have to get it
from the BOM, but as the `product variant` field has not been set in
the BOM, we should get it from the product_template:

https://github.com/odoo/odoo/blob/02cd750da6a79e6aa7104473fff2ab986b6e607c/addons/mrp/report/mrp_report_bom_structure.py#L378

The `product_variant_id` field is a non-stored compute field:
https://github.com/odoo/odoo/blob/34a2948d3d6e0f597c1b5d65f9f118e891c07cc4/addons/product/models/product_template.py#L133

And in the compute function, we use the first element of the
`product_variant_ids`: https://github.com/odoo/odoo/blob/34a2948d3d6e0f597c1b5d65f9f118e891c07cc4/addons/product/models/product_template.py#L177-L179

But it is a `Many2one` field, and for this type of field we have to add
`with_context(active_test=False)` to the ORM returns all records,
active or archived.

opw-3236421

closes odoo/odoo#116207

X-original-commit: fa10dd50397f83ad88380995a65c7d722825aee1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-22 15:59:15 +01:00