Commit Graph
168937 Commits
Author SHA1 Message Date
Mylyna Hy a8bc293309 [FIX] sale_loyalty: invoice discount lines
Problem: Discount lines are not reflected on invoices when the invoice policy is set to delivered quantities. Loyalty products' invoice policy should be defaulted to invoice on ordered quantities.
Thus, if the default is set to invoice on delivered quantities for all products, loyalty products are incorrectly defaulted to invoice on delivered.
This feature was removed when loyalty programs was refactored, refer to commit: https://github.com/odoo/odoo/commit/71499bbd23c0e94ffd9b7f82f9d28a5afe045197

Solution: Initialize the loyalty product to have its invoice policy to be on ordered quantities.

Steps to Reproduce:
Navigate to Sales > Configuration > Settings > Pricing and ensure the Discounts, Loyalty & Gift Card check box is checked
Navigate to Sales > Configuration > Settings > Invoicing and set the invoicing policy to Invoice what is delivered
Navigate to Sales > Products > Discount and Loyalty
Create a new promotion that is available on Sales. Make sure the conditional rules is if minimum $50.00 spent and the rewards is 10.00% discount on your order (which should be set as the defaults)
Navigate to Sales and create a new quotation
Add a product that costs more than $50 and then click on PROMOTIONS and apply the promotion that was just created and confirm the sale order
Navigate to the delivery by clicking on the delivery smart button and click on validate
Navigate back to the sales order and click on CREATE INVOICE
Then click on CREATE AND VIEW INVOICE
You should see the issue that the promotion is not applied on the invoice

opw-3582958

closes odoo/odoo#150263

X-original-commit: 9e5b6a48473b344a530f18f1e58121b40328bff3
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2024-01-22 07:57:08 +00:00
Adnan Saiyed 33a3fa1b0f [FIX] web_editor: tablepicker size not visible
Current behaviour before commit:

In tablepicker, number of the selected cells (rows X cols)
is not visible at the bottom.

Desired behaviour after commit:

Now, number of the selected cells is visible at the bottom of
tablepicker.

task-3662728

closes odoo/odoo#150243

X-original-commit: 72aae3599c8cd81fc00b2d46a432ee20f7c44b13
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2024-01-22 07:57:07 +00:00
Benoit Socias a28054b05c [FIX] web_editor: do not paste a link if target does not support HTML
When pasting text inside the editor, if the text looks like a URL, a
link is implicitly created.
Unfortunately, this also happens when the edited element does not
support HTML.
Because of this, when translating a page, links are created inside the
translated text which does not support HTML.

This commit solves this by pasting the plain text if the target of the
paste does not support HTML (which is the case for translations).
This commit also prevent link creation when typing a space after text
that looks like an URL in targets that do not support HTML.

In saas-16.4, `_handleAutomaticLinkInsertion` is also adapted to prevent
unwanted link creation.

Steps to reproduce for first scenario:
- Add French to your website.
- Edit your master English Home page.
- Drop a Text snippet in the Home page.
- Save the Home page.
- Switch to French.
- Translate the page.
- From an external text input, copy `http://odoo.com` in your clipboard.
- Put the cursor inside the Text snippet's text.
- Paste.

=> A link was created.

Steps to reproduce for second scenario:
- Add French to your website.
- Edit your master English Home page.
- Drop a Text snippet in the Home page.
- Save the Home page.
- Switch to French.
- Translate the page.
- Put the cursor inside the Text snippet's text.
- Type `http://odoo.com` followed by a space.

=> A link was created.

opw-3546308

closes odoo/odoo#150189

X-original-commit: de351e500559166963fd2e748229d5c1d901aa44
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2024-01-22 07:57:07 +00:00
visp-odoo 68d3db616c [FIX] web_editor: unable to delete table row in firefox
Before this commit:

Attempting to delete a selected table row does not result in the removal of the
row in Firefox.

After this commit:

Now deleting a selected table row results in removal of the row in FIrefox.

task-3610789

closes odoo/odoo#150167

X-original-commit: 5dd99a02fc3cce99969e696b5cf428afaa27ba78
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2024-01-22 07:57:06 +00:00
sesn-odoo 70a4ff9000 [FIX] account: restore "outstanding" ID
Steps to reproduce
------------------
* go create an invoice for a customer that has outstanding credits.
* in the blue message at the top, click the "outstanding credits" text
  in bold.

You should see that you're taken to the home page. We expect to be taken
to the bottom of the invoice, where the outstanding credits are
displayed.

Cause
-----
A static HTML ID was mistaken for a variable in
d682871a8b.

opw-3691932

closes odoo/odoo#150153

Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2024-01-22 07:57:05 +00:00
Claire Bretton (clbr) a34599c65b [FIX] account: Reconciliation - use payment custom rate
In case of a payment we want to use the custom/accounting rate
instead of the odoo rate, as rate probably comes from the bank.

closes odoo/odoo#149937

X-original-commit: ab51ab96329ccc672eb48a68f44c4ebea008dce9
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2024-01-22 07:57:03 +00:00
Antoine (ande) 701f3a3fcc [FIX] web: report not good when exporting to pdf
Steps to reproduce:
1. Go to Settings
2. In Document Layout
3. Click on Configure Document Layout
4. Preview looks right
5. Click on Download PDF Preview
6. Open the PDF
7. Preview is not right
8. The bottom right table is squished

Cause of the issue:
Introduced by https://github.com/odoo/odoo/commit/778cc239010f3bb8618824fdaf06cb19922d6498

Fix:
Copied report_invoice_document

opw-3651311

closes odoo/odoo#150195

X-original-commit: 227c9567845ec9a592e9f265fbfcee537dd17ff5
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2024-01-22 06:47:31 +00:00
Andrea Grazioso (agr-odoo) 84ea3966ac [FIX] account: public user cannot access product with tag
Install module l10n_eu_oss_reports and website_sale
Edit a product (i.e. Acoustic Bloc Screens)
In Accounting tab add an account tag
Try to access the product webshop page as public user

User receive an error message

403: Forbidden
The page you were looking for could not be authorized.

Error message:
You are not allowed to access 'Account Tag' (account.account.tag) records.
[...]

This occurs because during tax computation the system try to access
account tags but they cannot be read by the public user

opw-3455325

closes odoo/odoo#149638

X-original-commit: 6428081e385ff08e6d4be47938e8b91abeb4246b
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-01-21 19:59:29 +00:00
Denis Ledoux ec0cd75328 [IMP] core: disable x2many manipulation as sudo for sensitive models
This revision adds a flag
`_allow_sudo_commands` to which models can opt-in
to protect themselves against malicious
manipulation of one2many or many2many fields
through an environment using `sudo` or a more priviledged user.

Flagging a model `_allow_sudo_commands = False`
disable `sudo` and `with_user(...)`
when manipulating a one2many or many2many
field targeting this model.

task-3695103
2023-11-01 08:05:16 +00:00
Thibault Delavallée 313c5c10cd [FIX] mail: do not crash when redirecting to non thread records
'_redirect_to_record' is used notably when accessing 'mail/view' controller
used notably with email notifications ('See Document' link). In order to
try to avoid multi company issues a call to '_get_mail_redirect_suggested_company'
is performed in order to find the record's preferred company.

However it is defined on 'mail.thread' which means the redirect crashes if
invoked using a non thread record. This is quite rare but may happen with
models using a mailgateway implementation similar to 'mail.thread' without
inheriting from the mixin (see 'mail.group' model added in Odoo 16).

This limitation is present since a long time but is now more present since
odoo/odoo@f4523fcd92 .

Task-3689459

closes odoo/odoo#150309

X-original-commit: 9a366dcdb789d0f160871ee4d29a463e2641ca26
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-21 14:35:30 +00:00
Odoo Translation Bot 95a4b6dfdc [I18N] Update translation terms from Transifex 2024-01-21 00:17:03 +01:00
Tiffany Chang (tic) 04e5bfe61e [I18N] gamification: ensure translation of orig motivational messages
For some reason the demo data for some of the ranking motivational
messages is different from their default motivational message (in data).
Because of the way the `translate=html_translate` works, when the demo
data was installed, the original motivational message was overwritten
and therefore not exported in the .pot file so it could never be
translated. Since we want both the demo and original messages
translated, it's best that we add the original messages into the demo
data so that it's not visible to users, but is still exported to the
.pot file.

closes odoo/odoo#150306

X-original-commit: 2f3aafe55ee39a3661477934f63b2a5c90f724a5
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2024-01-20 10:46:54 +00:00
kcv-odoo 865c08ec4d [FIX] partner_autocomplete: correct test cases to check proper conditions
This commit fixes test case to properly target auto
complete block to check auto complate feature is working
as expected or not.

task-3690532

closes odoo/odoo#150279

X-original-commit: b556b7c309530cede3577a3bfc884b1fe821537c
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
Signed-off-by: Kartik Chavda (kcv) <kcv@odoo.com>
2024-01-20 09:33:38 +00:00
kcv-odoo 6bbdd15817 [FIX] partner_autocomplete: fix quick creation issue
Before this commit auto complete suggestion were showing on partner field even though there
is no_create attribute on partner field and because of that user can create partner record
from that field even though user is not allow to create record from it and also it gives
trackback in partner portal field because of access_token.

This commit prevent auto complete suggestion when partner field has no_create attribute
set on them to avoid unnecessary partner creation from that field.

task-3690532

X-original-commit: ba2edab747db2c89d06feb9422d7f53a759766ae
Part-of: odoo/odoo#150279
2024-01-20 09:33:38 +00:00
Christophe Monniez 8b8819c494 [FIX] sale_mrp, sale_mrp_margin: deduplicate tests
By inheriting from a test class that contains test methods, these tests
are executed twice.

closes odoo/odoo#150272

X-original-commit: 835f600eac6fd1ec202cd21876457b14d3d0af06
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2024-01-20 09:33:37 +00:00
Christophe Monniez 2c16088298 [FIX] barcodes_gs1_nomenclature: deduplicate tests
When inheriting from a test class having tests methods, the tests are
played twice. In this particular case, the inheritance was not necessary
at all.

closes odoo/odoo#150287

X-original-commit: 839fa009f3f032cb45c56acfe237933bf0fb69c9
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2024-01-20 08:22:27 +00:00
Trịnh Ngọc Hưng c80fec8f15 [FIX] l10n_vn: VN account chart template use_anglo_saxon as False
- Because default use_anglo_saxon is False

closes odoo/odoo#150278

X-original-commit: fba0b2abda1fb2a101b6bfb0be93d21a2919388e
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-01-20 05:31:55 +00:00
Brice bib Bartoletti be3058bfb6 [FIX] sale: downpayment invoice and credit note
The aim of this commit is to fix the computation behavior of the downpayment
line of the sale order.

Context:
Create a sale order and invoice a down payment.
Make a credit note for the downpayment invoice for a part of the
invoice's amount.

Before the commit:
The downpayment line on the sale order gets its price_unit updated to
the amount of the last credit note.

After the commit:
The downpayment line on the sale order gets its price_unit updated to
the sum of the amount of all linked invoice.

closes odoo/odoo#150274

Task-id: 3634439
X-original-commit: 48995672ed58c99b1d8b143225a6535104d3bf8d
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2024-01-20 05:31:54 +00:00
Adrien Widart (awt) 3689958cac [FIX] stock_landed_costs: create LC in multi-comp setup
To reproduce the issue:
1. Create two companies C1, C2
2. Select C1 and enable C2
3. Confirm a PO with a FIFO product in C2
4. Process the receipt
5. Bill the PO with a landed cost
6. Generate and post the LC

Few errors will happen: on the LC, the journal used belongs to C1,
not C2. Another one: in C2, on the product's form view, the standard
price does not include the LC

OPW-3651022

closes odoo/odoo#150200

X-original-commit: 0b623378b3664d428d9146b99b3fa050d76b0e99
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2024-01-20 05:31:53 +00:00
Sébastien Theys fa9815afa7 [FIX] mail: fix chatter reaction crash before init messaging
store.self is not necessarily known when the chatter is rendered

closes odoo/odoo#150103

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2024-01-20 02:43:06 +00:00
lejeune quentin de1ff5b166 [FIX] hw_drivers: Fix default value for iot_client on boot
If an IoT doesn't have a DB recorded, the IoT client can't have an
url.
So the Websocket can't parse a empty string and return a traceback.

With this commit we check if there are a DB else iot_client is None

closes odoo/odoo#150089

Signed-off-by: Yaroslav Soroko (yaso) <yaso@odoo.com>
2024-01-20 02:43:05 +00:00
tsm-odoo cfea1ace7a [FIX] mail: fix ptt extension not working after worker wake up
The Ptt extension makes use of the `chrome.session` API to keep track
of the connected clients. Before this PR, the session storage was
initialized at the top level of the background script. This is an
issue since it will be executed after the service worker wake up thus
overwriting the existing client map. This PR removes this

closes odoo/odoo#150084

Initialization: the map will be created when needed instead.
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2024-01-20 02:43:04 +00:00
Xavier Bol (xbo) 2ddc00f9af [FIX] web: display "Remove Cover Image" button
Before this commit, when a kanban card has cover image set and the user
would like to remove it, he does not have the "Remove Cover Image"
button displayed when he goes to KanbanCoverImageDialog. The reason
is because the condition on `t-if` set on that button is always
falsy because `coverId` is undefined in the component.

This commit defines getter called `hasCoverImage` to return true
if the record displayed in the kanban card has cover image set.

task-3623759

closes odoo/odoo#150033

X-original-commit: c5d1894804c590dec208755e93d21f249714721d
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-20 02:43:00 +00:00
mjvi-odoo db05ddcf10 [FIX] web: 'upload and Set' button not functional in project task cover image
Steps to Reproduce:

Navigate to Project.task kanban view.
- Attempt to set a cover image.
- Observe the non-functional 'upload and set' button.

Issue:
- The 'upload and set' button in the Project Task Cover Image is unable to click

Solution:
- Resolved the issue, ensuring the 'upload and set' button functions correctly
  for a seamless cover image setting in Project Task.

task-3623759

X-original-commit: fc531640dedf7c8a576ed43d8e27a0c1054ec512
Part-of: odoo/odoo#150033
2024-01-20 02:43:00 +00:00
Christophe Monniez e4dc9a32db [FIX] mrp_account, stock_account: deduplicate tests
When a test case class inherits from another class that has test
methods, those tests are executed again for both classes.

While it could be done on purpose, it does not seems to be the case
here. Moreover, in this particular case, we are talking about 51 tests.
Also, as the child class is tagged `post_install` those tests are run
again on runbot in a post install build.

closes odoo/odoo#150028

X-original-commit: ee747ae5c68871d58647a263d54bb658ef43eece
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2024-01-20 02:42:59 +00:00
Nicolas Viseur (vin) 74d7ad5185 [IMP] l10n_au: Update 100% EX Taxes
The computation of such taxes were wrong, thus we
update the tax template to correct the computation
and the tax tags.

Task id # 3645628

closes odoo/odoo#149978

X-original-commit: 4fb468be5b40a4eb426dee293526ef48eb826e15
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-01-20 02:42:58 +00:00
Xavier Bol (xbo) 58b8b5c56f [FIX] project: use new field open_task_count to display open tasks in project
Before this commit, when the task_count is too huge, the number of
open tasks displayed in each kanban card of project returns `NaN` value
the reason is because, for instance, the number is 1026 and using `value`
will format the value and return `NaN` when the soustraction is made
between 2 numbers formatted (task_count - closed_task_count).

This commit introduces a new field called `open_task_count` to get
the number of open tasks and use it in the kanban instead of doing
the soustraction between `task_count` and `closed_task_count` fields
since we cannot really format the result.

closes odoo/odoo#149637

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-20 02:42:55 +00:00
Alexandre Kühn 9b3a0b4aa0 [FIX] mail: no crash on edit message in mobile
Before this commit, editing a message in message in a conversation
and then pressing on the paper plane icon was throwing the following
error:

```
TypeError: null is not an object (evaluating 'thread.model')
@_sendMessage
```

This happens because this button was in "send" message mode rather
than in edit mode. Since we cannot post a message while editing a
message, the crash happens because composer is not related to thread
but the message.

This button is not visible in desktop mode, and user should use
suggested keyboard shortcuts or click on links to either save edit or
discard it. In mobile, these interactions are not intuitive.

This commit fixes the issue by keeping the paper-plane button while
editing in mobile but it acts as "save". The labels to save/discard
was not appropriate in mobile, so it has been turned to a simple
button to discard editing.

opw-3670482

closes odoo/odoo#148918

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2024-01-20 02:42:54 +00:00
Martin Trigaux 6f4dad6f28 [FIX] website_slides: do not subscribe portal user
Everytime somebody leaves a review, it sends a message to every
follower of the subtype "Discussion". Portal users were subscribed
without realising it.

Issue 1:
When subscribing via the controller, a user was subscribed to the
"Discussion" subtype instead of "Presentation Published".

Issue 2:
When requesting access, if there is no responsible for a channel, the
activity_schedule method fallback on the current user (portal) and
subscribe him to the channel at the same time.
If there is no responsible, there is nobody to request access to.
Disable the o_wslides_js_channel_enroll to hide the request access
popup and skip the activity_schedule if the method was called anyway
(i.e. fix for stable without updating the view)

DELETE FROM mail_followers_mail_message_subtype_rel r
 USING mail_followers f,
       res_users u
 WHERE u.partner_id=f.partner_id
   AND r.mail_followers_id=f.id
   AND r.mail_message_subtype_id=1
   AND f.res_model = 'slide.channel'
   AND u.share = true;

closes odoo/odoo#145742

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-20 02:42:51 +00:00
remi-filamentandFlorian Gilbert 2ecbfdb363 [IMP] account,*: new method in ir_action_report returning if invoice
*: account_edi, l10n_ch

closes odoo/odoo#149810

X-original-commit: 9dae0a06a1f77355ed1cdf7a605d085e640b974c
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Co-authored-by: Florian Gilbert <flg@odoo.com>
2024-01-20 00:29:56 +00:00
tsm-odoo 4380131b52 [FIX] mail: fix non deterministic retry loading messages test
Before this PR, the "Retry loading more messages on failed load more
messages" test was sometimes failing. This test uses the `afterEvent`
helper to wait for the load message event to occur. This is too
technical and not reliable: this test just ensures that clicking on
the retry button after failing to load more messages work as expected.
This PR simplify this test and make use of the `contains` helper which
is more reliable to do so. First, 30 messages are loaded, then the
retry button appears and finally, clicking on the retry button should
load 30 more messages for a total of 60.

fixes runbot-53201

closes odoo/odoo#150012

X-original-commit: 6c1f3f0a24913484042148b7101ec6a628d5b8be
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2024-01-19 23:00:54 +00:00
Mahamadasif Ansari 7842deecd1 [FIX] mass_mailing, website: add markup in tour content
Current behavior before PR:
  - HTML tags are displayed in the onboarding tour.

Desired behavior after PR is merged:
  - Display the HTML tag effects instead of showing it in the onboarding tour.

After the https://github.com/odoo/odoo/pull/107618 web_tour was converted into
Owl, 'markup' was required to show the html tag effect instead of htm tags.

Related Enterprise PR-https://github.com/odoo/enterprise/pull/53893

Task-3457112

closes odoo/odoo#149957

X-original-commit: c26ba2943317e82388bc05adfd64fa729923a86b
Related: odoo/enterprise#54622
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-19 21:25:47 +00:00
Louis (wil) 34b81203da [FIX] sale: make "Down payment invoice" translatable
Nested gettexts aren't exported. This commit solves the problem by
moving the inner gettext outside of the arguments of the first gettext.

closes odoo/odoo#149921

Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2024-01-19 21:25:46 +00:00
Ruben Gomes (rugo) a819d7190c [IMP] odoo.tools: add tests to formatLang()
Tests the method formatLang() to be able to do safe(r) refactoring in future versions.

closes odoo/odoo#149775

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-01-19 19:10:54 +00:00
Michael (mcm) 178e28b467 [FIX] web: batch position updates
Before this commit, a component that uses the `usePosition` hook could
trigger multiple position update in the same tick and the update would
be call as much as it was called.
In this commit, the hook batches the calls to the update to call it
once.

closes odoo/odoo#149655

Task-id: 3673493
X-original-commit: 12fbf33aca2e9efafbb94337d9c3b538779d9f6c
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2024-01-19 19:10:53 +00:00
Michael (mcm) 86d00f1053 [FIX] web: fix searchbar menu position
Before this commit, the searchbar menu was misplaced after opening the advanced search dialog.
After this commit, the searchbar menu is always at the correct position.

Task-id: 3673493
X-original-commit: 19d40f48fb98b28b7fd49b79581ac0ac5fcecc87
Part-of: odoo/odoo#149655
2024-01-19 19:10:53 +00:00
Josse Colpaert 6628d2b4e7 [FIX] l10n_es_edi_tbai: FechaOperacion should be set when the invoice date is different than today
closes odoo/odoo#149538

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-01-19 15:21:50 +00:00
Josse Colpaert 07d2cea85d [FIX] l10n_es_edi_tbai: in the newer versions of Ticketbai we can have 8 decimals
opw-3685542

Part-of: odoo/odoo#149538
2024-01-19 15:21:50 +00:00
Abdelouahab (abla) 1acd0b6c5d [FIX] hr_attendance: fix checkin/checkout on iOS
To reproduce
============
- With hr_attendance installed on ios application
- click on small button (green/red) to checkin/checkout
- nothing happens

Problem
=======
the method `signInOut` is failling because `navigator.geolocation` is
not defined on iOS

Solution
========
check if `navigator.geolocation` is defined before using it

opw-3649654

closes odoo/odoo#149518

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-01-19 15:21:49 +00:00
amdi-odoo f232abd716 [FIX] web: fix percentpie value rounding
Fix the rounding of the percentpie field value as it was sometimes
displaying a very long number due to python rounding precision.
The value is now displayed rounded to 2 decimals without trailing zeros.

Task-3648755

closes odoo/odoo#149226

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-19 15:21:47 +00:00
Lucas Perais e7a511b7b5 [FIX] web: nested subviews pieces do not pollute main view
Have a nested (2 levels) form view with a footer.
On the main view, add a record in the one2many in form view (dialog).

Before this commit, the footer of the nested one2many form (within the dialog) was
put inside the footer of the dialog, which is wrong, as the footer originates
from a subview, hence has nothing to do with its parent.

After this commit, each subview's part that should be rendered elsewhere than
in the main formRenderer doesn't pollute the main view.

opw-3681966

closes odoo/odoo#150010

X-original-commit: 4891753cc3ef1a6a1daa36ecd70e79e7410e9bb0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2024-01-19 13:13:55 +00:00
guva-odoo 461ac4cb3a [FIX] analytic: all accounts count wrong on sub plans
When having an analytic plan with subplans, with analytic
accounts on each, the all accounts count is not well computed
on the subplans.

opw-3677889

closes odoo/odoo#149898

Signed-off-by: William André (wan) <wan@odoo.com>
2024-01-19 13:13:53 +00:00
fkantelberg 988d228830 [FIX] hr_holidays: fix read access error when a normal user writes on leave
Description of the issue:
When a user without rights on time off writes to a previously created hr.leave an access
error is raised because of reading employee_ids. This happens becausethe field is
restricted to the group hr_holidays.group_hr_holidays_user and it's used in _check_date.
To prevent this all_employee_ids should be used because of the compute_sudo set.

Current behavior before PR:
Access error on save

Desired behavior after PR is merged:
No access error on save

closes odoo/odoo#149308

X-original-commit: 10d3d0b43fbb336d823cec9e68b68651298678cd
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-01-19 11:40:35 +00:00
Paul Stroobant 94052e51ac [FIX] website_forum: reintroduce last post in forums front page
Steps to reproduce:

1. Create multiple forums
2. Click on edit in Forums front page
3. Toggle Last Post button
4. No Last Post is shown

Explanation:

The Last Post element was removed from the `forum_all_all_entries` template in *v16.4*.

Fix:

Recreate the Last Post, mixing the behaviour and look of *v16.3* (clickable title, truncated text) and the look of *v16.4* (badge with dark background).
The `<object>` tag wraps the inner `<a>` tag to avoid nested links issues.

opw-3558730

closes odoo/odoo#149993

X-original-commit: 105442a33725e1179f3b5f8955aa4fc6a6c9d638
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
2024-01-19 09:15:29 +00:00
mebe-odoo b1461d2879 [FIX] l10n_sa_edi: fix access issues for non-admins
Currently, when a user that is not part of the 'base.group_system' group, they are unable to submit invoices to ZATCA and print B2B invoices since the QR code requires the use of the l10n_sa_production_csid_json fields. To fix this, we mark the l10n_sa_qr_code_str as compute_sudo=True and use sudo when we try to sign XML before submission to ZATCA

 X-original-commit: ddeb47e8fd0ed8385492d50cc0d8c30b631bfb21

closes odoo/odoo#149979

X-original-commit: 84224f7bb6ba28228351fc86eeb24e054622f9d6
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-19 07:59:48 +00:00
Alexandre Kühn 8b5f8dea8b [FIX] mail: open chat window from home menu reliably
Before this commit, opening chat window from messaging menu
might not work.

Step to reproduce:
- open Discuss app
- Go to home menu
- Reload the page
- Click on Messaging Menu
- Click on chat item to open chat
=> Chat window is not open

This happens because when in the home menu from Discuss app
in background page reload, the URL contains the Discuss app
menu_id, but the action is "menu" rather the action id. This
difference is crucial to distinct discuss app being actively
open or it's in the background from home menu. The latter
should NOT consider Discuss app being open.

This is not a problem when opening/closing Discuss app, because
the mounting/unmounting of the Discuss app component is good
enough to detect that. However, with page reload, the way to
detect Discuss app being open from URL was only relying on `menu_id`
instead of `action` value.

This commit fixes the issue by checking `active_id` of discuss app
rather than `menu_id`, as `active_id` is 100% reliable whereas
`menu_id` is not. The problem with home menu is one example among
many other cases (e.g. page reload in channel settings form view).

closes odoo/odoo#149969

Related: odoo/enterprise#54638
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2024-01-19 05:20:52 +00:00
luvi c1d250fcbc [FIX] web, *: show a dismiss button in the PWA notification
*: mail

This commit fixes the behavior of the notification to install the PWA.
The initial spec was not completely achieved, since the 'Dismiss' button,
using the fa-close icon was not present. See task-3275275.

Now, the button is present, and it can hide the notification and the user don't
need to interact with the installation prompt to dismiss it.

The fix also fixes the behavior of the notification when being used in
an incognito tab. The installPrompt service assumed the PWA could be
installed, since window.BeforeInstallPromptEvent is defined. But in an
incognito scenario, the event was never actually triggered, since the
feature is disabled by the browser.

This could finally create a UX issue if the app had been installed, and the
localStorage cleaned. The notification would appear, but wouldn't do anything
when clicking on the Install button since the event is no longer triggered by
the browser. Now, we rely on the trigger of the event exclusively, except on
Safari, where we rely on the installationState and the standalone display-mode.

Now, the service only set its state when the event has effectivelly been
triggered and the native prompt can be called. Since the UI relies on the
state from the service, the notification is no longer shown.

Tests have been adapted, to dispatch a custom event, allowing the service to be
initialized as if it was in a situation where the PWA can be installed effectively.
A new test have been added to verify the interaction with the close icon.

closes odoo/odoo#149961

Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2024-01-19 01:36:10 +00:00
tsm-odoo 13f4d046f7 [FIX] mail: update html fields according to html insert option
Since [1], the `insert` method accepts the `html` option to
automatically cast record fields marked as `html` to markup. Before
this PR, this option was ignored after the first insertion if the
field value remained the same.

Steps to reproduce this issue:
- Insert a message without passing the `html` option: the body field is
an instance of string.
- Insert the same message setting the `html` option to true: the body
field of the message is still an instance of string while it should be
an instance of markup.

This PR fixes this issue.

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

closes odoo/odoo#149953

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2024-01-19 01:36:09 +00:00
Alexandre Kühn c22fa19636 [FIX] mail: new message notif on channel only with needaction
Before this commit, any new message in a channel of type "channel"
was automatically opening a chat window and showing new message
counter in tab title when out-of-focus.

This behaviour is only intended for important messages. In chat
(group chat, DM chat, livechat), all new messages are considered
as important so this is good. However, for channels, these are
intended for communication with many users, and we only want to
notify on messages that are explicitly flagged as "needaction".
As a reminder, message are needaction through `@mention` or
reply-to for example.

This commit fixes the issue by limiting notifying out-of-focus of
new messages in channel "channel" to only needaction. Also the
auto-opening of chat window as a consequence from this new message
is also limited to needaction messages.

closes odoo/odoo#149943

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-01-19 01:36:08 +00:00
Daniel Blanco 09016beb99 [FIX] l10n_cl: fix terms in english that are wrongly defined
[I18N] l10n_cl: fix origin for translation terms

closes odoo/odoo#147528

Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-19 01:36:07 +00:00