Commit Graph
160998 Commits
Author SHA1 Message Date
Maximilien (malb) 441856cb30 [IMP] l10n_eg: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#114700

Task-id: 3052677
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-05-10 18:16:21 +02:00
Maximilien (malb) f78f28e837 [IMP] l10n_sa: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#114696

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 18:16:19 +02:00
Maximilien (malb) 1d8d3a45f3 [IMP] l10n_it: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#114694

Task-id: 3052677
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-05-10 18:16:16 +02:00
Maximilien (malb) 505691e5de [IMP] l10n_ch: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes names so that it's more clear for users

closes odoo/odoo#114673

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 18:16:14 +02:00
Maximilien (malb) 86a0bafda8 [IMP] l10n_de: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we have changed the Taxes names so that it's more clear for users

closes odoo/odoo#114653

Task-id: 3052677
Related: odoo/enterprise#37914
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-05-10 18:16:08 +02:00
Maximilien (malb) 13dbc79065 [IMP] l10n_mx: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes names so that it's more clear for users

closes odoo/odoo#114571

Task-id: 3052677
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-05-10 18:16:06 +02:00
Maximilien (malb) 0a4f831c6f [IMP] account: generic taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the tax name of generic taxes

closes odoo/odoo#114537

Task-id: 3052677
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-05-10 18:16:03 +02:00
Xavier Bol (xbo) 5b2d1d846a [FIX] project: display the current stage when the state is changed
Before this commit, when the user changes the state, the followers
receive a notification about this change. Since the label of the
state is no longer customize by stage, the followers cannot know
in which stage the task is before clicking on the link to go to
the task form view. And so, if one of those followers has to
check the task in a specific, he has to click on the link in
the notification to know in which stage the task is.

This commit fixes the issue by adding the curent stage in the
notification to inform the user who received the notification
in which stage the task is when the state has been changed.

task-3284597

closes odoo/odoo#120959

X-original-commit: d78c79d9a9f8ac108251c57c732cfb5b71b53fd5
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-05-10 16:37:11 +02:00
Benoit Socias 86c392d393 [FIX] website: apply page search on most specific pages only
Since [1] when the fuzzy search was introduced on website pages, the
filtering on most specific pages only happens at the end of the search
operation. Because of this, the search happens on pages that would be
excluded anyway, the limit might be wrongly applied and the count might
be wrong.

This commit makes the page search begin by keeping only the most
specific pages, then performing the actual search within those pages.

Steps to reproduce:
- Install `website` only and drop a search snippet.
- Search "ax".

=> No results found, but the "All results" link is displayed.

[1]: https://github.com/odoo/odoo/commit/7559626c54e34b41e1549e28276a650accec6986

task-3203794

closes odoo/odoo#120950

X-original-commit: 9725a14be22ad0f20bb6591054b60d91663ca88f
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
2023-05-10 16:37:05 +02:00
Tiffany Chang (tic) 8f4b86bf82 [FIX] stock: allow "Print" of MRP reception report
During the OWL refactoring of the reception report, the "Print" button
was hardcoded to only work for pickings. Unfortunately this means the
button did NOT work when the report was opened for a MO.

This is due to the report printing being dependent on the report's
context values which can either be `default_picking_ids` or
`default_production_ids` (and this is by design to avoid additional file
extensions to handle both cases).

When this button was used in the previous legacy_web_report's
client_action, the entire action's context + data used to be passed as
part of the Print action:

https://github.com/odoo/odoo/blob/30fcb2e60fed17a473353b21bac4916e9ab77b10/addons/stock/static/src/legacy_web_report/client_action.js#L109-L119

The `data` and `context` is then stringified and added into the
reportURL:

https://github.com/odoo/odoo/blob/30fcb2e60fed17a473353b21bac4916e9ab77b10/addons/web/static/src/webclient/actions/action_service.js#L1042-L1050

But passing of the data isn't necessary in this case, and most of the
context's content is not needed since the backend is still receiving +
apply the current user's context thanks to the action_service:

https://github.com/odoo/odoo/blob/30fcb2e60fed17a473353b21bac4916e9ab77b10/addons/web/static/src/webclient/actions/action_service.js#L1079

always providing it to the backend

https://github.com/odoo/odoo/blob/30fcb2e60fed17a473353b21bac4916e9ab77b10/addons/web/controllers/report.py#L87

Therefore, to avoid an extra long report URL of all of the report's
data/context, this fix has been designed to capture only the necessary
context value and manually build the print URL accordingly.

Noticed during task: 3046178

closes odoo/odoo#120935

X-original-commit: 5d66b73cddce1aae2c52f0a0ec8f9885be67b7ae
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-10 16:36:59 +02:00
Tiffany Chang (tic) 5dbd6e69b4 [FIX] stock: disable reception "Assign All" when nothing to assign
In the case of draft pickings/MOs, the reception_report_main
component's "Assign All" button was NOT disabled, which could result
in an IndexError if the button was pushed. Note that this issue does not
occur for the "Assign All" button within a table because the button is
correctly not shown at all when there are no assignable lines within it.

Noticed during task: 3046178

X-original-commit: 403d1ba5839d6073ee6321e77863f928336158ba
Part-of: odoo/odoo#120935
2023-05-10 16:36:59 +02:00
Tiffany Chang (tic) 0a74e47af9 [FIX] stock: "Print Labels" non-int qtys in reception report
Steps to reproduce:
- activate Reception Report in settings
- create outgoing picking for a product (qty > qty in stock)
- create an incoming picking for the same product with a non-int qty
- confirm the incoming picking + click on "Allocation" smartbutton
- assign product to outgoing picking + click "Print Labels" (either at
  top of report or within the table of outgoing moves)

Expected result:
Labels and created + printed

Actual result:
ValueError because int() is called on a non-int value within the label
template

Note that the the `onClickPrint` within the reception_report_line.js
already correctly did the Math.ceil rounding on the qty

Noticed during task: 3046178

X-original-commit: 69c557a5c0b407333be45cd7434448fc36de899e
Part-of: odoo/odoo#120935
2023-05-10 16:36:59 +02:00
Bruno Boi 2ddc7348f2 [FIX] web: optional viewMode in x2m field
Before this commit, when having a x2many field invisible in a view, and displaying
it anyway in studio, there was a crash because some variable was undefined.

This originated from commit f22961a, which did not account
for the fact that viewMode is an optional props.

After this commit, the util function used by the x2m field and where the
crash occur has been refactored.
Moreover, the x2m field template has also been slightly refactored.

closes odoo/odoo#120918

Taskid: 3305808
Related: odoo/enterprise#40852
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-05-10 16:36:51 +02:00
roen-odoo a25d20ee3e [FIX] pos_sale: correctly update move qty when settling a pos order
Current behavior:
When settling a pos order containing 2 different product, the qty of the
2 products would be modified even if you only deliver one of them
through the pos order.

Steps to reproduce:
- Create 2 product A and B
- Create a sale order with 1 product A and 1 product B
- Open a PoS session, and settle the order you just created
- Deliver only 1 product A
- Close the PoS session
- Go the the sale order delivery, you will see that the qty are not
  correct

opw-3227053

closes odoo/odoo#120898

X-original-commit: c1f905111060fff6e6bdfae1849e1a633a88ae02
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-05-10 16:36:49 +02:00
luvi 9575aba9ca [IMP] mail, *: add hover title to the activity button
*: project, web

This commit adds the title and aria-label attributes to the activity
button. This makes the hover display the summary or an explaination
about the button, especially when there is no text displayed next to
the button (in Kanban view).

In the state selection field, a title has been added when hovering
the state in kanban, allowing to see the current value. The project
task state selection has also been adapted to have that title attribute
set on the toggler.

task-3207639

closes odoo/odoo#120871

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-05-10 16:36:45 +02:00
Xavier-Do a6f8de2cf2 [IMP] base: speedup routing map
When generating the routing map, `Rule.add` will call
`Rule._compile_builder` twice, representing almost one third of the
routing map generation time. `_compile_builder` is actually stored
in `Rule._build` and `Rule._build_unknown` for latter use, in the
`Rule.build` method.

The `Rule.build` method is used to transform a rule, lets say
`/forum/<model("forum.forum"):forum>` in `/forum/basics-of-gardening-2`

Even if a deeper investigation could be interresting, it looks like it
is only used for `is_frontend_multilang` routes and `_enumerate_pages`,
used in the `sitemap` and `search_pages`.

The proposed solution si to make this part lazy, in order to call
_compile_builder on demand, once per rule. This will speedup the initial
routing map generation and postpone the heavy work when we need it,
only for the part we need most of the time.

On a database with all modules installed, generation of the routing map:
Before: ~600 ms
After: ~200 ms

An alternative implementation was also overriding the Rule.build method
instead of having a callable LazyCompiledBuilder, this implementation
was choosen since it is less dependant off the werkzeug implementation.

closes odoo/odoo#120542

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-10 15:19:47 +02:00
Xavier-Do 7fda050abd [IMP] core: imcrease re.MAXCACHE
`re` is using an internal cache for regexes with a default size of 512
This is correct for small apps running on small infrastructure
but as a simple example, the routing map will compile ~1100 regex in a
row. This means that generating two routing map in a row don't benefit
from this cache at all. It looks reasonnable to increase this limit
globally for odoo.

This is visible when generating two routing map in a row.

After this change:

Generating routing map for key None
Routing map web generated in 0.194s
Generating routing map for key 1
Routing map website1 generated in 0.196s

After this change:

Generating routing map for key None
Routing map web generated in 0.200s
Generating routing map for key 1
Routing map website1 generated in 0.062s

Part-of: odoo/odoo#120542
2023-05-10 15:19:47 +02:00
Mahdi cheikh rouhou (macr) 63d54abe4b [FIX] account : correct button title invoice email manually
Sending invoice in emails to customers now display View Journal Entry in
v16.2 instead of view Invoice.
Steps to reproduce the error :
1- Install accounting
2- Go to accounting/customers/invoices
3- Create an invoice and send it by email to the customer
4- View The email on mailhog

The reason of the error was becayse we didn't provide model_descirption
to the function of sending the email, so it will take the one by default
whch is Journal Entry.

opw-3289880

closes odoo/odoo#120480

X-original-commit: 21cab7ffa6a71a67b64d3a7e7a62a6599127343d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-05-10 15:19:43 +02:00
Adrien Guilliams (adgu) a253eb65fb [IMP] pos_sale: Possibility to apply fixed amount on downpayment
Until now, it was not possible to apply fixed amount on downpayment.
Users were forced to compute the percentage to apply on a
downpayment on the side when the wanted to apply a fixed downpayment.
This is no more the case.

This commit also changes a bit the NumberPopup in the PoS.
The NumberPopup can now have a subtitle, a suffix to its input (usefull
for symbols like currency or percentage) and in the case of a percentage,
can have an indication under the confirm button about how much the
percentage means in other unit (like a percentage of a price).

The commit also removes the previous downpayment lines on the new
order line in the ProductScreen as they were not showing
useful information.

closes odoo/odoo#118594

Task-id: 2836904
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-05-10 15:19:37 +02:00
yhu-odoo 1eb2e7c814 [IMP] {,mrp_,stock_}account, *: add default stock accounts and production cost
account

1. We introduced a new Production Cost account that can be set on
locations with Production type. When products move into/out of a
production location. The account entry will be post on this account
instead of previous Stock in/out account.

2. On the accounting setting page, we can now set the default values for
all stock accounts. Users can also disable automatically accounting for
stock there.

Task-3046333

closes odoo/odoo#113973

Related: odoo/enterprise#37653
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-10 15:19:32 +02:00
paso-odoo bffa4377ff [FIX] account: fix the issue of unsupported operand in payment terms
If applied, this commit will solve the issue of the payment terms 'Example Date'
issue while we keep that blank and try to save the Payment Term.

Steps to produce:
- Open any Payment Term.
- Remove the example date.
- Add a line in Due Terms and click on save button.

Added a default value while the example date is not getting.

sentry - 4065889321
see - https://tinyurl.com/2caru9dd

closes odoo/odoo#120234

X-original-commit: 980aa78c0d9228cba665066d08ea7cd2f83e0097
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Parth Solanki (paso) <paso@odoo.com>
2023-05-10 13:21:52 +02:00
Adrien Schoffeniels ece5f26c10 [FIX] web: use copy of fields when using a kanban model
Since commit [1], properties can be displayed in list views. However,
when switching from a kanban view showing the properties to a list view
that should be showing the same properties, these are not shown.

This happens because the model in the kanban controller currently uses a
reference of the fields. When loading the list view, the properties are
thus already in the fields, and they are skipped when trying to apply
them.

This commit solves the issue by working with a copy of the fields in the
kanban controller, as the list controller does since commit [1].

[1]: https://github.com/odoo/odoo/commit/70619d0e6a23f955265c99aa6b25924357e46223

Task-3284508

closes odoo/odoo#120128

X-original-commit: 4ccb018ef1d301d2e52fea05b4949d77049be3ca
Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-10 13:21:49 +02:00
Julien Carion (juca) 787c6ff32a [FIX] web: Handle access rights in readonly fields
This commit adapts the behavior of all readonly fields
to take access rights into account when deciding whether the field
should be editable or not.
Steps to reproduce: give minimal access rights to Marc Demo user,
log in as Marc Demo, go to crm, make sure no one is assigned as
salesperson in a record and check if the add user icon is available.
Also applies to every kanban view fields (like priority,
many2many_avatar, ...)

opw-3265086

closes odoo/odoo#119818

Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-05-10 13:21:47 +02:00
luvi 01715de04a [IMP] base_import: improve date(time) formatting options
This commit improves the suggestions displayed to the user when editing
the date or datetime options in the sidebar of the Import action.
A tooltip is also displayed next to each label, to let the user know how
to format properly the date if he wants to write a custom one to match
his own needs.

Since commit [1], a legacy utils was imported to convert a moment format
to strftime. Since this file was legacy, it was needed to remove its import
from the import action and replace it with a newer utility function. Because
this function was not imported elsewhere, it could be removed completely.

In dates.js, a new function allow a user to write a date format in a
human readable format, while converting it to a valid Python strftime
format, to send back to the server the right date.

A test has been added for this improvement.

[1]: 2361f021c3

task-3248787

closes odoo/odoo#117750

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-05-10 13:21:44 +02:00
Maximilien (malb) b084104d8b [IMP] l10n_syscohada: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allows for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#116380

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:42 +02:00
Maximilien (malb) 7e67a1959f [IMP] l10n_uy: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allows for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#116375

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:39 +02:00
Maximilien (malb) bf2c4a76dc [IMP] l10n_gt: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#116361

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:34 +02:00
Maximilien (malb) 16de9f4a69 [IMP] l10n_cn: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#115529

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:32 +02:00
Maximilien (malb) 3d27a7243f [IMP] l10n_si: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

Also adding translation of description.

closes odoo/odoo#115499

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:29 +02:00
Maximilien (malb) d04063033a [IMP] l10n_no: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#115480

Task-id: 3052677
Related: odoo/enterprise#38271
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:24 +02:00
Maximilien (malb) a6fe258ec1 [IMP] l10n_at: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#115088

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:21 +02:00
Maximilien (malb) 4f1f4e0d42 [IMP] l10n_pe: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

closes odoo/odoo#114814

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:19 +02:00
Maximilien (malb) 3551b7f9df [FIX] hr_payroll_account: salaries journal
Before this PR, when installing the module. A Traceback could happen if you already have a journal with a code SAL. This PR remove from the demo data the adding of the journal and is replaced by a post init hook to check if the journal is present, if not then add it.
In addition, we use the journal for hr_payroll_structure so in the post init hook, we had the journal for the structure that needed it.

closes odoo/odoo#114758

Task-id: 3271099
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:16 +02:00
Maximilien (malb) 7d39d60bca [IMP] l10n_id: taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the taxes name so that it's more clear for the users

Task-id: 3052677
Part-of: odoo/odoo#114758
2023-05-10 13:21:16 +02:00
Dylan KissandArnaud Verlaine aeac427a75 [IMP] l10n_ma: update localization
Complete revamp of the Moroccan localization.

- Chart of Accounts according to the official CGNC (Code Général de la Normalisation Comptable)
- English source terms with official French translations
- Sensible default accounts for all properties
- All taxes needed for the tax report
- Fiscal positions
- Official Moroccan tax report
- Demo data

References:
- http://www.befec.ma/documentation/comptabilite/Plan_comptable/CGNC/cgnc.pdf
- https://www.tax.gov.ma/wps/wcm/connect/2aabc75b-959e-4753-a152-3441104acaf7/adc_080b_22i.pdf?MOD=AJPERES

task-3040333

closes odoo/odoo#109498

Related: odoo/enterprise#35604
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: Arnaud Verlaine <arve@odoo.com>
2023-05-10 13:21:13 +02:00
Odoo's Mergebot f0261650ba [IMP] {test_}mail, crm, website_slides: unfollow record from inbox and mail
Allow partner to unfollow a document from a follow up email or the inbox:
- through an unsubscribe URL in the email even if not connected
- through a link in the inbox

**Details concerning the inbox implementation:**
When hovering on a follow up message with a related document followed by the
user, the interface displays an action to unfollow it that allows the user to
remove himself/herself as follower of the document. As a result of performing
that action a toast is displayed as a feedback.

Technical note:
The unfollow link is displayed on a message.canUnfollow is true which check
that the thread related to the message is followed by the user.

In order to know if the user follows the record related to the message, we now
transmit with each message the id of the follower table that link the user to
the related record if it follows it. This allows to insert the follower on
client side so that the unfollow action can use the standard mechaism already
developed to unfollow a record.

Unfortunately, that information coudn't be added in the already public method
message_format of mail message because that method is not always called on the
user retreiving the message but also by the one posting message. We didn't want
also to include all followers in the formated message so we rely on additional
method that add that information per partner.

To support unfollowing a document in the inbox no matter the current company,
we have modified message_unsubscribe in mail_thread to allow internal user to
unsubscribe themself without checking any rights. Indeed, some document have
record rule that prevents reading it if the user is not in the right company
(ex. crm.lead) and then was preventing the user to unfollow the document using
that method.

**Details concerning the mail implementation:**
It works for internal user for follow up on any document and for any partner on
follow up of document tagged as authorizing being unfollowed by any partner (
slide.channel and slide.slide).

Technical note:
The unfollow block is rendered in mail_thread and updated for each recipient in
mail_mail. We don't render it in mail_mail because we don't have the language
of the message at that point.

Depending on the partner and the related document, the unfollow block is:
- either removed if the user cannot unfollow the document (for example if it
doesn't follow it)
- or updated with partner and document information + a security token

**Query count adjustment:**
In order to display the unfollow link or not in emails or in the inbox, the
system need to query the followers of the document. This is what explains the
added queries.

Task-3061864

closes odoo/odoo#107978

Related: odoo/enterprise#34972
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-10 13:21:08 +02:00
Pierre-Yves Dufays a0cb558048 [IMP] test_mail: add unfollow record test
Add tests that check the behavior of unfollowing a record from the inbox and
the unfollow link in email.

To support unfollowing a document in the inbox no matter the current company,
we have modified message_unsubscribe in mail_thread to allow internal user to
unsubscribe themself without checking any rights. Indeed, some document have
record rule that prevents reading it if the user is not in the right company
(ex. crm.lead) and then was preventing the user to unfollow the document using
that method. We also add a test checking that internal user can unsubscribe a
record without any read and write rights. And that a portal user can't in the
same circumstance.

Task-3061864

Part-of: odoo/odoo#107978
2023-05-10 13:21:07 +02:00
Pierre-Yves Dufays c8b27bd3a0 [IMP] crm, hr_work_entry_holidays, test_mail{_full}: update query count
In order to display the unfollow link or not in emails or in the inbox, the
system need to query the followers of the document. This is what explains the
added queries.

See odoo/odoo#107978

Task-3061864
2023-05-10 13:21:07 +02:00
Pierre-Yves Dufays 3e57dc295c [IMP] mail, portal, website_slides, mass_mailing: unfollow record from email
Allow partner to unfollow a document from a follow up email of that document
through an unsubscribe URL in the email even if not connected.

It works for internal user for follow up on any document and for any partner on
follow up of document tagged as authorizing being unfollowed by any partner (
slide.channel and slide.slide).

Technical note:
The unfollow block is rendered in mail_thread and updated for each recipient in
mail_mail. We don't render it in mail_mail because we don't have the language
of the message at that point.

Depending on the partner and the related document, the unfollow block is:
- either removed if the user cannot unfollow the document (for example if it
doesn't follow it)
- or updated with partner and document information + a security token

Task-3061864

Part-of: odoo/odoo#107978
2023-05-10 13:21:07 +02:00
Pierre-Yves Dufays b3d9fbd3d5 [IMP] mail: allows unfollowing record from inbox
Allow users to unfollow easily document from the inbox for which he/she doesn't
want to be notified anymore.

When hovering on a follow up message with a related document followed by the
user, the interface displays an action to unfollow it that allows the user to
remove himself/herself as follower of the document. As a result of performing
that action a toast is displayed as a feedback.

Technical note:
The unfollow link is displayed on a message.canUnfollow is true which check
that the thread related to the message is followed by the user.

In order to know if the user follows the record related to the message, we now
transmit with each message the id of the follower table that link the user to
the related record if it follows it. This allows to insert the follower on
client side so that the unfollow action can use the standard mechaism already
developed to unfollow a record.

Unfortunately, that information coudn't be added in the already public method
message_format of mail message because that method is not always called on the
user retreiving the message but also by the one posting message. We didn't want
also to include all followers in the formated message so we rely on additional
method that add that information per partner.

To support unfollowing a document in the inbox no matter the current company,
we have modified message_unsubscribe in mail_thread to allow internal user to
unsubscribe themself without checking any rights. Indeed, some document have
record rule that prevents reading it if the user is not in the right company
(ex. crm.lead) and then was preventing the user to unfollow the document using
that method.

Task-3061864

Part-of: odoo/odoo#107978
2023-05-10 13:21:06 +02:00
Kartik Chavda 629307d310 [FIX] project: make priority field non auto save in page
Before this commit changing priority  from sub-task
and block-by task saves the unsaved change or even create new
records even though user discard that changes.

This commit add 'auto_save' false to prevent auto save for
sub-task and block-by task page.

task-3282848

closes odoo/odoo#120925

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-05-10 11:36:59 +02:00
Kartik Chavda d11cee3474 [FIX] web: add auto save option for state and priority field
Before this commit state selection and priority both
field are saved we change its value even though we
are not saving records and because of that changing
state or priority in sub-task or block-by task
and discarding changes does not set them to their
previous state and it'll create new record without
saving if we change one of those field.

This commit add 'auto_save' option to prevent auto save
on state and priority from sub-task and block-by task
page.

task-3282848

Part-of: odoo/odoo#120925
2023-05-10 11:36:59 +02:00
Renaud Thiry 31262f27a5 [IMP] crm: remove set_lost_with_reason action
This cancels the changes added to f91782279a
for minor version 16.3 as the server action is completely removed
instead of being fixed in this.

The action is not removed in the upgrade as it is still technically
working. Though it should be considered deprecated.

------------------------------------

We remove the action that was used to conditionally call a window action

The action was not called consistently and added confusing indirection.

To maintain the current behaviour of only suggesting adding a loss
reason for opportunities.
We make the reason fields toggleable in the wizard, and hide them by
default for leads.

This leaves the user with the option to add a reason anyway, and serves
as a confirmation wizard if they don't want to.

-------------------

task-3272955

closes odoo/odoo#118494

Related: odoo/upgrade#4640
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-10 10:18:46 +02:00
Renaud Thiry 1a25988101 [IMP] crm: replace context with explicit default
Prior to this we used the context active_ids directly to determine
which leads to mark as lost in the lost reason wizard.

We now use a m2m field to store that value to make the behavior more
obvious and predictable, and to ease debugging.

task-3272955

Part-of: odoo/odoo#118494
2023-05-10 10:18:46 +02:00
Habib (ayh) 6d420a3324 [IMP] account: fix transaction demo data
The bank statement & transaction demo data has problems:
1. the statement doesn't have a name
2. the creation of the statement lines are postponed causing the opening/closing balances to be invalid (as the order of the statement lines is important)

This is due to the  _load_data method in account, which defers the creation of records to ensure that related records are created before they are referenced in relational fields.

This commit adds a condition to avoid deferring fields that have a list of ORM create commands, and fixes the statement name and balances.

closes odoo/odoo#120975

X-original-commit: 1d219de36944685153a77aeeb72920b06728383e
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
2023-05-10 08:23:50 +02:00
Guillaume (guva)andHabib Ayob <ayh@odoo.com> & Laurent Smet <las@odoo.com> e0e7e3b832 [FIX] account: payment_state reversed/paid bill
When partially reversing a bill and paying the
difference, the payment state should be 'paid'.
In the particular case of having the bank account
as manual outstanding payment account on the bank
journal, payment state was 'reversed'.

opw-3235107

closes odoo/odoo#120967

X-original-commit: eb0baf273980957b522e3e41b5d371ba081c915d
Signed-off-by: Laurent Smet <las@odoo.com>
Co-authored-by: Habib Ayob <ayh@odoo.com> & Laurent Smet <las@odoo.com>
2023-05-10 08:23:47 +02:00
Sanket Brahmbhatt 5ddd39b5b7 [FIX] account: prevent traceback when creating new bank account
When the `account.journal.bank_statement_source` field is validated at that time
it won't be able to find the `file_import` value in the options of this selection
field as they are dynamically generated and the `file_import` value is generated
in the `account_bank_statement_import` module which is not installed.
So, it will cause Error.

Steps to reproduce :
 1. Install only `account` module
 2. Click on Configuration > Add Bank Account.
 3. Fill up the details. The `Journal` field should be left empty.
 4. Click on Create.

closes odoo/odoo#120923

Sentry: - 4042261837
X-original-commit: eda822ce7c3884350ecfb8bbb10accfe7ff5acf4
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-05-10 06:33:42 +02:00
pedrambiria 70648b064d [FIX] base: add commercial_company_name to the depends
Before this commit: if you add a custom one2many field to the
'res.partner', like x_related_commercial_partner_ids, that is related to the
`commercial_partner_id` in the`res.partner` model, it won't update the
display name of a contact in case of changing its parent_id name.

Here are the steps to reproduce the problem:
 1. Create a new custom field with these values:
   a. Field Type = one2many
   b. Model = Contact
   c. Related Model = res.partner
   d. Relation Field = commercial_partner_id
 2. Create a new Contact that is the "Company" (e.g. "My Company")
 3. Create a new Contact that is the "Individual" (e.g. "My Name"), and
    put the "My Company" as its parent_id.
 4. Now the display_name is "My Company, My Name" which is correct
 5. Change the company name to "My new Company"
  -> display_name won't change, and is "My Company, My Name"

The solution is to add the 'commercial_company_name' to the
`display_name` depends.

opw-3202894

closes odoo/odoo#120908

X-original-commit: f242cad9a27fb0e58e1b9c726573b316534f6be8
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-05-10 05:34:44 +02:00
svs-odoo 8c13f37894 [IMP] product_expiry,stock: generate LN
Before, when the user pastes a list of tracking numbers into the move
line's `lot_name` field (through the move's detailed view), a lot is
created for each line, creating a move line for each new lot, or
assigning each lot to an existing line with no lot.

With this commit, it will also take `qty_done` and `expiration_date` (if
`product_expiry` is installed) from the pasted list if it's relevant.

Each data should be separate either by a semicolon, either by a tab, and
the first data should always be the lot name.
Valid examples for lots and quantities:

lot-01;22
lot-02	12

Valid examples for lots, expiration date and quantities:

lot-03;8;01-02-2005
lot-04	2005/02/01	12-20

The only valid separation characters for the date are the space (" "),
the dash ("-") and the slash ("/"). Examples of valid dates:
20-02-24        20-Feb-2024
20 02 24        20 Feb 2024
20/02/24        20/Feb/2024

If any of the extra values can't be converted into either a quantity or
a date, the whole line will be used as the tracking number.

Also, if dates are pasted but the product doesn't use any expiration
date, the date's part will be ignored.

task-3171866

closes odoo/odoo#115401

Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-10 04:14:55 +02:00
william-andre 0611d8311e [IMP] l10n*: apply automatic icon building
task-3166075

closes odoo/odoo#108617

Related: odoo/enterprise#35547
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-05-10 04:14:50 +02:00