Commit Graph
165232 Commits
Author SHA1 Message Date
Leonardo Pavan Rocha e6e3722dec [FIX] web: show caret in NameAndSignature
Adds a caret to the font selection in the NameAndSignature component.
Prior to this change, the font icon was hidden without the caret.

Also, the caret direction is not being correctly updated when the target
element is closed. This commit fixes this by storing the initial direction
and forcing this direction when the dropdown is closed.

task-3431069

closes odoo/odoo#135774

X-original-commit: 7d11e281fa70a853191378bee3750d12bb76f9b9
Related: odoo/enterprise#47513
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-09-18 22:17:14 +00:00
Simon Wydooghe c3e9ed271b [FIX] mrp: properly handle subassembly production with same serial
If a subassembly was used as component in a finished good and both the
subassembly and finished good were unbuilt, the subassembly could not be
produced again with the same serial (specific use case: medical hardware
refurbishment, medical device is produced/packaged (subassembly), put as
a component into a procedure pack (finished good), both are returned and
unbuilt so the medical device can be refurbished and produced/packaged
again into a subassembly with the same serial).

The _is_finished_sn_already_produced function duplicates domain was
wrongly picking up stock move lines related to the unbuild of the
finished good, making the function wrongly returning True. This fixes
the search domain and adds a test to prevent regression.

closes odoo/odoo#135716

X-original-commit: 4f07b260807053586ac6c01cf92ac3d5e37b1041
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-09-18 22:17:12 +00:00
moerradi 360a658978 [ADD] account_bacs: Added UK BACS Direct Credit and Direct Debit
Implemented support for the BACS payment scheme as per the latest
technical specifications, enabling the processing of BACS Direct Credits
and Direct Debits. Included the mandatory requirement of a Service User
Number (SUN) for businesses conducting transactions via BACS.

closes odoo/odoo#135696

Task-id: 3326945
X-original-commit: 2e6aeffd7ae9116d3445aa53265919cc29afafc7
Related: odoo/enterprise#47487
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Mohamed Erradi (moer) <moer@odoo.com>
2023-09-18 22:17:11 +00:00
moerradi 7e8185ba20 [FIX] account: Resolve foreign key constraint failure on PML deletion
- Added ondelete='cascade' to account_payment_method_line's
field definition.
- Fixes the foreign key constraint failure during module uninstallation
by automatically deleting dependent records.

task-3326945

X-original-commit: 9c10cf4dc1da36a2ef826962887a6538d0c522a2
Part-of: odoo/odoo#135696
2023-09-18 22:17:11 +00:00
Guillaume (guva) 0983809f6e [FIX] *: add access right for group_account_invoice
In https://github.com/odoo/enterprise/pull/41285
and https://github.com/odoo/odoo/pull/118701/files,
we added `group_account_readonly` but we should
add also `group_account_invoice`.

opw-3507588

closes odoo/odoo#135693

X-original-commit: d4ed80e1b991c0fe0585bae4fb378cac0c3044ed
Related: odoo/enterprise#47486
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-09-18 22:17:08 +00:00
Rémy Voet (ryv) 82b3fe05ea [FIX] mrp: fix batch version of _set_dates
`_set_dates` didn't work properly with multiple records.
In fact, it only used the `date_start` and `date_finished` of the
 first record. The assumption was that `date_start`/`date_finished`
 is always the same for each record in self, because it usually
 comes from a write call (writing the same values to a batch of
 records). But inverse methods are also called by the create
 method, and then the previous assumption isn't true anymore.

This bug leads to several inconsistencies between the `date_start`
and the `leave_id`. The `test_replan_mo_without_bom` was fixed in
the previous version, but with the new onchange, it breaks again
because of these inconsistencies.

closes odoo/odoo#135635

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-09-18 22:17:07 +00:00
Rémy Voet (ryv)andWilliam Henrotin a62baec7f6 [FIX] core: fix onchange first snapshot
The 'sale_ebay' module adds the `product_variant_ids` one2many field on
the `product.template` form view. The `product_variant_ids` view
contains `virtual_available` (depending on `uom_id`). When the user
changes the `uom_id` of the `product.template`, onchange is triggered,
it takes a snapshot of the previous data, and it will computes the
previous value of `virtual_available`. But the associated compute
method will fail with a traceback:

File "/data/build/odoo/addons/stock/models/product.py", line 199, in _compute_quantities_dict
res[product_id]['qty_available'] = float_round(qty_available, precision_rounding=rounding)
File "/data/build/odoo/odoo/tools/float_utils.py", line 54, in float_round
rounding_factor = _float_check_precision(precision_digits=precision_digits,
File "/data/build/odoo/odoo/tools/float_utils.py", line 29, in _float_check_precision
assert precision_rounding is None or precision_rounding > 0,\
AssertionError: precision_rounding must be positive, got 0.0

The `precision_rounding` is `0.0` because the `uom_id` of the product is
empty. It is is empty because we force the `uom_id` of the
`product.template` to be `False` in `initial_values` (before the
snapshot), and then the `uom_id` takes the value of its
`product.template` (`False`). But actually, the cache of the product
should be full with its previous values before doing the snapshot.
This was not the case because we only copy data from store fields
(see `fnames`). Then compute fields was computed after setting field
change to `False`.

opw-3334822
opw-3419392

X-original-commit: 5021e77ba52fac465a5d842ac04c0a3a22aea2dd
Part-of: odoo/odoo#135635
Co-authored-by: William Henrotin (whe) <whe@odoo.com>
2023-09-18 22:17:06 +00:00
Odoo's Mergebot 32d86f8a1c [IMP] mass_mailing: move data/demo and update demo subscriptions
Purpose is to ease tracking of data and demo through versions by avoiding
the usage of huge file. Instead split data and demo / main model in mass
mailing and mass mailing sms.

Update file naming according to model / guidelines in various mass mailing
sub-addons.

Make real subscription records for contact / list link, in order to have values
for inner model fields and ease their management / update / removal. It is
better than relying on m2m commands.

Also harmonize some xml ids names to ease future changes.

Task-2702607

closes odoo/odoo#135299

Related: odoo/upgrade#5159
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-18 22:17:04 +00:00
Thibault Delavallée 1f7c515086 [IMP] mass_mailing(_sms): make data subscription a real record
Make real subscription records for contact / list link, in order to have values
for inner model fields and ease their management / update / removal. It is
better than relying on m2m commands.

Also harmonize some xml ids names to ease future changes.

Task-2702607

Part-of: odoo/odoo#135299
2023-09-18 22:17:04 +00:00
Thibault Delavallée e114822875 [MOV] mass_mailing(_*): rename demo files
Just update file naming according to model / guidelines.

Task-2702607

Part-of: odoo/odoo#135299
2023-09-18 22:17:04 +00:00
Thibault Delavallée ac18b29177 [MOV] mass_mailing_sms: split data / demo into sub files
Purpose is to ease tracking of data and demo through versions by avoiding
the usage of huge file. Instead split data and demo / main model.

Task-2702607

Part-of: odoo/odoo#135299
2023-09-18 22:17:04 +00:00
Thibault Delavallée ff9c587b73 [MOV] mass_mailing: split data / demo into sub files
Purpose is to ease tracking of data and demo through versions by avoiding
the usage of huge file. Instead split data and demo / main model.

Task-2702607

Part-of: odoo/odoo#135299
2023-09-18 22:17:04 +00:00
Martin Trigaux bf81596aa7 [IMP] base: use es_419 and not es_MX as reference
And load only two languages, not three.
Faster to load and avoids ambiguity when a Mexican sees es_ES content

closes odoo/odoo#134785

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-09-18 22:17:02 +00:00
Chong Wang (cwg) 007d2bde2a [REF] translation: better get_po_paths
make the tool function get_po_paths to reduce duplicated code

Part-of: odoo/odoo#134785
2023-09-18 22:17:02 +00:00
Martin Trigaux dccc8f39d0 [ADD] base: add Spanish Latin America
Before es_MX was informally considered as the "reference spanish" as
we have an office in Mexico.
Create a new language that will be used by all the local variations of
Spanish and that we can push without overlapping with es_ES content.

Part-of: odoo/odoo#134785
2023-09-18 22:17:02 +00:00
Nishit Prajapati 9f33b498f5 [FIX] survey: resolve the traceback for matrix question type
Steps to reproduce:
- Create a survey with matrix-type questions.
- Test the survey.
- Click on the given option it gives a trackback.

Issue:
- The issue occurs because the scope of `this` keyword is unavailable.

closes odoo/odoo#134671

Task: 3485467
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-18 22:17:01 +00:00
Adrien Minne (adrm) feae29c4bb [FIX] spreadsheet: add missing icon for download button
The icon was missing in the download menu item for portal users that access
a shared spreadsheet.

closes odoo/odoo#134457

Task: 3495200
Related: odoo/enterprise#46977
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-09-18 22:16:59 +00:00
sankalp chhunchha (schh) 029acb256a [IMP] mail: download all files of discuss message at once
This commit introduces a new message action to download
all files of the message, when the message contains more
than a single attachment.

This commit also do not show the delete icon on a file
when it's linked to a message without any text content, and
there's only 1 file attached to this message.
This is because deleting message and deleting the file means
basically the same, as deleting the attachment would mean the
message is empty, and empty messages are considered deleted.
We only show "Delete" of the message for clarity.

Task-3340653

closes odoo/odoo#132164

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-18 22:16:58 +00:00
Maryam Kia 23394cb345 [IMP] mail: Allow screen and video sharing at the same time
Before:
- sharing the screen stops sharing video and vice versa

after:
- If user starts to share screen at the same time with video sharing, a pip of video sharing appears on the call when user focuses on the sharing screen and vice versa. This pip is draggable and depends on the nearest corner to drag situation, will be located on the corner.

Task-3374606

closes odoo/odoo#130354

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-18 22:16:57 +00:00
Renaud Thiry 79e9665a49 [IMP] mail: improve Composer duplicates check
Only duplicate emails used to be checked when sending a mass mail.

However it is possible (e.g. using templates) to send a mass mail
to the same person containing different information.

The existing functions to allow models to specify emails
processed in the past by some other means are kept.

A new check is added in the processing that checks the full contents
of the message, subject and attachment ids.

The strings are not hashed as most situations are:
- Sending the exact same mail to everyone
  -> Only need to check against one message
   -> Same complexity as hashing

- Sending all different emails
  -> Checking inequality of str is usually very fast

For attachments, as we cannot compare them easily.
They are ignored for the purpose of equating emails
whenever there are the same number of attachments
in the email values as there are on the composer.

This is because each email should receive its own copy
of the composer attachments. If they have a different
number of attachments, they were generated dynamically
through reports and we assume they are all different.

We can thus remove the 'document based' information
as it is implicitly infered from this check.

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

Test utils are also updated for two purposes:

1. Add optional body and attachment_name discriminents
assertMailMail assumed all emails could at least be
differentiated by subject. Our test breaks that
assumption, so we use body and attachment to find the
best-fitting email based on the data passed in.

2. Check email_formatted on recipients
When using assertMailMailWEmails, we first find the
email using the non-formatted email of the recipient.
This does not match assertSentMail which checks against
the raw email_to value, which would often be formatted.

Task-2826811

closes odoo/odoo#99541

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-18 22:16:56 +00:00
Didier (did) 8ef53019db [IMP] web: add mail types file to _jsconfig
closes odoo/odoo#135751

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-18 20:56:24 +00:00
Damien Bouvy 500a17a20a [IMP] base: correct symbol position for MVR currency
Source: http://www.mma.gov.mv/#/currency/currencysymbol

Task-3508431

closes odoo/odoo#135744

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-09-18 19:43:06 +00:00
David Monnom (moda) 4f5dd90aa7 [IMP] pos_self_order: default user for self_order mobile
Following the Odo comment https://github.com/odoo/odoo/pull/129562#discussion_r1306030434

We need to ensure that we have a default user for the mobile SelfOrder
when no session is open.

If we don't have a user, the system will be in sudo mode and the price
calculation will be erroneous because the system has chosen the wrong
taxes: it doesn't know which company to use to calculate the taxes.

We now force the setting of a default user for pos_config with mobile
selfOrder enabled, so that when no session is open, the default user
will be used.

closes odoo/odoo#134273

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-18 16:48:02 +00:00
niyasraphy e4f251f8db [IMP] purchase: merge purchase_enterprise
before this commit, purchase_enterprise module is
not adding any functionality to the system, other
than adding few demo data records and passing a
context to an existing action.

initially this module is added to bring the
dashaboard functionality to the purchase app,
but with the introduction of the spread sheet
app, the added dashboard is removed from
the purchase_enterprise app in this
commit: https://github.com/odoo/enterprise/commit/61c8314728fc99dd8c7deb3c55d15e30b4844e18

after this commit, this demo data and context
is moved to the purchase app and remove the
purchase_enterprise app.

closes odoo/odoo#132475

Related: odoo/enterprise#45986
Related: odoo/upgrade#5064
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-09-18 15:42:43 +00:00
Aaron Bohy fd757d7f29 [FIX] web: action service: sanitize action.domain
When it is unset, the domain of an action can be either false or
the empty string, which in both cases means []. Before this commit,
we didn't process the domain in thoses cases (i.e. we kept the
false or empty string value). However, having an empty string as
domain could cause issues if it is manipulated by Domain/pyutils.
In particular, in stock.picking, clicking on "Insert menu in
spreadsheet" crashed before this commit.

To prevent those issues from happening, this commit sanitizes the
domain of the action at the first entry point, such that it's
always an array (the empty array in our case).

This commit comes with a test in enterprise, which reproduces the
scenario given above, as we couldn't find framework and blackbox
scenario to highlight it.

closes odoo/odoo#135738

X-original-commit: a7c32029aaf595b9b3ae13b9c425e384ab4c8305
Related: odoo/enterprise#47500
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-18 10:14:14 +00:00
niyasraphy bf9076439e [IMP] l10n_{}: redirect to own documentation
before this commit, the website link given to
l10n module was generic link of fiscal
localization.

after this commit, on clicking website/learn more
user will be redirected to documentation of specific
country localization.

closes odoo/odoo#135725

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-18 10:14:12 +00:00
Victor Feyens 90796edd15 [FIX] website_sale: do not show unavailable carriers
Carriers with no/invalid/incompatible rules shouldn't
be displayed in the checkout process.

opw-3413820

closes odoo/odoo#135717

X-original-commit: 5052b9e4a15155c694cf005fdf330997770c6cac
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-18 10:14:11 +00:00
yhu-odoo 9e1a0de027 [FIX] mrp: set correct byproduct qty when update bom
When update bom for MO, we records the ratio of (qty on Bom) / (qty on
MO)
https://github.com/odoo/odoo/blob/25502b8513afc9fca0dcdef9df9e814eea2e4ae8/addons/mrp/models/mrp_production.py#L2356-L2361
so when add byproduct, it should be (qty on Bom) / ratio instead of (qty
on Bom) * ratio to get the qty for MO:
https://github.com/odoo/odoo/blob/25502b8513afc9fca0dcdef9df9e814eea2e4ae8/addons/mrp/models/mrp_production.py#L2336

closes odoo/odoo#135691

X-original-commit: 52c03ad19fc8a764cbb362528ae94537c56f2610
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-09-18 10:14:10 +00:00
yhu-odoo a7ec4d60e7 [FIX] mrp: Don't change product_qty/uom when update bom on draft MO
Fix the issue when update the bom on a draft MO, the product_qty and
product_uom_id will be reseted to 1.0 unit.
The original product_qty and product_uom_id hould be kept when update
bom.

X-original-commit: f1a397ede16c56db3410fd9c5fe387dc98c46422
Part-of: odoo/odoo#135691
2023-09-18 10:14:10 +00:00
Samuel Degueldre 4aaee61a5f [REF] website_slides: remove usage of legacy dialog to enroll
The Dialog widget is deprecated and will soon be removed, this commit
converts the usage of this dialog for the enroll buttons to use the new
dialog service.

To avoid duplicating the opening logic in the Quiz code, the selector of
the widget that opens the dialog now targets the #wrapwrap and uses
event delegation for the button, avoiding the need to manually spawn the
dialog for buttons added to the DOM after the first load.

closes odoo/odoo#135476

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-18 10:14:07 +00:00
Shubham Thanki 66e8e65682 [IMP] web: allow users to download multiple vcards at once
This commit adds a download vCard server action in the list view of contacts,
making it possible to download multiple vCards at once.

Task-3385058

closes odoo/odoo#135435

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-18 10:14:06 +00:00
Dawn Hwang fd1f6e1621 [FIX] base: Fix Swiss date and number formats
The fr_CH date format has been broken for years, with unnecessary spaces
after the period. This has been removed.

The de_CH thousands separator prematurely ends after the millions
because it does not loop indefinitely. This has been fixed as well.

closes odoo/odoo#135355

X-original-commit: 287a03224c9144bb547d2cf7cdc046b83b830a16
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-09-18 10:14:05 +00:00
Lucas Lefèvre (lul) 65962d09c3 [FIX] spreadsheet_edition: autofill references in pivot functions
See enterprise PR

closes odoo/odoo#135024

Task: 3458637
X-original-commit: 8bfc188ca4fb9cd8d1e351c0e6d4adbf195405fb
Related: odoo/enterprise#47224
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-09-18 10:14:05 +00:00
adsh-odoo 02720ba28c [IMP] website_event: disable register button and remove the deadcode
-> Prevent registration button activation without selected tickets.
-> Remove the deadcode which was there to append the warning when we click on
   the register button without selecting the ticket.

Task-3345854

closes odoo/odoo#131715

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-18 10:14:01 +00:00
Victor Piryns (pivi) c06881ff69 [IMP] mail: cleanup activities
Description:
The mail_activity table can grow quite large, for example a
business that is making heavy use of the CRM module, slowing down
searches on said table. A lot of users sets activities and then
forget about them, just polluting the database with useless data.
Also we currently keep the activities of archived users, which will
never be resolved, because said users has been archived, so it is
supposed that he will never be able to log in again to remove their
scheduled activities.

Solution:
- Delete activities when archiving an user
- Add a gc routine to delete overdue activities older than X years,
  where X is a system parameter.

Reference:
task-3337077

closes odoo/odoo#130895

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-18 10:14:00 +00:00
Victor Feyens bfbf9035d6 [CLN] website_sale: product_template.py
* clean fields definition
* partial methods reordering according to guidelines

closes odoo/odoo#126637

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-18 10:13:59 +00:00
Horacio Tellez (hote) 433e7e578e [IMP] website_sale: new ecommerce description
Today, we have `sale_description` visible on the eCommerce
(below the product name) and in the PDF reports.
We alse have `website_description` that is only on eCommerce,
below the product information.

Issues:
  - you might want a very long eCommerce description that is
    not printed on the pdf;
  - you might want to use text formatting on that description:
    bold text, bulleted list, accordion, .. --> not possible at
    the moment.

We are thus adding an `ecommerce_description` (HTML field) to
the product that will be shown on the product page and in the
shop if the product is selected.

Task - 2906587

Part-of: odoo/odoo#126637
2023-09-18 10:13:59 +00:00
std-odoo 0a506d63c6 [IMP] mail: convert the "Reset Password" template into QWeb
Purpose
=======
Convert the "Reset Password" template into QWeb, so the users can't
modify it. All values are manually overwritten anyway, and we don't
want the users to be able to change it.

Technical
=========
Now we also manually rollback the transaction, to be sure to not keep
any record in database related to the password change.

We manually create the <mail.mail> because all methods that allow to
send an email from a QWeb template in mail thread use the mail composer,
and `user_notification` is not supported for the `message_type` in this
wizard.

Before, force_send was set to False only when we import users.
Now we just skip the email sending when we import and always set
force_send to True.

Task-3265210

closes odoo/odoo#125874

Related: odoo/upgrade#4807
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-18 10:13:59 +00:00
thsh-odoo f115aa013b [FIX] website_slides: inaccurate completion time
How to reproduce the bug
=========================.
1. Open e-Learning.
2. Create a section.
3. Add a content in the created section and change the default duration .
-> New duration is not set and it is taking the default duration only

Technical
=========
https://github.com/odoo/odoo/commit/7b7fdf8f2771840797e1d416a8275ba3666ab542
This commit introduce the feature to set default time for the content in the
backend if user put the Duration field empty for that content but because of
the extra 'not' in the condition it was always getting true so every time
default value is stored and if completion_time is not there then it is set
to 0.

After this Commit
==================
Now whatever duration user will put, it will be set and if completion_time is
not given then it will give us the default time.

Task-3340462

closes odoo/odoo#135668

X-original-commit: 5cae7c3fa6f564a3f8d42cb255377cdc2ef86276
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-09-18 08:46:58 +00:00
can-odoo 402bf48fb5 [FIX] website: remove ToC snippet on removing last content
The user has the option to remove the last block from the Table of
Content snippet prior to this commit, but doing so breaks the Add Item
feature because there is no reference to adding a new item in the
snippet area, and doing so is also not a good idea.

If the block is the final one in the Table of Content after this commit,
removing the last Content will remove the ToC snippet.

task-3081442

closes odoo/odoo#135733

X-original-commit: 164db4013439042725c94f1690ae0a311be9d554
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-09-17 14:37:09 +00:00
niyasraphy 31f0b21cda [IMP] core: remove wrongly added empty file
added in: https://github.com/odoo/odoo/commit/6cc1c435fd3bb9ed71c4a02796099c6e6f6b5d2b

closes odoo/odoo#135724

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-09-16 09:42:52 +00:00
Claire Bretton (clbr) c1996e335e [FIX] account: fix self.id.origin in get_last_sequence()
When trying to customize Swiss invoice report with QR-Bill
through Studio an error was thrown because it tries to _compute_name()
on a dummy 'account.move' record with self.id=0.

This is part of a more general task in master around report customization
but it make sense to backport the fix in all stable versions.

task-id:3492033

closes odoo/odoo#135722

X-original-commit: d95aae51a23ff163e959a1f3064f42a89cfaf516
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-09-15 20:34:33 +00:00
Thomas Lefebvre (thle) 6f77665383 [FIX] website_sale: modify template if fiscal position changes
Steps to reproduce:
-------------------
- Without going to the shop first, login with a user
   who triggers a different fiscal position and pricelist than the public user.
- In another browser tab (incognito or separate tab),
    go to the shop with the public user.
- Select the pricelist previously used
   by the user in the other session.

Issue:
------
We obtain the prices for the other user's fiscal position.

Cause:
------
When we login with a user who triggers a fiscal position mapping
and go to the `/shop` page, `products_prices`  will be frozen with values
calculated with the fiscal position (via `_get_sales_prices`).

If we change our fiscal position, but use a template that contains
the same `t-cache` key, we won't re-evaluate the template.

As a result, it is possible to obtain values calculated
for another fiscal position.

Solution:
---------
As the template values take into account the fiscal position,
we need to add a `t-cache` key to identify this fiscal position.

opw-3316153

closes odoo/odoo#135709

X-original-commit: 45d765c723a8e7bb05f1b79f6234559018660262
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-09-15 20:34:32 +00:00
dane@odoo.com 7a85ea2eeb [FIX] mass_mailing_themes: fix image path
The image from mass_mailing was moved to mass_mailing_themes
Therefore we should also update its path.

task-3328661

closes odoo/odoo#135692

X-original-commit: fc34e1049c2ad979df611f1aa4b57f66b8cdf5b1
Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
2023-09-15 20:34:30 +00:00
Robin Lejeune (role) e3b3bc2978 [FIX] website: fix animations in popups without backdrop
Since the scrollbar was moved from the window to .modal-content at [1],
animations inside popups without backdrops would not be working anymore
because the scroll was not checked against the right element.

This commit fixes this by using the right scroll element's scrollTop.

task-3328419

[1] https://github.com/odoo/odoo/commit/cb7cf77

closes odoo/odoo#135404

X-original-commit: 1b618b323424e29b0ddf9eae686e0ef2540b3627
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-09-15 20:34:29 +00:00
Valentin ChevalierandMathieu a9f9316b22 [IMP] website_sale: Show a toast notification when add to cart
This commit introduces an exciting new way to have visual feedback when
a customer adds a product to the cart.

Instead of an animated image moving toward the cart icon, a toast
notification that sums up the product(s) added to the cart is now shown.

Note that a minor change to `notificationService` has been made to allow
more customization. It is now possible to extend it while specifying a
custom `NotificationContainer`.

task-3492346

closes odoo/odoo#133990

Related: odoo/upgrade#5106
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Mathieu (mano) <mano@odoo.com>
2023-09-15 20:34:28 +00:00
Valentin Chevalier 95bb1c906b [FIX] website_sale: improve the speed of /shop/cart/update_json
Before this commit, a lot of `/shop/cart/update_json` wrongly requested
to re-rendender cart templates.

Now, calls to `/shop/cart/update_json` will specify if they needs the
updated cart templates or not.

Part-of: odoo/odoo#133990
2023-09-15 20:34:28 +00:00
FrancoisGe d84e570630 [FIX] web: switching pages doesn't change pager limit
Before this commit, in form view, editing a record then switching page
incremented the pager limit by 1.

closes odoo/odoo#135659

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-15 19:14:28 +00:00
Moises Lopez - https://www.vauxoo.com/ 3d3327d5f0 [IMP] point_of_sale: Speed-up queries filtering by 'pos_order.state'
The following method:
 - https://github.com/odoo/odoo/blob/2091994c/addons/pos_restaurant/models/pos_config.py#L40

Gets the following query:

    SELECT min("pos_order".id) AS id,
    count("pos_order".id) AS "table_id_count",
    "pos_order"."table_id" as "table_id"
    FROM "pos_order"
    LEFT JOIN "restaurant_table" AS "pos_order__table_id" ON (
        "pos_order"."table_id" = "pos_order__table_id"."id")
    WHERE (("pos_order"."state" = 'draft')
        AND ("pos_order"."table_id" in (TOO MANY IDS HERE)))  -- for this case 178 restaurant_table records ids
    GROUP BY  "pos_order"."table_id", "pos_order__table_id"."id"
    ORDER BY "pos_order__table_id"."id"

It spends 24ms without index

After creating index it spends 0.57

It is not the unique side filtering by pos_order.state column

Check the following lines of code:
 - https://github.com/odoo/odoo/blob/f5553c550/addons/point_of_sale/models/pos_order.py#L678
 - https://github.com/odoo/odoo/blob/f5553c550/addons/point_of_sale/models/pos_order.py#L690
 - https://github.com/odoo/odoo/blob/f5553c550/addons/website_sale_coupon/models/sale_order.py#L91

closes odoo/odoo#135636

X-original-commit: a658dfcd60032cfe01f2f019f4bf05e140d68339
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-09-15 18:13:47 +00:00
Dylan Kiss (dyki) f31a0ea7a5 [IMP] account: add date options for tax periods
Currently the tax report always opens the previous month by default.
Since tax periods are not always months, it makes much more sense to
open the previous "tax period" (whatever length it has) when opening the
tax report.

In order to allow that, this commit introduces a "This Tax Period" and
"Previous Tax Period" option for reports and sets the default period
for the tax report to "Previous Tax Period". The rest of the
functionality is done in the related enterprise commit.

task-3481913

closes odoo/odoo#133715

Related: odoo/enterprise#46601
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-09-15 16:45:52 +00:00