Commit Graph
168189 Commits
Author SHA1 Message Date
Gauthier Wala (gawa) 480dfc1538 [FIX] base_import_module: fix test sql import
The test tries to import data from an sql file.
The problem is that it is trying to import partners, but when
the test is ran with the l10n_co localization, one of the required
field is not filled.

We just change the model to import to avoid the issue with the
missing required field.

Linked to runbot error 32740, 32742, 32745, 32738

closes odoo/odoo#145708

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-12-12 17:03:40 +00:00
Pedram (PEBR) fa3c7757e3 [FIX] pos_hr_mobile, point_of_sale: fix "Scan your badge" option
The "Scan your badge" login option was not working properly when trying
to log in to the POS shop.

The barcode scanner styles were missing which caused the issue.

opw-3608077

closes odoo/odoo#145627

X-original-commit: 075fd9f7408aaced3beb6b50b5bf5d28472956e7
Related: odoo/enterprise#52464
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-12 17:03:38 +00:00
roen-odoo 8df48f15e6 [FIX] point_of_sale: fix firefox customer display
Current behavior:
Firefox customer display was not correctly loading the CSS and the display was not correct.

Steps to reproduce:
- Setup an IoT box with a customer display
- Open the IoT box customer display in Firefox
- Link the customer display to a POS
- Open the POS and add some products to the order
- The customer display is not correctly displayed

opw-3509606

closes odoo/odoo#145839

X-original-commit: 3bebc6caaccb08cc8f856b42bd635fafc9a1c4a2
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-12-12 14:05:10 +00:00
Julien Carion (juca) e124696722 [FIX] mail: replace overlapping shortcut in activity dialog
This commit simply replaces the shortcut for the action_done_schedule_next
buttons from alt+q to alt+z in the activity view dialog because the alt+q
shortcut is already used for the Save/Schedule buttons. This overlap was
introduced by mistake in https://github.com/odoo/odoo/commit/6c412be2ea7c0fb64677152db753a1007934f892

opw-3565747

closes odoo/odoo#145838

X-original-commit: c2a0db9ce18c00a17fd93f87434d3d3a7a2630fe
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2023-12-12 14:05:08 +00:00
Dhrumil Shah c2d92ecfc5 [FIX] product: use same default picture than product.template
Before this commit, the default picture (when no picture is set to a product) has been
changed for `product.template` but not for `product.product` in commit 0625434

This commit also applies the changes in `product.product` to have the same default
picture than `product.template` when there is no picture set on the product.

task-3484150

closes odoo/odoo#145831

X-original-commit: 40ee98e7b96bbd7d92f1bc085389e98fb43fd8d1
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-12 14:05:07 +00:00
Abdelouahab (abla) 3947fb81fa [FIX] web: toggler button must remain visible
To reproduce
============
- go on any record with list view (for example a Quotation)
- Check many hidden fields in the list view to show them
- The dialogue box for checking and unchecking hidden fields moves
with the horizontal scrollbar, sometimes even going off screen.

Problem
=======
the position of the dropdown menu is computed using the position of the toggler
butoon, so if this button moves the menu moves with it

Solution
========
make the toggler button sticky so it's always visible and the dropdawn menu
will keep same position.

opw-3589726

closes odoo/odoo#145784

X-original-commit: 6fb2619866893b47c8cb947a40f3457625960a5c
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2023-12-12 14:05:03 +00:00
Josse Colpaert bd3bb50e5a [FIX] l10n_ec: put back the Spanish names for Ecuador partners
As we send the name of those partners in the XML
for the EDI and in the XML and the correspondance
of that name with the VAT number (RUC) is checked,
we need to keep the original name.

See https://github.com/odoo/odoo/commit/10f9460d2b744a2a135969cd6703f89a3439b923#diff-c58ef9acd83f5647980e035ced040bd699ad3fdaf9a150ca48c4db7a95e86e5aR5
Also translating partners does not make any sense
as the field is not translatable.

See issue https://github.com/odoo/odoo/issues/145698

closes odoo/odoo#145780

Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-12-12 14:05:02 +00:00
Antoine (ande) d3487fad36 [FIX] website_sale: sale ribbons disappearing
Current behaviour:
When removing the ribbon from a product,
the other ribbons are removed as well.

Steps to reproduce:
1. Go to website
2. Go to Shop
3. Click on Edit (top right)
4. Add a ribbon to multiple products
5. Click on Save
6. Select a product with a ribbon
7. Remove the ribbon
8. (other ribbons are gone)

Cause of the issue:
Reverting fix introduced by https://github.com/odoo/odoo/commit/5d13fa522e7d06b03a098ada5fa6be15ddc49618
t-out was modified into t-field to be considered dirty when modified.
but when removing a ribbon, t-field is set as empty,
which overwrites ribbons html value.

opw-3487397

closes odoo/odoo#145864

X-original-commit: 71bdf1f674d0340a726dba96c65af6fdff25822f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-12-12 10:34:48 +00:00
Mattis Megevand (mmeg) ae9efe2a17 [FIX] web: match preview of invoice and its report
Steps to reproduce:
- Make an invoice and setup the layout of the document
- A preview will be displayed
- Make the invoice and download it

Issues:
The layout of the preview and the invoice doesn't match the updated layout from commit 3764914c86.

Solution:
Correct the view of the report templates.

opw-3584286

closes odoo/odoo#145815

X-original-commit: 778cc239010f3bb8618824fdaf06cb19922d6498
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-12-12 10:34:47 +00:00
AH-Yussef 31c7a2ff90 [FIX] account: format transfer source containing %
Steps to reproduce:
- Install Accounting app
- Go to the Accounting app
- Go to Configuration > Chart of Accounts and create a New account with a name containing %
- Go to Accounting > Journal Items
- Select a Jounral item and from Actions, choose move to Account
- In the popup displayed, choose the new account created ealier in the To field, and choose a Journal
- Click `Create Journal Entries`, an error arises

Invistigation:
When the `account_target_name` contains a % literal (ex. "test %"), the `transfer_format` beccomes `"{amount} ({debit_credit}) from %s were transferred to <strong>test %</strong> by {link}"` https://github.com/odoo/odoo/blob/a56586119845969e9d867a220f5330a6c7daa5c2/addons/account/wizard/account_automatic_entry_wizard.py#L429-

- You can notice that now the string has two % placeholders that need two be substituted, but only argument is provided which is `account.display_name` and so we get a the error `TypeError: not enough arguments for format string` https://github.com/odoo/odoo/blob/a56586119845969e9d867a220f5330a6c7daa5c2/addons/account/wizard/account_automatic_entry_wizard.py#L433

opw-3601886

closes odoo/odoo#145762

X-original-commit: 1582a0ae28fec12175845dcfdebbb8d6b4bcde33
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
2023-12-12 10:34:46 +00:00
AH-Yussef 230b680bf9 [FIX] website_sale: add message to translation
Steps to reproduce:
- install the e-commerce module
- in General settings, add and switch French -or any- language
- Go to website
- Under e-commerce > product in the menu bar
- click on any product
- click on go to website smart button
- click on edit button to edit the website page
- choose any block to insert, You can notice the message (DROP BUILDING BLOCKS HERE TO MAKE THEM AVAILABLE ACROSS ALL PRODUCTS) stays in English

Investigation
- The message is not add to website_sale.pot file, as the message string passed to an attribute not an actual string inside a tag.

opw-3573881

closes odoo/odoo#145755

X-original-commit: 9a595cd19fba3a68dacd5159d0b04102bc76cadf
Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
2023-12-12 07:31:11 +00:00
Benjamin Hanquin (beha) 642bd48f38 [PERF] account: Add index on partner_id in AM
Issue:
The _predicted_field is still slow after refactor.

Analyze:
Due to the refactor of the query made in account_move.py
_predicted_field, an index is needed on partner_id.

Fix:
Add an index on partner_id Many2One.

Note:
The previous PR has already been merged
https://github.com/odoo/enterprise/pull/50911 but without the index it
is not as fast as expected. This index had been added by
hand.

Benchmark:
| # Input data | Before PR | After PR |
|:-------------:|:----------:|:---------:|
|   30M                |    22.827 s            |     18.59 ms|

Related task:
opw-3539632

closes odoo/odoo#145836

X-original-commit: 50ecb11320c739f734641cf912902f5620dd891d
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Benjamin Hanquin (beha) <beha@odoo.com>
2023-12-11 18:30:48 +00:00
Brice bib Bartoletti 73a313a0fa [FIX] account_edi_ubl_cii: test_import_tax_prediction
The aim of this commit is to fix runbot build error.

Before the commit:
The test could fail if the EUR currency was inactive

After the commit:
The test activate the currency first

closes odoo/odoo#145817

Runbot-error-build: 51509
X-original-commit: 09808f2c91985263090cb9bd38b34d3443a2d7d7
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-12-11 18:30:47 +00:00
Simone Rubino 23265db848 [FIX] product: Typo in min_quantity and min_qty accuracy
The accuracy "Product Unit Of Measure" does not exist, it is "Product Unit of Measure"

closes odoo/odoo#145805

X-original-commit: 8a8a3720bf2ed938dddc1c5889b4207562381234
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-12-11 18:30:46 +00:00
Bastien Fafchamps (bafa) d5986fb9d9 [FIX] web: Fix readonly modifier not working with clickable option on statusbar field
Before this commit:
The readonly readonly modifier of the statusbar field was not taken into
account when the "clickable" option was set.

After this commit:
Even if the "clickable" option is set to true, if a readonly modifier is
set, it will prevent (or not) changing the stage of a status bar.

closes odoo/odoo#145766

Opw: 3222998
X-original-commit: 9e1d01bc44e5e90ed2b809cfadbd05a5793b3c07
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
2023-12-11 18:30:45 +00:00
Kartik Chavda (kcv) 6c7621a10b [FIX] hr_timesheet: fix creation options
Steps:
- Install timesheet_grid.
- Start the timer.
- Try to add new task without selecting project.

Issue:
- We can create a new task and afterwards the task would have the projects as
private.

Fix:
- We are taking the canCreateEdit option from props.

task-3378532

closes odoo/odoo#145760

X-original-commit: a92d7d5a92d84074e1d4b0511051c906953c5003
Related: odoo/enterprise#52518
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-11 17:21:21 +00:00
duongnguyen-viindoo 48633d2ceb [IMP] hr_expense: Team approver should not have full access to journal
Currently Team Expense Approver have full access to journal, we
shouldn't do that

closes odoo/odoo#145737

X-original-commit: 9078b6cf4770c8b3b42bde8e36c4eff5f924c7bd
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-12-11 17:21:17 +00:00
Walid 4bddcb8c92 [FIX] purchase: Average cost report rounding
Steps to reproduce:
- Decimal Accuracy for Product Price > 4 digits
- Purchase a product using a price (1.2345 in my example)
- Go to Purchase > Reporting
- Enable the List View
- Add the field Average Cost (price_average)
- This displays as just two decimals

Note:
can be edited with studio but you can just add the field "price_average"
to the "purchase_report_view_tree" view xml

Fix:
round using product price Accuracy

opw-3560792

closes odoo/odoo#145667

X-original-commit: d5a3430cecb673a06057673d0671228449fa3f60
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-12-11 17:21:15 +00:00
Pedram (PEBR) ca94faef82 [FIX] pos_loyalty: ensure customer name prints without points activity
Since the update in https://github.com/odoo/odoo/commit/d4b366f2d741f2087a947d61d7e0618492cc2bf1, the POS loyalty program stopped
printing customer names on receipts for transactions without points won
or spent. Originally, printing a loyalty program also included the
customer's name, which users relied on to print the customer's name
on receipts.

This commit ensures the customer's name is printed on the receipt,
regardless of whether any loyalty points were won or spent.

opw-3620536

closes odoo/odoo#145629

X-original-commit: 57037253a472b4a25e2be6622c505a08b7f207ff
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-11 17:21:14 +00:00
Samuel Degueldre 07fd47ab0b [IMP] web: update owl from 2.2.6 to 2.2.7
Release notes:
https://github.com/odoo/owl/releases

Commits:
- [IMP] types: correctly support Function type for props-validation
- [IMP] app: allow to instantiate templates lazily
- [FIX] compiler: compile named slot in t-component in named slot
- [IMP] devtools: update the devtools documentation
- [IMP] owl-vision: syntax scripts, single quotes attributes and slot props highlight and switch below command
- [IMP] doc: improve documentation of useExternalListener
- [FIX] devtools: remove highlights when out of devtools
- [IMP] devtools: highlight component on select
- [ADD] owl-vision: vscode extension initial commit

closes odoo/odoo#145460

Forward-port-of: odoo/odoo#145342
Forward-port-of: odoo/odoo#145236
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-12-11 17:21:12 +00:00
Yosua Nicolaus 8f10363495 [FIX] account: unaccessible parent's account on product form
If the current company is a branch and we're in the product form, we
will not be able to access our parent's account in the following fields:

- `property_account_income_categ_id`
- `property_account_expense_categ_id`
- `property_account_income_id`
- `property_account_expense_id`

This commit aims to fix that behavior by updating the domain to consider
branch companies too

closes odoo/odoo#145355

Task-id: 3549961
Related: odoo/enterprise#52299
Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-11 17:21:10 +00:00
Yosua Nicolaus 201371954d [IMP] web: string domain function handler
When getting a domain from activeFields in Owl, sometimes the value
passed is not a list or function.

When the field mentioned have a `check_company=True` in the
initialization, the domain passed will be in a form of string instead of
a list.

This commit aims to publicize the domain handler in Field so that it can
be used anywhere by calling the function, as getting field's domain is
getting increasingly common

Task-id: 3549961
Part-of: odoo/odoo#145355
2023-12-11 17:21:10 +00:00
Pedram (PEBR) a351b73b93 [FIX] point_of_sale: capture orders with the same reference
Before this commit, if a new order was created with an existing
pos_reference, it would not be captured even though it was a completely
new order. This occurred because pos_reference was assumed to be unique.

However, there have been several customer reports of orders not being
captured when the receipt contains a pos_reference that already exists.
Some bugs causing duplicate pos_references were found but the root cause
remains unclear.

With this commit, orders are now synced even if pos_reference matches a
previous order. This prevents lost orders and allows customers to access
all their receipts via pos_reference lookup.

An investigation into the cause of duplicate pos_references needs to
continue, but this change unblocks the more serious issue of missing
orders.

opw-3499011

closes odoo/odoo#139974

X-original-commit: 269702891980eb56ddc83e199a9673b1e146d348
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-11 17:21:07 +00:00
Serge Bayet (seba) c2ad20fc93 [FIX] web: support color functional CSS notation
This commit enables support for functional color notation in CSS
(https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color).

This new feature accommodates various color spaces utilized within the
'color()' CSS function, seamlessly converting them into an RGBA format
that is comprehensible to the right panel.

Steps to reproduce:
- Enter edit mode
- Add a snippet with a column
- Click on the column
- Set border-width to 5px, enter
=> A gray border appears but the option colorpicker shows no color

Since [this commit] the border has as default opacity of 15%. But now
the custom color in the colorpicker is correctly set.

[this commit]: https://github.com/odoo/odoo/commit/fad514ebdc25b9de03fd387a0c07dbbc274c364e

task-3536051

closes odoo/odoo#137698

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-12-11 17:21:05 +00:00
Claire Bretton (clbr) 4996c70cbd [FIX] account: remove dead code from Send & Print wizard
In Send & Print refactoring : part 1
(https://github.com/odoo/odoo/commit/33625269062d50e52fe2e0d8cf4a6df788e93062)
we changed the wizard back to a transient model, making the special handling
of the cancel useless therefore the custom form is now irrelevant.

closes odoo/odoo#145717

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-12-11 16:05:45 +00:00
Pedram (PEBR) a49fae62ac [FIX] point_of_sale: exclude internal reference in loaded products
Previously, products loaded from the background included the internal
reference in their displayed name. This behavior was due to the
'display_default_code' context, which prevents the inclusion of
'default_code' in the product name, not being utilized within the
'get_pos_ui_product_product_by_params' function.

opw-3617195

closes odoo/odoo#145644

X-original-commit: b6c87e4c3451fbb554557be95788c8e1a5e0332f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-11 14:46:53 +00:00
Antoine Dupuis (andu) 4938d48d68 [FIX] l10n_it: VAT report: corrections to tax repartition lines
- refund tax repartition lines lack tax grids -> added
- Outgoing credit notes lack base line grids -> should decrease total
  active transactions -> added.
- Purchase taxes 0% G and 0% S should increase total passive
  transactions, not increase total active transactions -> fixed

closes odoo/odoo#145636

Taskid: 3175384
X-original-commit: 114a3e3c1587a057da96d4148d61416cfd434dac
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
2023-12-11 14:46:52 +00:00
Mahdi Cheikh Rouhou (macr) 8891e6a957 [FIX] calendar: send attachment with calendar event invitation mail
Issue:
======
Attachment files aren't sent with the event invitation email.

Steps to reproduce the issue:
=============================
- Add any attachment to the email template : `Calendar: Meeting
  Invitation` and save it.
- Go to website and book an appointment.
- Go to Scheduled Actions  and run manually email queue manager to send
  the notification.
- The sent email doesn't have the attachement you provided, it has only
  1 attachement which is the calendar one.

Origin of the issue:
====================
The notification of the event invitation was taking only the calendar as
attachment and ignores the template attachemnt.

Solution:
==========
Now the calendar event invitation email will take into account the
attachment of the email_template.

opw-3593140

closes odoo/odoo#145628

X-original-commit: 28880c32e62b6e2e6c87c35094da0e20c6c14c21
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-12-11 12:36:59 +00:00
Louis (loti) d91be06b81 [IMP] sale: allow batch removal of discounts
This change allows to remove discounts from all sale order lines at once, by enabling 0% discounts in the discount wizard.

task-3584450

closes odoo/odoo#144244

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-12-11 12:36:58 +00:00
Thomas Lefebvre (thle) d8944533e3 [FIX] website: prevent default submit
Steps to reproduce:
-------------------
- on ecommerce, activate "Extra Info" feature;
- go to the extra info form;
- write something for "Your Reference";
- press Enter.

Issue:
------
The Bad Request message is displayed.

Cause:
------
Pressing Enter triggers the form's default submit.
To use the controller of the `/website/form/shop.sale.order` route,
we need to apply the JS logic of the `s_website_form`
widget (the `send` function).

Solution:
---------
Add an event for the `submit` which will prevent
the default behaviour and send the form data.

opw-3591135

closes odoo/odoo#145707

X-original-commit: 14fc7f3c923847f5e052888c2cfda0bf92316972
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-12-11 09:56:54 +00:00
Andrea Grazioso (agr-odoo) 1f8880831b [FIX] account: epd missing in credit note
In Accounting settings set 'Cash Discount Tax Reduction' to Always
Create an invoice
Add a line with tax
Add as payment terms "2/7 Net 30"
Confirm
Click "Add a credit note" and create the credit note
Confirm

Issue: Credit note is missing the epd vals from the invocie so the moves
cannot fully reconcile

opw-3429678

closes odoo/odoo#145653

X-original-commit: f7b371be24a842392a8b46f337256ef13bf8a5ae
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2023-12-11 09:56:53 +00:00
Antoine (ande) 3e66c037b9 [FIX] mrp: availability if bom type is not kit
Current behaviour:
When checking the overview of a normal BoM,
the product is available if component is in stock

Expected behaviour:
The product should not be available unless BoM type is kit

Steps to reproduce:
1. Go to Manufacturing
2. Go to Products > Bills of Materials
3. Create a new BoM
4. Product: p1 (and create product p1)
5. Component: p2 (and create product p2)
6. BoM type: Manufacture this product (normal)
7. Save the BoM
8. Click on Overview
9. p1 and p2 are not available (Normal behavior)
10. Go to the p2 product page
11. Click on Update Quantity > new quantity > Apply all
12. Go back to the p1 BoM
13. Click on Overview
14. p1 and p2 are available
15. p1 should only be available if BoM type is kit

Cause of the issue:
Caused by https://github.com/odoo/odoo/commit/f13b4d1ae8c12a1668222e6994dea26a27c6f5d4

opw-3601298

closes odoo/odoo#145598

X-original-commit: f34d5ef9dd2d1ad0c0acaa6a40c8ab7c517fc75d
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2023-12-11 09:56:52 +00:00
Claire Bretton (clbr) c52d60dd56 [FIX] l10n_ch: tax report - fixes
Applied fixes:
- a lot of translations were outdated, not matching official ones
- box 205 was missing
- box 289 had translation of missing box 205
- box 200 had translation of the section
- boxes 381a and 381b removed, completely outdated: we already removed all other 3X1 boxes.
- boxes 200,299,479 had wrong computation
- reordering lines to match the report

Source: https://www.estv.admin.ch/estv/fr/accueil/taxe-sur-la-valeur-ajoutee/decompter-tva/formulaires-tva.html

task-3349511

closes odoo/odoo#145328

X-original-commit: c43f34b
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-12-11 09:56:51 +00:00
Robin Lejeune (role) 41bc480b7b [FIX] website: avoid infinite redirects in iframe on Chrome
If you have the backend in a language A but the website in English only,
you can:
1) modify a record's (event, product...) name in language A (say "New
Name").
2) visit the page `/new-name-11` => the server will redirect you to the
English page `/origin-11`, with the only slug that actually exists on
the website. Chrome caches the redirection.
3) give the same name in English as in language A, try to visit
	=> the server now wants to access `/new-name-11`
    => Chrome uses the cache to redirect `/new-name-11` to `/origin-11`,
    => the server tries to redirect to `/new-name-11`
    => infinite loop, Chrome puts an end to it after ± 20 redirects.
In effect, Chrome injects a "Too many redirects" layout inside the
iframe, which in turn raises a CORS error when the app tries to update
it.

At the time of this commit, the flow described here should be expected
of users, because the translation UI in the backend is not clear: the
default field displayed is in language A even though the website does
not use it, and the way to update translations is not obvious (you have
to click on the language tag, which doesn't look like a button).

Another way to artificially reproduce the issue would be:
- Create a website.redirect from /dog to /cat
- Same from /cat to /dog
- Go to /@/dog

After this commit, if we detect that behavior, we reload the iframe with
a new query parameter, making the URL brand-new (and not cached) for
Chrome.

opw-3479651

closes odoo/odoo#145306

X-original-commit: 16d47ddf128f31f13e8d0d74597635faf7f9702a
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2023-12-11 09:56:50 +00:00
vifo 1be5133e74 [FIX] iot: Parse websocket url with ulrllib
Before, the websocket client was built manually, usign string
concatenation.
Now, urllib.parse() is used to appropriately adapt the database URL.
This update enhances security.

closes odoo/odoo#144303

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-12-11 09:56:49 +00:00
Adnan Saiyed 86026d7260 [FIX] web_editor: Image crop option not working
Current behaviour before commit:

When pressing crop button, crop widget is not getting
opened and 'connection lost' notification is appeared.
This happens because in wysiwyg.js file _rpc function
does not get the proper arguments from loadImageInfo
function.

Desired behaviour after commit:

Now, _rpc function is removed from wysiwyg.js as it
doesn't need anymore and _serviceRpc is passed directly
through the props. As result crop option works.

task-3546160

closes odoo/odoo#138482

Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
2023-12-11 09:56:48 +00:00
Aman Patel 8495dced7f [FIX] sale_timesheet: prevent certain selection options
Steps:
- Open sales.
- Go to products.
- Create a new product.
- Keep the 'Can be sold' option unchecked.

Issue:
- If a product is not sellable then the user should not be able to create
invoicing policy 'Based on Timesheets' or 'Based on Milestones'.

Fix:
- We are raising the user error 'This option is only for sellable products.'
when a user tries to select any of these two options.

task-3378532

closes odoo/odoo#145631

X-original-commit: 94982163f81175c9d2d670dc28704a716696604f
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-11 08:29:22 +00:00
Manushi Shah (mash) 74c80cee6c [FIX] project: resolving validation error in quick create
Steps:
- Open Project
- Go to Tasks > My Tasks or All Tasks
- Create New Task
- Create Project from Quick Create
- Clicking on Save,  will give a Validation Error

Issue:
- Validation Error is raised and thus, we aren't able to add the project and
thus creating a task.

Cause:
- Due to the addition of context, the default_type_ids isn't obtained, and thus
the SQL error occurs as the name of the task stage isn't set which is a mandatory
field.

Fix:
- removing the context from the form view of Quick Create and set the stage

closes odoo/odoo#145599

Task: 3378510
X-original-commit: 83119d5de49ae69d08a0f798453d9c5c56b2276a
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-11 08:29:21 +00:00
Xavier ALT 8114099ce7 [FIX] project_timesheet_holiday: only create GTO of employee's company
Following fdb692c25b:

- when creating/unarchiving an employee, we should only create global
  time-off of the same company as the employee itself

- when computing the working hours relative to the GTO, if we had both
  calendar GTO and company GTO (not linked to a specific calendar), we
  were not correctly creating calendar GTO; we should merge those
  intervals intead of company GTO interval simply overwriting calendar
  GTO intervals

closes odoo/odoo#145596

Task-id: 3619083
X-original-commit: 8ec0c6c106352c19e5c7b5613be2f610fa6e0adb
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-11 08:29:20 +00:00
Julien Banken 591a73939a [FIX] web: add check to not scroll calendar view if component is destroyed
In the `onMounted` hook of the calendar renderer, the given callback
function will schedule a new function call using `setTimeout` with a
delay of 0 if some conditions are satisfied. The scheduled function will
then trigger a scroll in the calendar view to display a precise timeslot.

If the component is destroyed before the scheduled function is executed,
the scheduled function may trigger an error as the root element of the
calendar will be removed from the DOM when the component is destroyed.

This commit will fix that issue by checking that the root element of the
calendar exists before calling the `scrollToTime` function.

Steps to reproduce the error:
1. Open Knowledge
2. Open the template gallery
3. Select the template "Sprint Calendar"
4. Quickly apply the template

=> If you have the right timing: a traceback will be displayed indicating
that the function `scrollToTime` is not defined on `null`.

TO BE: No traceback should be displayed when applying the template.

task-3627780

closes odoo/odoo#145292

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-12-11 08:29:18 +00:00
AH-Yussef 0eeee0cd53 [FIX] sale_management: maintain template lines order on Confirm
Steps to reproduce:
- Install Sales app
- Open Sales app, Go to Configuration > Quotation Templates
- Open a template, or create an new one
- Add sections with product(s) under each, so we have a structure like:
        - Section 1
        - Product 1
        - Section 2
        - Product 2
- Go to Orders > Quotations
- Create a New Quotation
- Select the recently created/updated template in the Quotation Template field
- Click on Confirm
- U can notice how the sections are moved to the top, missing up the structure

Investigation:
- Each sale order order_line has a sequence property associated to it which defaults to 10 if not explicitly specified https://github.com/odoo/odoo/blob/55b452ac0056c7075097fa1324ef53fc5090fb7a/addons/sale/models/sale_order_line.py#L41
- On Choosing a template, the _prepare_order_line_values() method returns the needed properties for each template line https://github.com/odoo/odoo/blob/55b452ac0056c7075097fa1324ef53fc5090fb7a/addons/sale_management/models/sale_order.py#L108
- The returned object for each template is missing the sequence property, resulting in it falling back to 10 when assigning it to the sale order order_line https://github.com/odoo/odoo/blob/55b452ac0056c7075097fa1324ef53fc5090fb7a/addons/sale_management/models/sale_order.py#L117
- Now all order_line(s) has the same sequence -except for the first one which has a sequence value of -99- https://github.com/odoo/odoo/blob/55b452ac0056c7075097fa1324ef53fc5090fb7a/addons/sale_management/models/sale_order.py#L114-L115

opw-3602781

closes odoo/odoo#144700

Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
2023-12-11 08:29:17 +00:00
Aaron Bohy 52191b832f [FIX] web_tour: correctly log failed step
When a tour fails, the tour system is supposed to log the failing
step (with the 3 previous/next steps). Before this commit, this
didn't work, and the first 3 steps were always logged, no matter
which step failed.

This didn't work because to determine the failing step, we try to
find the step from the list of steps, with reference matching
(steps are objects).

However, since [1], steps are obtained from a getter which calls
the steps function of the tour, so they always get a new version
of the steps.

This commit fixes the issue by memoizing the steps, such that the
function is called only once, and we keep the same references to
the step objects.

Note that this could be reworked in master to make it more robust
(e.g. finding steps based on ids).

[1] https://github.com/odoo/odoo/commit/81be42d8f9421e796087325c99aa4289d3912352

closes odoo/odoo#145385

X-original-commit: 16ffd4d0bcb705c86fedd8dc7e6dd749c35eb5bc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-11 07:06:42 +00:00
Simone Rubino f8a372d2be [CLA] signature for SirAionTech
closes odoo/odoo#145561

X-original-commit: c7e68a5dd533b5967dc4cd49767d21a4a9cc19bf
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-12-11 05:29:19 +00:00
Odoo Translation Bot 8ab45d4a85 [I18N] Update translation terms from Transifex 2023-12-10 00:12:46 +01:00
Habib (ayh) 39eaf87b1b [IMP] account,*: performance on Foreign Keys
On deletion of records, foreign keys are updated.
For larger tables (like account.move, account.bank.statement.line) this could take some time.
adding a "not null btree index" on sparsely populated many2one fields significantly improves performance.

In the analysis of deleting a bank statement line.
Before:
7.4s to delete the bank statement line (missing index on suspense_statement_line_id consuming 99% of the execution time)
3.8s to delete the corresponding account move

After:
With the indexes, a 700x performance improvement was found.

This opportunity is taken to add an index on all many2one fields to account.move & bank.statement.line.

Issue report by @tsb-odoo

closes odoo/odoo#145643

X-original-commit: f10b87991cc72f5e16b587b6c9ede7e338ec79ac
Related: odoo/enterprise#52466
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-12-09 13:29:18 +00:00
tong-odoo f9981f9910 [IMP] l10n_sg: adds new tax rates for 2024
SG Government has announced to change the GST-rate
on 01 Jan 2024 MN from 8% to 9%

Changes:
- Added new taxes (8% -> 9%)
- Added tax groups
- Added migration script to l10n_sg to apply those changes

task-3454556

closes odoo/odoo#145686

X-original-commit: 3d406214fb226ffe3aa222c422472bcc549a53cd
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-12-09 11:12:20 +00:00
AMZIL Ayoub ae5c5638f5 [FIX] base: fix default currency for Montenegro
The issue:
the default currency for Montenegro is LYD (Libyan Dinar) instead of EUR

The fix:
Set it to EUR

opw-3601783

closes odoo/odoo#145668

X-original-commit: 97c57c8dbb0f6ae19619c963552552454f92da93
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-12-09 02:19:39 +00:00
Joren Van Onder 01e07fb0db [FIX] pos*_stripe: support eftpos in Australia
Based on 50a91e0c531ec05a432cd8c468b74db27bd30985. By default
pos_stripe does the authorization and capture in two steps. This is
not supported for eftpos payments [1]. It can be supported in two
ways:

- always auth + capture in one step with the `automatic`
  `capture_method`, or
- only auth + capture when manual isn't possible with the
  `manual_preferred` `capture_method`

Although both could work, `manual_preferred` was chosen because:

- it's a bit simpler to figure out whether to capture the payment in
  the frontend (we can just check card_present.brand),
- this keeps non-eftpos transactions the same, which is more in line
  with our stable policy

For completeness pos_restaurant_stripe was updated to not capture
these eftpos payments, although this style of tipping isn't used in
Australia.

To test similar steps as in 50a91e0c531ec05a432cd8c468b74db27bd30985
need to be taken:

1/ use an Australian Stripe account,
2/ allow discovery of simulated readers by passing {simulated: true}
   to this.terminal.discoverReaders()
3/ manually simulating an eftpos payment via the browser
   console (necessary per payment) [2]

To be safe this also guards against the possibility of there being no
`charges` key on the payment intent. This was done elsewhere with
6a6057caf63d7e6a60dac190b2ea1ebb954d8f6a. It does seem that Stripe
rolled back this change (maybe only for Stripe Terminal intents),
because I always receive `charges` with the latest API
version (2023-10-16). Additionally,
50a91e0c531ec05a432cd8c468b74db27bd30985 has been live for 3 months
without issues, it would have caused errors if `charges` was missing.

[1] https://stripe.com/docs/terminal/payments/regional?integration-country=AU#integration-requirements
[2] posmodel.payment_methods[X].payment_terminal.terminal.setSimulatorConfiguration({testPaymentMethod: 'eftpos_au_debit'})

opw-3523604

closes odoo/odoo#142603

closes odoo/odoo#145665

X-original-commit: ffddab3aa437c997fd1d63d592b47598a4bad9f5
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Joren Van Onder (jov) <jov@odoo.com>
2023-12-09 00:11:02 +00:00
Laurent Smet 399de9b5d1 [FIX] account: Fix tax & tax group country_id recomputation
When changing the fiscal country of the company, the country of all taxes and tax groups belonging to this
company are recomputed. However, moving taxes from one country to another doesn't make any sense since
they are part of a chart template specific to a single country.

This becomes more annoying when there are custom fields that depends of the current country in some localization.
In this case, changing the country of the company will also erased some data coming from the chart template.
At this point, the user will be forced to reload the whole chart template to recover those data.

closes odoo/odoo#145423

X-original-commit: 58393169fb51db387562baaa67e9c9ca52ed066b
Related: odoo/enterprise#52331
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-12-08 18:34:25 +00:00
Brice bib Bartoletti 1650252f22 [IMP] account_edi_ubl_cii: add tax prediction if available
The aim of this commit is to leverage the power of the tax prediction
when possible to improve the quality of the tax retrieval of the edi
import.

Context:
The tax prediction happens when the invoice is given manually or with
the OCR but doesn't happen when it's imported by EDI because the tax is
already set by the edi.

Before this commit:
During EDI import, the tax retrieved could always be the same even if
the user make some modification to the previous bill.

After this commit:
The tax retrieved leverage the previous data to get better quality
result regarding tax retrieval.

closes odoo/odoo#145572

Task-id: 3626501
Ticket-id: 3531473
X-original-commit: 62bd397490cfcb21c2c92d67d761f68850054039
Related: odoo/enterprise#52430
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-12-08 17:19:15 +00:00