Commit Graph
166719 Commits
Author SHA1 Message Date
Antoine Boonen da251b757d [FIX] account: Fix tests failing due to tax restriction.
Problem
---------
The tax restriction after usage creates issues in the chart template
tests. Indeed, some of those test would re-create the repartition
lines that were created by default after the tax is used which is not
permitted anymore.

Objective
---------
Adapt the tests to not recreate repartition lines.

Solution
---------
Remove the Command create that would recreate the lines. Also, one test
made use of line tags which are not present by default anymore. This
test now manually sets the tag to teh line without re-creating it.

task-3450002

closes odoo/odoo#130403

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-10-20 14:59:13 +00:00
Antoine Boonen 8d77045b46 [IMP] account: Logging and tracking of some fields.
Problem
---------
All fields in the tax definition are currently modifiable even after the
tax has been used. This raises some issues in tax reports and make
investigations difficult when things go wrong in tax report.

Objective
---------
Once an account tax has been used:
 - Some fields in the account tax should not be modifiable anymore to
 avoid tax report issues;
 - Other fields should be logged when modified to ease debugging and
 investigations.

Solution
---------
1. Add a logger to the tax form to track the modification of some fields
2. Track whether the task is being used in transactions or not. This is
done thanks to a compute field. In order to be flexible, the compute
function uses a hook function that other modules can override to easily
add transactions to computation of the field.
3. Make the fields that should not be modified anymore readonly when the
tax is being used.
4. In order to track the repartition line values, a tracked computed
field that stores the relevant value in a string is used.

Task-3450002

Part-of: odoo/odoo#130403
2023-10-20 14:59:13 +00:00
clesgow 38956115b4 [FIX] mrp: display "Not Ready" when negative qty in stock
Steps to reproduce:
- Create a MO that uses a component without quantity in stock
- Make an outgoing transfer that move some quantity of that component
out of stock and validate it
- Go back to the MO and open the Overview

Issue:
The status will display a '-x Ready', which doesn't make sense.
Now properly checks if there is quantity in stock.

closes odoo/odoo#114536

Related: odoo/enterprise#40930
Related: odoo/upgrade#5210
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-10-20 14:59:10 +00:00
clesgow 35691afe0d [FIX] mrp: avoid negative free quantities on MO Overview
When more than available quantities are already consumed for a product,
a negative quantity will be displayed as `free to use` quantity, which
doesn't make much sense.

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow ebef2c3e4f [IMP] mrp{,_account}: Integrate Cost Analysis data into Overview
The point of the MO Overview is to be a single place where you can
quickly get all info for a single Manufacturing Order.
Since we have all data the cost_analysis is already fetching, we add
those data in the report when the production is done.

Also use the Stock Valuation Layers when available for component costs
to better reflect the real cost of production.

Task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow 9b822496cb [FIX] mrp: set right availability when subcontracting
Steps to reproduce:
- Enable subcontracting & multi-step routes
- Inventory -> Routes -> Unarchive MTO
- Create a subcontracted bom for a product S by vendor V
- Set V as supplier for product S and set route Buy & MTO
- Create a MO that uses S as a component and confirm it
- Go to the related RFQ and confirm it
- Go back to the MO and open the Overview

Issue:
The component S has its receipt marked as "Available", even though the
product isn't received yet.

When checking the previous moves in the chain, the move from
production -> subcontracting (end move of the subcontracted MO) will be
read and check its `reserved_availability`, which isn't right.

Task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow 57e31b7c82 [FIX] {purchase_,}mrp: convert costs when different currencies
Steps to reproduce:
- Enable a second currency (e.g. EUR)
- Create a product P with a supplier using EUR as currency
- Create a MO with this product P as component and confirm it
- Open the Overview

Issue:
In the MO Cost column, the cost will be displayed in the company
currency but without converting its value.

Task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow abe7725baa [FIX] mrp: hide components that weren't consumed in done MO Overview
If a component wasn't consumed at all during the manufacturing process,
we don't want to see it on the final Overview.

Task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow d119453591 [IMP] mrp: improve perf when MO is done
When the Manufacturing order is done, a lot of data is not shown
anymore. This means we don't need to check each replenishment
resupply_rules if they're not being used anyway.

Part of task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow e0d54b8d1e [IMP] mrp: change meaning of cost columns in MO Overview
Have the "MO Cost" column mean the expected costs following *this*
Manufacturing Order.
Rename "Product Cost" into "Real Cost" and have it represent what where
the actual registred costs for this MO.
This allows for a quick comparison against what was expected and what it
really cost.

Part of task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow 2c756c3d6f [FIX] mrp: remove unnecessary transit line on MTO overview
When displaying the MO Overview of a MTO product, "In Transit" lines
would be displayed for MTO components until the component was consumed.
Now checks whether the component is ready to be consumed (i.e. its
reservation is the MO itself, not a picking before) to know if it should
display the transit line or not.

Part of task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow ea6b120524 [FIX] mrp: display correct quantity following production warehouse
Steps to reproduce:
- Enable multi-warehouse
- Add different quantities for a component on two different warehouse
- Create a MO on each warehouse using that component
- Open Overview for each MO

Issue:
Both Overview display the sum of both warehouses quantities in "Free to
use / On Hand" column, which is incorrect.

By forcing the context to contain the warehouse_id, the quantities
fetched on the products will correspond to the quantities in each
warehouses.
Note: It's necessary to update the context of the fetched production as
most computation is done from this record, and its own context isn't
modified by the addition of `warehouse` to the context of `self`.

Task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow 9fb0409e6d [IMP] {purchase_,}mrp: Add done MTO links into the MO Overview
As the content of the replenishments in the MO Overview is computed
through the forecast report data, as soon as a product is in stock,
the line about it disappears, since it is no longer linked to a
reception (PO/MO) in the forecast report.

But for MTO strong links, it makes sense to keep trace of what was used
to manufacture the products. So we inject the data back as if it was
regular forecast lines.

Part of task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
clesgow d0f0621c86 [IMP] mrp: Add byproducts to MO Overview
Adds the `By-Products` section in the MO Overview as done in the BoM
Overview. This allows to correctly factor in the cost share of the
production's byproducts.

Part of task-3251506

Part-of: odoo/odoo#114536
2023-10-20 14:59:09 +00:00
Sébastien Theys 7e5505da06 [FIX] base, mail, website_forum: correct populate of base models
Significantly improves the usability and the result of the populate for
base models and channel/member/message.

- make populate of base models re-entrant
- adapt size to values that make sense:
  - small shows something relevant, and can be quickly ran several times
  - medium is fast enough to be usuable but big enough to highlight
    performance issues
  - large is... still not to be attempted
- avoid conflicting conditions that either make no sense or can lead to
  crashes when populating the data or running the database
- better spread of data in channel/member/messages

closes odoo/odoo#139269

X-original-commit: 73a5e322f6e250569ee1942d678f8a4f87616bd7
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-20 11:22:20 +00:00
Victor Feyens 25177023a2 [REV] sale: forbid payment term change on confirmed SO
This reverts commit b1427153f8.

It seems that salesman likes to change payment terms on SO after the confirmation.

task-3562396

closes odoo/odoo#139258

X-original-commit: f83afeffeb30496ad55f901a529144db47942787
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-20 11:22:18 +00:00
Jorge Pinna Puissant 7adde63d69 [MOV] web,*: move record.js to model folder
This commit is part of a serie of commits which aims at simplifying and
reorganizing js files in the web addon

closes odoo/odoo#139156

Task-id: 3508223
Related: odoo/enterprise#49212
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-20 11:22:17 +00:00
Jorge Pinna Puissant f813e2651b [FIX] project: operator should use in or not
Before this commit, the domain term was using = or != as an operator
with an array as a right expression. This creates a warning in the log
when normalizing the leaf of the domain.

Now, the operations = or != are replaced by in or not in.

closes odoo/odoo#139032

Related: odoo/enterprise#49115
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-10-20 11:22:13 +00:00
Jorge Pinna Puissant ed3b4c5ab5 [FIX] web: clickbot set all filters
Since the new milk theme, the clickbot for click everywhere, didn't set
the filters on the views.

Now, the clickbot set all the filters on the views. This commit also add
a test suit, to avoid future downgrades. This commit transform the
clickbot to a module ES6.

task-id 3535596

X-original-commit: e2f531ec47e4f946cc37afee6b65531a637b5dfe
Part-of: odoo/odoo#139032
2023-10-20 11:22:13 +00:00
Loukas Wets (lowe) ab1c666b52 [IMP] point_of_sale,pos_restaurant,pos_self_order: share kiosk orders with all pos_config
This commit allows to share kiosk orders with all pos_configs. A new pos_session
boolean attribute is added to check if there is a kiosk config in the company.
In point_of_sale and pos_restaurant, if the company they belong to contains
a kiosk config, the ticket_screen will retrieve the kiosk draft orders.

closes odoo/odoo#138264

Related: odoo/enterprise#49294
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-20 11:22:11 +00:00
Dossogne Bertrand b89dd1f5c9 [IMP] hr_holidays: allow negative time off
This commit introduce the possibility for users
to set time off type allowing negative amounts in the
computation of remaining leaves on allocations.
This is for example useful in cases where the user wants
to take some leaves in advance with accruals not
having accrued the time off yet.

task-3465561

closes odoo/odoo#138118

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-20 11:22:09 +00:00
Antoine GuenetandLou 386a2fdebf [ADD] web_editor: create/transform content with a LLM
This commit implements a dialog for content generation using ChatGPT,
which can be opened via the Powerbox or via a button in the toolbar.

If text is selected, the dialog opens in "alternatives" mode. In this
mode, five alternative versions of the selected text are generated. The
user can choose one and it will be inserted in lieu of the selection.
Five buttons can be used to guide the AI to make the content longer,
shorter, more professional, more friendly, or more persuasive. Clicking
any of these buttons will restart the generation process with the new
parameters.

If no text is selected, the dialog opens in "prompt" mode. In this mode,
the dialog contains a textarea in which the user can input a prompt
which is then used to generate content. The user can then exchange with
the AI back and forth until the content is satisfactory. Any of the AI's
responses can be inserted into the document by clicking its "Insert"
button.

When content is inserted into the document, a green frame is shown
around it for two seconds, to make it clear to the user that something
has been inserted and where.

If an error occurs, it is inserted in the dialog like other responses
but in red and it can't be inserted into the document.

Please find the PR of the IAP part (Odoo Language Generator) here :
https://github.com/odoo/iap-apps/pull/703

task-3383324

closes odoo/odoo#137064

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Antoine Guenet (age) <age@odoo.com>
Co-authored-by: Lou (loha) <loha@odoo.com>
2023-10-20 11:22:06 +00:00
Antoine Guenet d0bb595a18 [FIX] web_editor: return all inserted nodes on insert
The `insert` command was not returning all inserted nodes.

Part-of: odoo/odoo#137064
2023-10-20 11:22:06 +00:00
71c81e605b [IMP] *: expression edition
The PR https://github.com/odoo/odoo/pull/104741 have recently modify how the modifiers required, readonly,
invisible, and column_invisible are defined. They are now given by Python
expressions instead of domains. In this PR we introduce two main new
components ExpressionEditor and ExpressionEditorDialog that allow to
edit/view a Python expression in a way similar to what is done in the
DomainSelector/DomainSelectorDialog. For this we have extracted the main
logic found in DomainSelector and moved it to a new component TreeEditor
that is used by both ExpressionEditor and DomainSelector. For this we had
to add a new type of leaf we call "complex condition" that allows us to
represent indecomposable (sub)expressions, i.e. expressions we cannot
(or don't want) to express as conditions of the form (path, operator, value).

The main mappings allowing to transform trees, domains, expressions into
one another (when possible) are to be found in
@web/core/tree_editor/condition_tree.js.

closes odoo/odoo#136258

Related: odoo/enterprise#48512
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Carion <juca@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Pierre Pulinckx <pipu@odoo.com>
2023-10-20 11:22:05 +00:00
Maximilien (malb) 7428dc9e0b [IMP] stock_account: country_code in the view
In some localisation (example: latam) we put company dependant field on the
stock.view_picking_form view. This commit will add the country_code in the form
view so that we can use it to hide information depending on the company.
Also removing the useless country_code field.

closes odoo/odoo#134617

Task: 3270458
Related: odoo/enterprise#47043
Related: odoo/upgrade#5266
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-10-20 11:22:01 +00:00
Maximilien (malb) 66820dc18d [FIX] l10n_ar: remove patch tour
Since we now make the fields of l10n_ar invisible for other companies, the
accounting tour is failing and the test is no really useful, so we decided to
delete it

 task: 3270458

Part-of: odoo/odoo#134617
2023-10-20 11:22:01 +00:00
Maximilien (malb) e28a9a74a3 [IMP] l10n_mx: UI clean up
This commit aims at changing a tooltip

Task: 3270458
Part-of: odoo/odoo#134617
2023-10-20 11:22:01 +00:00
Maximilien (malb) 45cb6818f8 [IMP] l10n_{ar,mx,ec,pe}: translation
This commit will contains all the PO and POT for the localisation that needed to
 be improved

Task: 3270458
Part-of: odoo/odoo#134617
2023-10-20 11:22:01 +00:00
Maximilien (malb) 97882a9190 [IMP] l10n_cl: UI clean up
This commit aims at changing a tooltip.

Task: 3270458
Part-of: odoo/odoo#134617
2023-10-20 11:22:01 +00:00
Maximilien (malb) 7a20638136 [IMP] l10n_pe: UI clean up
This commit aims at changing some tooltip and labels.

Task: 3270458
Part-of: odoo/odoo#134617
2023-10-20 11:22:01 +00:00
Maximilien (malb) ba63c09622 [IMP] l10n_ar: UI clean up
This commit aims at changing some tooltip, labels and changing the place of some
 fields. Also adding some invisible tags to avoid the fields to be displayed on
 other companies

 task: 3270458

Part-of: odoo/odoo#134617
2023-10-20 11:22:01 +00:00
Maximilien (malb) cc1ede9868 [IMP] l10n_ec: UI clean up
This commit aims at changing some tooltip to help the users

Task: 3270458
Part-of: odoo/odoo#134617
2023-10-20 11:22:01 +00:00
Odoo's Mergebot 7004382210 [IMP] *: add properties to several models and display them in cards
### 1. Add properties to various models

This PR adds properties (and related properties definitions) to the
following models:
- hr.employee (hr.res_company)
- hr_recruitment.hr_applicant (hr_recruitment.hr_job)
- product.product (product.category)
- stock.picking (stock.picking_type)

These have been added to the related form, kanban and calendar views when
applicable.

Properties have also been added to kanban and calendar views of
- crm.lead
- event.event
- project.task

### 2. Remove "hideKanbanOption"
This PR removes the "hideKanbanOption" from the properties field.
This option allowed to prevent users to make properties visible on cards
(kanban cards and calendar popovers).
The rationale being that there is no reason to prevent users of adding
properties on cards now that [they have been redesigned](https://github.com/odoo/odoo/commit/25e8fbe0a1327c289df826cf6eb7882098a4c325).

Task-3458627

closes odoo/odoo#132578

Related: odoo/upgrade#5196
Related: odoo/enterprise#46043
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-20 11:21:57 +00:00
Adrien Schoffeniels b598ea63f9 [IMP] stock: remove "configure_properties_field" action
Purpose:
-------
Commit [1] moved the properties field's "Add property" button inside
the cog menu of form views by default so that it's no more needed to
create actions for that purpose in each module using the properties
field.
In this commit, we forgot to remove it in the stock module (and we
currently have 2 "Add Properties" buttons in the cog menu).
We therefore remove it.

[1]: 24af3661b8cad2932c851a1cfc8e20d6e5422224

Task-3458627

Part-of: odoo/odoo#132578
2023-10-20 11:21:56 +00:00
Adrien Schoffeniels 75868ae30e [IMP] web: rename "view_in_kanban" key in properties definition
Purpose:
--------
The "KanbanPropertiesField" has been renamed to "CardPropertiesField".
For consistency, the key "view_in_kanban" of the properties definition
is renamed to "view_in_cards"

Task-3458627

Part-of: odoo/odoo#132578
2023-10-20 11:21:56 +00:00
Adrien Schoffeniels 31af631607 [IMP] *: add properties fields to various models
Purpose:
--------
This commit adds properties (and related properties definitions) on the
following models:
- hr.employee (hr.department)
- hr_recruitment.hr_applicant (hr_recruitment.hr_job)
- product.product (product.category)
- stock.picking (stock.picking_type)

These have been added to the related form, kanban and calendar views when
applicable.

Properties have also been added to kanban and calendar views of
- crm.lead
- event.event
- project.task
(Properties had already been added on these models and form views)

Task-3458627

Part-of: odoo/odoo#132578
2023-10-20 11:21:56 +00:00
Adrien Schoffeniels c2ad855b26 [IMP] web: change kanban properties field to card properties field
Purpose:
--------
This commit rewords the "KanbanPropertiesField" to "CardPropertiesField"
and add it as widget to use for properties fields in calendar views.

The rationale is that the "Show in cards" option of properties should
allow to enable the visibility of properties in kanban cards and in
calendar popovers (as it is currently the case in knowledge).

Task-3458627

Part-of: odoo/odoo#132578
2023-10-20 11:21:56 +00:00
Adrien Schoffeniels b8b450544c [IMP] web: remove hideKanbanOption from properties field
Purpose:
--------
This commit removes the "hideKanbanOption" from the properties field.
This option allowed to prevent users to make properties visible on cards
(kanban cards and calendar popovers).
The rationale being that there is no reason to prevent users of adding
properties on cards now that they have been redesigned (see commit [1]).

Task-3458627

[1]: https://github.com/odoo/odoo/commit/25e8fbe0a1327c289df826cf6eb7882098a4c325

Part-of: odoo/odoo#132578
2023-10-20 11:21:56 +00:00
Adrien Minne (adrm) e679846ea9 [FIX] spreadsheet_dashboard_sale: fix links to odoo menus
Since c418b35 the menu `sale.menu_sale_report` was split into multiple
sub-menus. The dasboards weren't changed, which meant that the links of
the scorecards in the dashboard were pointing to a menu without an
actionID.

closes odoo/odoo#139288

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-10-20 09:35:28 +00:00
tsm-odoo c5517ce86e [FIX] im_livechat: remove non-required dependencies
This commit reduces the size and avoid conflicts caused by
the embed live chat bundle: jquery, legacy libs...

At the same time, this commit fixes the emoji picker that was
wrongly positionned and scrolled up the page when opening.

Finally, this commit ensures the chat window is always at the
bottom of the screen.

opw-3539362

closes odoo/odoo#139261

X-original-commit: 1b29419e50343bfd723b41368ba38ce63b063d92
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-20 09:35:27 +00:00
Martin Trigaux e77cf7477d [I18N] l10n_it_edi: update Italian translations
Courtesy of Marianna (cima)

closes odoo/odoo#139239

X-original-commit: 3152a5029dcf676f723241b099196a8e8cb42720
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-20 09:35:25 +00:00
Rémy Voet (ryv) cae4e1b1cf [FIX] web: add fallback of display_name in formatMany2one.
Since https://github.com/odoo/odoo/pull/137098, we add a fallback for
false display_name in the form view, but we didn't add it for the list
view which doesn't instantiate the Many2one component. It uses
`formatMany2one` instead. Fix it to be consistent with the Many2one

closes odoo/odoo#139215

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-10-20 09:35:23 +00:00
Rémy Voet (ryv) c3bbba7cdd [FIX] web: fix extraLines for false display_name
Since https://github.com/odoo/odoo/pull/137098, in
`Accounting > Bank > Tree View`, you get a traceback if one of the bank
statements in the view has a false as `display_name` (name is only
required in the view not in the model). The traceback comes from the
`extraLines` accessor in the Many2one component. The fix is the same
as in https://github.com/odoo/odoo/pull/138061 (FW of the first PR).

Part-of: odoo/odoo#139215
2023-10-20 09:35:23 +00:00
Michael (mcm) 8cf98fbe67 [IMP] *: remove core.bus
This commit removes the legacy global bus (core bus) and the places
where it was used.
The main users of this bus were the public widgets, they now use the bus
on Component.env.
Some of the uses were dead code and has been removed.

closes odoo/odoo#139076

Task: 3439226
Related: odoo/enterprise#49131
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-10-20 09:35:21 +00:00
Raphael Collet a38a5b77fb [FIX] account: make _constrains_code() scale better
The code was failing because the domain it generates is too large, which
makes the SQL "compilation" reach the recursion limit.

closes odoo/odoo#138019

Related: odoo/enterprise#48916
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-10-20 09:35:18 +00:00
Raphael Collet 450f9f58ac [FIX] mail: _track_post_template_finalize() is broken when the record no longer exists
Part-of: odoo/odoo#138019
2023-10-20 09:35:18 +00:00
Raphael Collet f6b7899a06 [IMP] core: use SQL wrapper in _read_group()
Part-of: odoo/odoo#138019
2023-10-20 09:35:18 +00:00
Raphael Collet c041919f1b [IMP] core: introduce _order_to_sql() to replace _generate_order_by()
The new method should be used to generate an SQL object that represents
how to order by a field in an SQL query.  We introduced the auxiliary
method _order_field_to_sql() so that one can specify some SQL for
ordering by a given field with a simple method override.

Part-of: odoo/odoo#138019
2023-10-20 09:35:18 +00:00
Raphael Collet 026993775f [IMP] core: use SQL wrapper in expression
We take advantage of SQL objects to discard the use of domain operators
'inselect and 'not inselect'.  Indeed, as we now support SQL objects at
the right-hand side of a condition, one can replace conditions like
(lhs, 'inselect', (query, params)) by (lhs, 'in', SQL(query, *params)).

This commit also adds tests that ensure the correct behavior of the
adaptation of the implementation.

Part-of: odoo/odoo#138019
2023-10-20 09:35:18 +00:00
Raphael Collet 33d1303a2d [IMP] core: use SQL wrapper in fields
Part-of: odoo/odoo#138019
2023-10-20 09:35:18 +00:00