Commit Graph
164380 Commits
Author SHA1 Message Date
Sébastien Theys 3cbe9d46fc [REF] mail: move mail.message/mark_as_read to new service
Part of task-3265211

Part-of: odoo/odoo#129583
2023-07-27 20:32:32 +02:00
Sébastien Theys 83f8c0864d [REF] mail: move mail.message/delete to new services
Part of task-3265211

Part-of: odoo/odoo#129583
2023-07-27 20:32:32 +02:00
Sébastien Theys d04d64c5ca [REF] mail: move mail.message/inbox to new service
Part of task-3265211

Part-of: odoo/odoo#129583
2023-07-27 20:32:32 +02:00
Sébastien Theys bc2aacd7b6 [REF] mail: move mail.link.preview/delete to new service
Part of task-3265211

Part-of: odoo/odoo#129583
2023-07-27 20:32:32 +02:00
Sébastien Theys b76db01aec [REF] mail: move mail.record/insert to new services
Part of task-3265211

Part-of: odoo/odoo#129583
2023-07-27 20:32:31 +02:00
Sébastien Theys 704d37b0de [REF] im_livechat: remove messaging service patch
Part of task-3265211

Part-of: odoo/odoo#129583
2023-07-27 20:32:31 +02:00
Sébastien Theys 3cfe5200b2 [REF] mail: move mail.activity/updated to new service
Part of task-3265211

Part-of: odoo/odoo#129583
2023-07-27 20:32:31 +02:00
niyasraphy 95190bb8cf [FIX] payment: traceback on rpc call in fields_get method
before this commit, on calling the fields_get method of
payment.link.wizard model from xmlrpc is raising exception,
instead of returning the data

after this commit, without any traceback the requested
data will be returned to the user.

closes odoo/odoo#129927

X-original-commit: 290210d1da38b7ee19f441117aa1448a43bcc8f5
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-07-27 17:34:10 +02:00
Romain Derie 90fa25e44d [FIX] website: avoid crash in search snippet when page has no url
Since commit [1] (introduced in Odoo 15), when a published website page
has no URL set, the search snippet would crash when typing something
inside it.

I am not sure why was the page url not required at the model level, this
will be considered in master.

Note that to create a page without a URL, the only flow is to create a
new page in the backend.
Indeed, the `write` is overridden to add a trailing `/`, and the
frontend flows to create/write a page are also shielded against empty
URL.

Note that it's easy to create a page without a URL through legit flows.
Depending on the Odoo version, there is always a way to reach a website
page form view: either simply Website > Configuration > Pages or
Site > Pages > Debug mode > Click on Bug icon in tree view > Click on
page m2o.

Step to reproduce:
- Create a page with no URL (see above explanation how to do it)
- Make sure it's publish (you can do it in the form view)
- Drag & drop the Search snippet on a page
- Type something in the search snippet
-> TB

[1]: https://github.com/odoo/odoo/commit/9f9c4bb7e40233e633f97c60fb00ae191e9077af#diff-77bd6b19c39e211959885024bcad914655ff84cfc10c16633687d014e50aa69aR69

Fixes https://github.com/odoo/odoo/issues/129728

closes odoo/odoo#129915

X-original-commit: f75ec6131eff9165b06d42d27a49dd756387f4a0
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-07-27 16:14:31 +02:00
Chrysanthe (chgo) 83903d0a90 [FIX] web: add missing gap between PDF buttons
=== ISSUE ===

In some modules, there is a recurring layout issue with buttons being
compressed. This is caused by a missing `gap` or `margin` and
results in two main issues :

1/ It reduces the clickable zone of each button (you are more likely
to click on its neighbor rather than the one you wanted)

2/ It does not look good and causes inconsistency with other buttons.

=== AFTER ===

We simply add a `d-flex` and a `gap-1` class to the container to be sure
that no matter how many buttons are inside that <div> they will
always be spaced correctly.

task-3433602
part of task-3326263

closes odoo/odoo#129906

X-original-commit: 6fc57407478e79232e46c21e21981eeff419d884
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-27 16:14:26 +02:00
Pedram (PEBR) 634b4990c8 [FIX] point_of_sale: handle barcode parsing errors with fallback
This commit addresses an issue with barcode parsing where the parser
might fail when dealing with different types of barcodes, such as
an EAN-13 barcode being parsed with a GS1 barcode parser. To improve
the user experience and add flexibility, a fallback mechanism
has been implemented.

This commit allows users to set a fallback using a system parameter.
This can be accomplished by adding a system parameter with a key equal
to 'point_of_sale.fallback_nomenclature_id'. The value should be set
equal to the barcode nomenclature id.

This provides a robust solution to enhance the reliability of the
system in various scenarios where different types of barcodes are
in use.

opw-3382121

closes odoo/odoo#129891

X-original-commit: 57a2eab4e4b8e7aac6932213611dbd4148f58bd8
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-07-27 16:14:24 +02:00
Aaron Bohy ffcd0bd156 [REF] web: remove expand parameters from web_read_group
The expand, expand_limit and expand_groupby allowed to ask
read_group to populate groups with search_read results directly.
It was only used in the list view, when `expand="1"` was set on
its root node in the arch. Since [1], the list view no longer uses
these arguments, as we uniformized the logic between list and
kanban (where groups are always opened by default).

[1] https://github.com/odoo/odoo/pull/114024

Part of task~3179751

closes odoo/odoo#129881

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-27 16:14:21 +02:00
vlst 7eddbfd981 [IMP] pos*: add tax info on receipt
pos*: point_of_sale,l10n_ae_pos, l10n_gcc_pos

Currently, the pos receipt shows the total amount of taxes paid.
Different localisations require more information regarding the taxes
to be shown on the receipt.

In this PR we improve the receipt by adding specific information
for each of the applied taxes and a mechanism that would allow
each localization to more easily display the proper tax information.

This change makes it so the pos is in accordance with the United Arab Emirates
regulations by default. This means that we are removing the `l10n_ae_pos`
module, as we no longer need it.

closes odoo/odoo#125418

Task: 3305403
Related: odoo/upgrade#4858
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-07-27 16:14:09 +02:00
Aaron Bohy 662e866340 [REF] web: remove unused underscore.js customization
Since [1], underscore.js is no longer used in Odoo and the lib has
been removed. However, we had a customization of the lib, that is
no longer used in any assets (it would crash it it was), but that
hasn't been removed. This commit removes it.

[1] https://github.com/odoo/odoo/pull/125889

Part of task~3439226

closes odoo/odoo#129875

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-07-27 14:47:44 +02:00
tsm-odoo 48634b52b0 [FIX] mail, web: fix duplicate rpc when switching record
Since [1], switching from one record to another in a form view
would send two `/mail/messages` rpc. This is due to the
`onWillLoadRoot` hook that triggers a `MAIL:RELOAD-THREAD` event
while the thread is going to change. As a consequence, messages
are fetched for the currently active record and the one that will
be activated.

This PR fixes the issue by ensuring the thread won't change before
triggering this event.

[1]: https://github.com/odoo/odoo/pull/114024

closes odoo/odoo#129869

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-27 14:47:42 +02:00
dhba-odoo c5d7d6057a [FIX] mass_mailing: traceback when dropping snippet in empty mass_mailing
Before this commit:

when new snippet is drop in mass_mailing after first delete everything and
exiting from codeview a traceback occurs.

After this commit:

Now, a new snippet can be dropped in empty mass_mailing.

Task-3178818

closes odoo/odoo#129865

X-original-commit: 8e93f3c65ada549c51b841d1f39a3422be6f3e27
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-07-27 14:47:39 +02:00
Fabien Pinckaers 49f03d007e [IMP] website_event: minor UI cleanup
Remove ugly (light green) backgound color and use default white
2 questions per row, it was crowded to register multiple participants
Less vertical paddings on multiple tickets
UI buttons of registration dialog: both on same side

closes odoo/odoo#129863

Signed-off-by: Fabien Pinckaers (fp) <fp@odoo.com>
2023-07-27 14:47:37 +02:00
Alexandre Kühn 1cc8f40d74 [FIX] mail: smooth scrolling in mobile messaging menu
Before this commit, scrolling inside the messaging menu in mobile
was stuttering.

This happens because the dropdown is in full screen, and whenever
there's a scroll inside this dropdown menu, the position is
recomputed from internal `usePosition()` hook of `Dropdown`.
The repaint of recomputing this position is costly because of
using `bottom: 0` and having images in notification items that
have transparent background (e.g. chatter notifications).

This commit fixes the issue by defining the height of the messaging
menu dropdown in mobile without `bottom-0`. This drastically eases
the repainting for fixed position. `ActivityMenu` had the exact same
problem, so it is also considered in this fix.

closes odoo/odoo#129859

X-original-commit: 67af0ac45dcea55f52ee7ffbc253827d665d7ac6
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-27 14:47:34 +02:00
Adrien Minne (adrm) 4c13f4f08c [IMP] spreadsheet: detect mismatch in user/spreadsheet locale
This commit add a small indicator in the spreadsheet's control panel
to indicate if the user's locale is different from the spreadsheet's.

closes odoo/odoo#129857

Task: 3389491
X-original-commit: 5c776994f7bd230816369be3899989e7ab780906
Related: odoo/enterprise#44665
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-07-27 14:47:32 +02:00
Rithwik 41e08479c8 [FIX] website: implements contains for hidden_condition_no_text_opt
Multiple field visibility was not working properly while using
Multiple Checkbox field as visibility condition. Only "is equal to"
and "is not equal to" was implemented for Multiple Checkbox. The
"is equal to" uses formData.get which only retrieves the first
value from Multiple Checkbox. The Multiple Checkbox was not having
"contains" option which was already available for some other
fields.

This commit will implement "contains" for all the input types
which comes under hidden_condition_no_text_opt in the file
s_website_form.xml. These include radio, checkbox and Multiple
Checkbox. The fields which comes under hidden_condition_no_text_opt
which does not require multiple inputs can use "contains" and
"doesn't contain" interchangeably with "is equal to" and
"is not equal to"

Fixes #120631

closes odoo/odoo#129853

X-original-commit: 696d74e5304bd48e965a1c5f5fc0b5a5205f5d49
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-07-27 14:47:27 +02:00
Julien Van Roy c04f747641 [FIX] l10n_fr: VAT report 2023 update
Adapt to the new 2023 VAT report.

task-3262513

closes odoo/odoo#129849

X-original-commit: b9dc3316701403ce65d371b2542fda27c3c5f9e0
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-07-27 14:47:24 +02:00
Adnan Saiyed 4b12dc86e1 [FIX] web_editor: shiftTab doesn't work on styled text
Current behaviour before commit:

shiftTab doesn't outdent the styled text.

Desired behaviour after commit:

Now styled text gets outdent by shift + tab.

task-3283175

closes odoo/odoo#129844

X-original-commit: 1a438fa3f29794a44cda57917d2133b439c3fd0a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-07-27 14:47:19 +02:00
Thibault Delavallée c6950aca6d [FIX] phone_validation: add missing translation
An action name was not translated.

closes odoo/odoo#129839

X-original-commit: 43b434f58fa585abcd62579577745a3b725c7f64
Related: odoo/enterprise#44661
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-27 14:47:17 +02:00
Thibault Delavallée e86ae05208 [IMP] test_mail{..mailing}: improve tooling (recipient / email check)
Improve low-level checks of recipients in mail asserts. Sometimes 'email_to'
cannot be easily deduced from given input (partners, records customers, ...)
when some record -> email transformations are involved e.g. when dealing
with multiple emails input, double encapsulation, ...

Those tools are about to be used in upcoming tests and fixes.

Task-3438381 (TestMail: backport tools)
Prepares Task-2612945 (Mail: Defensive email formatting)

X-original-commit: bdbe846329ed51e4c5e3b75740e8f594edf7b138
Part-of: odoo/odoo#129839
2023-07-27 14:47:16 +02:00
Thibault Delavallée 4257ae03cd [IMP] test_mail{..mailing/full}: backport tooling improvements
PURPOSE

Purpose of this commit is to backport some improvements done in mail testing
tools done in newer versions. Some of them are required for incoming tests
to be added, other just to try to ease writing tests across versions.

SPECIFICATIONS

Partial backport of odoo/odoo@94208cb8b4

Improve finding outgoing mails and emails when batch methods (mass mailing)
create similar emails, that can be distinguished notably by the subject
in addition to from / to.

Partial backport of odoo/odoo@c98f259736

Add a method to check MailMail, based on a given record. When having duplicates
to differentiate in a given mailing, having just recipients is not sufficient
as multiple emails may match a given recipients list. Checking model / res_id
is another method for finding emails.

Partial backport of odoo/odoo@a3e404e17e

Add some information and values propagation in some custom asserts in mail
test tooling.

Partial backport of odoo/odoo@b915617569

Allow to return <mail.mail> records and found outgoing emails when using
asserts. It eases doing checks in some specific tests e.g. checking
notification layout usage in emails. Indeed this is quite low level and
does not really deserves its own assert tooling methods.

Partial backport of odoo/odoo@bbf4783ac6

Improve checks and asserts done when asserting content of produced
mailing content (mails, traces, ...).

Task-3438381 (TestMail: backport tools)
Prepares Task-2612945 (Mail: Defensive email formatting)

X-original-commit: 2bc28c804a92f206133c352c046dcdd4971fd4a6
Part-of: odoo/odoo#129839
2023-07-27 14:47:16 +02:00
Antoine (aboo) 3527520d83 [IMP] l10n_mx: Addition of 3 default UoM.
Problem
---------

Some Unit of Measures need to be configured when using the Mexican
Localisation to be used in their electronic invoicing system. As of now
they are not installed by default but many businesses will need to add
and configure them manually. Let's make those included in the l10n_mx
localisation.

Objective
---------
Addition of the Service UoM category and the 3 UoMs in the UoM data file:
 - Service Unit
 - Activity
 - Job

Solution
---------
UOM category and units were added in an XML file in the data folder.
Translation added to the uom.pot file to be translated later;
translation already added in es_MX since the task is targeted at Mexican
localisation.

task-3392056

closes odoo/odoo#129672

X-original-commit: 0f88914a4618aa1abd250b6cf701a5f7b381f41e
Related: odoo/enterprise#44590
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
2023-07-27 14:47:07 +02:00
FrancoisGe 2d61351705 [IMP] web: update accepts commands for x2m
Before this commit, the record.update function did not allow x2m fields
to be updated. Thanks to this commit, you can update an x2m by passing
a list of commands that will be applied to the x2m's static list.

This makes it possible to update several fields, including x2m fields,
while triggering only one onchange to the server.

closes odoo/odoo#129507

Related: odoo/enterprise#44532
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-27 14:47:00 +02:00
Alexandre Kühn 6b2117049c [FIX] mail: no crash when closing chat window from barcode app
Steps to reproduce:
- Open barcodde app
- Go to Operations > Delivery Orders
- Click on avatar button to open chat
- Click on back button

Traceback:
```
Cannot read properties of null (reading 'click')
```

This happens because closing the chat window attempts to
open the messaging menu in mobile. This assumes chat
windows are working in `/web` and the systray is available.
Barcode app is special because it's in `/web` but the systray
is not available.

This commit fixes the issue by opening the messaging menu if it
can, otherwise it silently does nothing.

Task-3439660

closes odoo/odoo#129858

X-original-commit: 399f191dc1bb40d352890607413fa72462f1a99d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-27 13:25:12 +02:00
Benoit Socias 36623d1687 [FIX] website: fix website text edition test
Since [1] the `website_text_edition` tour fails because it manages to
change tab, drop a block, select a paragraph and click on a button
before the bundle reload happens.

This commit makes sure `updateOptionsUI` is awaited and that any
subsequent call is only queued afterwards.

task-3370939

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

closes odoo/odoo#129855

X-original-commit: 81abdb96aeb95e492230d39000e28c0d239840de
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-07-27 13:25:10 +02:00
Claire Bretton (clbr) 417268bef8 [IMP] account: Send & Print shows warning banner while async sending
When you select multiple invoices in List view and use the Send & Print, the invoices
will be sent asynchronously using a cron trigger. This can take some time.
If the user opens one of the to-be-sent invoices, there is nothing telling the
user that this invoice is part of a running batch and will be sent eventually.
This might cause cases where the user will try to trigger the send & print
manually again, causing some concurrency issue.
To at least mitigate the issue, we will display something on the
invoices that are part of a running batch of a Send & Print

task-3360179

closes odoo/odoo#129854

X-original-commit: 9349ae9d44e09f5282f4719c73c3f6b12b04e99c
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-07-27 13:25:07 +02:00
Romeo Fragomeli e8f7b13414 [FIX] web: domain selector background color
This commit, remove the not mandatory CSS rule on the input for the
`Domain Selector` modal, and so the input uses the transparent color.

Steps to reproduce:
* Open Odoo (Enterprise)
* Activate the dark mode
* Open a App (e.g.: Contact)
* Add a filter in the search bar
* Click on the filter icon in the facet
  => The background inputs are white with white text color => BUG

closes odoo/odoo#129842

X-original-commit: d36505edec607161c6884892e8de34d42a10f207
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-07-27 13:25:04 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
Ivàn Todorovich 714e254e7d [FIX] event: badge report dates in event's tz
Steps to reproduce:

1. Create an event with a remote TZ.
2. Create and confirm an attendee for this event.
3. Check the registration confirmation email and report.

Current behaviour:

* The dates in the email are in the event's tz.
* The dates in the report are in the user's tz.

Expected behaviour:

* Both dates should be consistent and be in the event's tz.

closes odoo/odoo#129815

X-original-commit: 246626264c00ec8502bc0cfc9d8eb20c8c4b0049
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
2023-07-27 10:33:03 +02:00
Samuel Degueldre 9d6f23c20b [FIX] web: avoid monokai ace editors leaking memory in qunit suite
When attempting to instantiate an ace editor with a given theme, ace
will first create the editor with the default theme (textmate) which is
always loaded, and register a callback to be called after the
non-default theme has been loaded. This callback holds a reference to
the editor's renderer which can itself retain large objects such as an
entire owl application. These callbacks are not cleared even if the
corresponding editor is destroyed.

Because in tests, the theme "monokai" was not included and ace cannot
load it on its own, all tests that attempt to create an ace editor with
that theme will leak memory. This commit fixes the issue by adding
theme-monokai to the qunit suite assets.

closes odoo/odoo#129813

X-original-commit: e8c77c5737c2170bb6b53d3e667aec7318dde5b8
Related: odoo/enterprise#44653
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-07-27 10:32:56 +02:00
Ahmad Khanalizadeh 6dfb294b43 [FIX] point_of_sale: load partners when scanning barcode
Before this commit, because limited partner loading is enabled by
default, only a limited number of partners were loaded. If the user
tries to add a partner that is not loaded in the PoS, it is not
fetched from the server.

To fix this, we should load the partner when their barcode is scanned.

opw-3398628

closes odoo/odoo#129798

X-original-commit: 6b7e18382ec35565ed978bb0ba7f3d5fd6c5e76c
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Ahmad Khanalizadeh (khah) <khah@odoo.com>
2023-07-27 10:32:53 +02:00
Thibault Delavallée 2fc8a324d1 [FIX] phone_validation: use international formatting in onchange
International formatting ease reading the value, which is handy in onchange.
This partially reverts odoo/odoo@51d571fab4 .

closes odoo/odoo#129851

X-original-commit: dab802a939c97603f70c504e98ecc92b0ac552f9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-27 07:00:08 +02:00
Arnaud Baes abbfd74436 [FIX] core: ensure werkzeug request/response json
closes odoo/odoo#33682

Signed-off-by: Pierre Masereel <pim@odoo.com>
2023-05-15 15:25:56 +02:00
Victor Piryns (pivi) 0b72568bc3 [FIX] project: add index on project.task state
Adds missing index on `project.task` `state`, this field is used in
a lot of searches as a search criteria like "open tasks".

task-3416393

closes odoo/odoo#127841

X-original-commit: 147446d86d7d33a83f83a8699c930fcdd3dbb99b
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-07-10 08:56:30 +02:00
Xavier ALT 4b2106298d [FIX] sale, account_payment: fix saleman payment transactions access error
Since odoo/odoo@2b1e2abda3 user need at least 'Account / Billing'
access to read payment.transaction, that not the case for most salesman.

So for user that don't have 'Account / Billing', this commit do:

- compute the 'amount_paid' as superuser
  (fixing "Generate Payment Link" wizard access errors)

- hide "Payment Transaction" smart-button on invoice

closes odoo/odoo#127835

X-original-commit: ad2c3a873a926ac8c94d014af24ed400b493493e
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-07-10 08:56:27 +02:00
Victor Piryns (pivi) 92f030597b [FIX] sale_project: create task when confirm SO from template
Current behaviour:
When creating a new quotation from an FSM task, if we use a template
that adds a line that is a service that would have added a task on
SO confirmation, no new task is generated.

Expected behaviour:
A new task should be created, just like when we add manually the
line with service without using a quotation template.

Steps to reproduce:
- Install FSM
- Activate "Extra Quotations" from Settings
- Create a new service that generates a task on SO confirmations
- Create a new quotation template, add a line that uses the service
  we created.
- In a FSM task, click on "New Quotation"
- Add the template to the quotation and confirm it
- Observe there is no Task attached to the SO. No new task was created.

Reason for the problem:
When we create a new quotation view the action "New Quotation", we
add in the context a key `default_task_id` with the current task
that generated the quotation. When we add a template, an onchange is
triggered which creates the lines for the SO, and since we have a
`default_task_id` in the context, the related task of the new line
is set to the task we came from. This prevent subsequently the
creation of a task if the service was supposed to generate a new
task on SO confirmation.

Fix:
Add an override when generating the data used to create the lines
when the onchange is triggered, explicitly setting the `task_id` on
the line to `False` if the key is in the context and the service
would've generated a task.

Affected versions:
- 15.0
- saas-15.2
- 16.0
- saas-16.1
- saas-16.2
- saas-16.3
- master

opw-3360403

closes odoo/odoo#127811

X-original-commit: 06eeefc94f08cc01786c82b769d1c488e0e1c483
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-07-10 08:56:24 +02:00
Benoit Socias 8a750c4b44 [FIX] website: fix failing unsplash beacon test
The unsplash beacon public widget is started before the test assets JS
is loaded. Because of this, the approach in [1] fails sporadically.
If the result from the `/web_unsplash/get_app_id` RPC is obtained
before the test assets JS is loaded, the beacon patch is not applied
in time, and the test fails.

This commit applies the patch within the actual page HTML to avoid this
issue.

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

runbot-22610

closes odoo/odoo#127809

X-original-commit: 3f64135ff136addfad7c4c79e8c19cc33f8b19cf
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-07-10 08:56:22 +02:00
Christophe Monniez b94c99e3f6 [FIX] packaging: remove useless soft links
The Debian package is replacing some fonts by a soft link to the Debian
packaged ones.

The glyphicons-halfings were for bootstrap 3.x which is not used anymore
in Odoo, resulting in harmless broken links in the Debian package.

Closes odoo/docker#453

closes odoo/odoo#125840

X-original-commit: bcc681438ab3ed68a86ecbc4b38bd5384dda2b1d
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-07-10 08:56:19 +02:00
Saurabh Mishra 572a6a8257 [FIX] account: preview invoice if invoice_date not given
While creating an invoice if the user chooses a payment term with an early
discount, saves the invoice without adding invoice date and tries to
preview it or prints it, then the user will face the error.

steps to produce:
- Create an invoice without entering invoice date, with a payment term having
early discount through 'Invoicing > Customers > Invoices'.
eg: (Payment Term with early discount: 2/7 Net 30 )
- Now click on 'Preview' to preview the invoice or print the invoice report.

By following above steps you will be able to produce the error.

Error: A Traceback appears "TypeError: unsupported operand type(s) for +:
'bool' and 'relativedelta'"

sentry-4250888430

closes odoo/odoo#127791

X-original-commit: 9b20af823d3d2d8c3c70fd016d71448caa039958
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Saurabh Mishra (sami) <sami@odoo.com>
2023-07-10 07:40:49 +02:00
divy-odoo f645d28d0d [FIX] web_editor: prevent losing text-gradient class on gradient preview
Steps to reproduce:

- Drop a Title block in a webpage.
- Select text.
- Set the text color to a custom gradient. (Not the background color)
- Hover a gradient preset.
- Leave the gradient preset.
gradient color applied on the background.

In this commit,
1. Modified the condition which was blocking some mutations from being
   processed. Before this commit condition got executed successfully on an empty
   array(`excludedClasses`) too, which should not be.
2. Introduced new tests which were breaking before this commit to preventing
   them from breaking in the future.

task-3120090

closes odoo/odoo#127810

X-original-commit: 994fe756db8f1a45ef864cb7848644ea204539b7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Divyesh Vyas (divy) <divy@odoo.com>
2023-07-10 06:34:39 +02:00
Maruan Aguerdouh (magm) 66d022a4dc [FIX] web: avoid crash when deleting a property multiple times
Steps to reproduce the bug:
    - Go to Apps, and install the Knowledge App.
    - Go to Knowledge and create an article, and a child article.
    - Inside the child article, go to Properties tab and add a property.
    - Go to edit the property, and inside the popover,click on the
    delete button, atleast 2 times.
    - Now we got more than 1 popover to confirm the delete of the
    property, click delete on all of them.

Issue:
    Once the first popover is confirmed, we properly delete the property
    but now we are going to get an error because the property is already
    deleted and we won't be able to find the property to delete.

Solution:
    We need to check if we can find the property we want to delete
    before doing any further actions.

opw-3371753

closes odoo/odoo#127584

X-original-commit: 7f5aed12fb143928cc82eeeea712363cb79b1171
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2023-07-08 21:39:43 +02:00
Sven Fuehr e8dbf7a3d1 [FIX] account: fixes payment to self with early payment discount
This commit fixes a bug (corner case) concerning payments
to yourself where an early payment discount is applied.

Details / steps to reproduce the bug:
    1. Create an invoice
    2. Select your own (currently selected) company as customer
    3. Select some payment term with early payment discount (e.g. '2/7 Net 30')
    4. Confirm the invoice.
    5. Click "Register Payment" and keep the default values (i.e. "Mark as fully paid" should be selected)
    6. Click "Create Payment"
    7. A User Error like the following should appear (with different journal entry names):
       "Journal Entry Draft Entry PBNK1/2023/00001 (INV/2023/00005) is not valid. In order to proceed, the journal items must include one and only one receivable/payable account (with an exception of internal transfers)."

Why the bug happens:
The early payment discount adds some extra lines to the journal entry associated with the payment.
Currently those extra lines are classified as "counterpart lines" since the customer is our own company.
But there must be exactly 1 "counterpart line".

How the bug is fixed:
The condition that classifies the extra lines as "counterpart lines" was only intended for internal transfers.
Each company has a related "transfer account" that is used as an intermediary account for internal transfers.
Thus the old condition (c.f. commit diff) when checking whether a line is a "counterpart line"
can be replaced by checking whether the account associated with the line is the "transfer account" of our company.

task-3388294

closes odoo/odoo#127844

X-original-commit: b1536ecb6bc94a2bd5ff3bdf1b73289ca87a744d
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-07-08 16:53:21 +02:00
Alexandre Kühn 3ea1564ef9 [FIX] mail: improve follower menu vertical spacing
The "Add Followers" button felt too close to top of
menu, and the last item was to close to bottom of menu.

closes odoo/odoo#127857

X-original-commit: 1c28eab0142d5011d109955977ab99d5091f989b
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-08 13:03:51 +02:00
Alexandre Kühn 6aeb89f544 [FIX] mail: proper alignment of chatter attachment button
Before this commit, the icon and label of the attachment button
in chatter topbar was not aligned.

closes odoo/odoo#127856

X-original-commit: 3842ef84b33e1282b4f7d4d7c92b13b3f4b81b51
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-08 13:03:48 +02:00
Rinngell-Rezs 7e2d9da08d [CLA] Signed CLA for Angel Rodriguez
closes odoo/odoo#127073

X-original-commit: 69a56abb28a7ec7b3043c85585dba4c0143e1bc3
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-07-08 09:45:03 +02:00
tsm-odoo d97ff6820e [FIX] mail: fix slow follower insertion
Before this commit, follower insertion checked if a follower
was already in the thread's follower list by using
`Array.prototype.includes`. Since this method must run through
every item in the array to tell whether or not a follower is
present, it is extremly slow with large arrays (especially
since it is called for each follower).

This would slow down the tab for threads having lots of follower
(issue starts appering at 5k+ followers).

This PR solves the issue by replacing thread follower lists by
sets. With this change, inserting even 15k+ follower is almost
instantaneous since the membership test is done in O(1) instead
of O(n).

closes odoo/odoo#127833

X-original-commit: 406c91c8cba32e01eaa8df4b7fb9d0e3ad821e9c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-07 23:48:43 +02:00