Commit Graph
168780 Commits
Author SHA1 Message Date
Louis (loti) 92fd50cda7 [IMP] product,sale: fix spacing and alignment issues
Reduce spacing in product document form and align content in product document kanban details.

task-3512072

closes odoo/odoo#140901

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-01-12 16:12:42 +00:00
Jorge Pinna Puissant f468bba9d5 [FIX] web: fix error when no app in clickbot
Since [1], an error is raised when no app is detected on the clickbot.
The issue with this is that it's possible for a user to no have access
to any app. This occurs when we test single apps (web for instance) with
demo user.

The aim of the error is to detect if we are stuck on a tablet mode page.

Now, we change the test on the ensureHomeMenu function, to don't have
false positives, and detect correctly if we are stuck on a tablet mode
page.

Fixes runbot issue 52675
opw-3649047

[1] : 8f365824c9dddacf1b3a40688a30c8498df3d5d4

closes odoo/odoo#149214

X-original-commit: 10475a96401b02b95e92cc6c9eaa909aeb7de1d1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-12 14:27:48 +00:00
Lucas Lefèvre (lul) 0111317b75 [FIX] spreadsheet: accumulate starting with past data
- Inserting a cumulated graph view inside spreadsheet
  (e.g. cumulated subscription MRR breakdown),
- apply a global filter to filter, let's say on the current
  month
=> the first data point does not include data from before
the current month (the accumulation starts at 0, even though
there is data before)

You can also check the MRR evolution subscription dashboard,
"MRR over time" chart.

Note: with this fix, we assume all "cumulated" charts are also
"cumulated_start". Which is true in practice (only one cumulated
graph view in the entire codebase)

closes odoo/odoo#149084

Task: 3680601
Related: odoo/enterprise#54146
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-01-12 14:27:47 +00:00
aliya c113e96228 [FIX] account_peppol: limit demo mode to peppol
Currently, if account_peppol module is installed on a non-verified database,
it is not possible to register on `l10n_it_edi`, even on the test server.
That happens because we do not limit the demo mode to peppol.
This commit adds an additional check for the proxy_type when handling demo.
We wrap `make_request` in the decorator because it's used in many places in account_peppol,
so the condition has to be added inside the decorator.

closes odoo/odoo#149016

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-01-12 14:27:45 +00:00
Alexandre Kühn 5912e7b761 [FIX] mail: 'Logged _in_ as' on welcome page
Label of guest name on public discuss welcome page
was gramatically incorrect. It should be "Logged in as"
rather than "Logged as".

Also took the opportunity to properly translate the label.

closes odoo/odoo#149187

X-original-commit: 9463c787e7804e5c2c525b9ecc096ee067f0dd3d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-01-12 12:50:36 +00:00
lejeune quentin 6e2abdec82 [FIX] point_of_sale: Update ngrok for remote connection in IoT
Ngrok will be officially ending support for all ngrok agent versions 3.1
and older starting on January 15th, 2024.

So with this commit we install the latest version of ngrok 3.5.0

closes odoo/odoo#149178

X-original-commit: 7ccc58415ebab06f7b45eafb271f11605acd95a8
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2024-01-12 12:50:35 +00:00
Aaron Bohy d8b9f70f22 [FIX] im_livechat: fix env._t leftover
Commit [1] replaced all uses of env._t by calling the _t function
directly, and removed _t from the env. This commit adapts a
forgotten occurrence.

c07181b20b

opw 3664779

closes odoo/odoo#149176

Related: odoo/enterprise#54195
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2024-01-12 12:50:34 +00:00
Arnaud Sibille ba7856e942 [FIX] purchase_stock: use bill date exch rate for pdiff amls
Currently, the price difference amls are currently using today's date
(so the date the bill is confirmed) for the exchange rate.
It is weird, as the balance of those price difference amls then depends
on the confirmation date of the bill.
It is also weird, as they may also then use a different exchange rate
than the other amls (that are using the bill date exchange rate).

The fix is to use the bill date exchange rate.

opw-3596209

closes odoo/odoo#149159

X-original-commit: 5bcc8850331b7f211f9d670b2af95ccff1ff5914
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Arnaud Sibille (arsi) <arsi@odoo.com>
2024-01-12 12:50:33 +00:00
Alvaro Fuentes 04266116f2 [FIX] hr: fix error on avatar computation in multi-comp
The user associated to an employee doesn't need to be in the same
company of the employee. When this happens, we could get a multi company
issue when trying to _only_ display the employee form.

One way this issue is triggered is when the partner of the associated
user is marked as partner_share=True. We may get an access error due to
the rule `base.res_partner_rule`.

Steps to reproduce:
1. Install HR module
2. Create an extra company with a user (U) on it. Ensure the partner of
   U is also set as belonging to this second company.
3. Create an employee in the first company with associated user U.
4. Archive U (this makes the partner of U get partner_share=True)
5. Try to access the employee form from the first company.

We get an error:
```
Due to security restrictions, you are not allowed to access 'User' (res.users) records.

Records: U (id=11, company=COMP2)
User: Mitchell Admin (id=2)

This restriction is due to the following rules:
- user rule

Note: this might be a multi-company issue.

Contact your administrator to request access if necessary.

Implicitly accessed through 'User' (res.users).
```

Since we allow hr.employee records to keep the associated archived user,
to avoid this issue (potentially triggered differently) we opt to
compute the avatar placeholder as sudo.

The issue has been observed in multiple upgrade requests.

closes odoo/odoo#149171

X-original-commit: 5136e86b4d47fae1a70cba0809906cfc625fd1de
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
2024-01-12 11:18:04 +00:00
Abdelouahab (abla) a62f4c30d9 [FIX] website_sale: check pickUp list
To reproduce
============
- Website > Shipping methods > Pick-up in store
- Add a description displayed on the eCommerce
- add at least 3 or 4 lines with "enter" in between the lines.
- from the shop select Pick-up in store, the payment button will be locked

Problem
=======
- The method `_disablePayButtonNoPickupPoint` checks if there are pickup points
in a shipping method based on the count of children in the selected method
- The description will be counted as child which breaks the checking

Solution
========
check the existence of `.o_list_pickup_locations` instead

opw-3628025

closes odoo/odoo#149163

X-original-commit: cfaa0d47de2b4931f23994061ec489ae5705f181
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2024-01-12 11:18:03 +00:00
Jitendra Prajapat d49f94315a [FIX] mrp: By-product update in MO
Before this commit:
===================
If by-product is updated in mo after confirm then the initial by-product is considered and the
new one is ignored in stock_move_line(Product moves).

After this commit:
==================
If by-product is updated in mo then the initial by-product will updated with
new one in stock_move_line(Product moves).

closes odoo/odoo#149074

Task: 3534703
X-original-commit: 8908db1271d369aa05ab77ffde9f51fe9c86cf6d
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-12 11:18:02 +00:00
kdeb@odoo.com a04d5f1e23 [FIX] stock: correct field reference in stock report template
Issue:
- when attempting to download the Picking Operations report for a
product with packaging, the report generation fails with an error.

Steps to Reproduce:
- Configure a product to include packaging details.
- Create a new quotation with the packaged product, and confirm it.
- Proceed to validate the delivery.
- In actions click on 'Print' > 'Picking Operations'.
- Notice the error.

Solution:
- Update the field product_packaging_quantity to the correct field name
product_packaging_qty.

OPW-3643483

closes odoo/odoo#147692

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-12 11:17:59 +00:00
Lina (liew) b1772206b4 [IMP] partner_autocomplete: improve vat number matching
The first search request for a VAT number will always fail,
because we validate the VAT based on previous requests of the VAT
before we return the company information to avoid returning the wrong company

If no validated VAT is found and vies vat found the company,
we return the information provided by vies vat
task-3548046

closes odoo/odoo#148972

X-original-commit: a591e9c061374bfaf84d41a94246cff83ab1899c
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
Signed-off-by: Lina Eweis (liew) <liew@odoo.com>
2024-01-12 09:53:58 +00:00
Andrzej(pian) 7ad5f2efbf [FIX] website_crm_partner_assign: reseller localization
Issue Description:
The partner() function previously inferred the country using GeoIP
when no specific country (nor "all_countries") was specified.
However, if there were no partners from the inferred country,
the render function would lead to a broken screen.

Resolution:
Implemented a fallback mechanism to treat the situation
as if no country was specified. This ensures that all partners are displayed
in such cases, preventing the occurrence of a broken screen.

[Reproducing bug]
- odoo 16.4 with: website, contacts, crm_enterprise_partner_assign
- Simulate GeoIP on the backend, so it points to some COUNTRY_A:
    - this can be achived by adding `country= country_obj.search([('name', 'ilike', 'mex')])`
    [below this line](https://github.com/odoo/odoo/blob/57d43aca2b07d3469a937890b7d5e5c4f29fe250/addons/website_crm_partner_assign/controllers/main.py#L237)
    - note: it doesn't matter which country you set it to, AS LONG AS COUNTRY_A != COUNTRY_B
- in CRM/Contacts:
   - create partner (set Partner Level and country to COUNTRY_B of the record )
   - Publish partner by "Go to website" -> Published
- go to url: ODOO_WEBSITE/partners
- BUG: No Partners are displayed

opw-3598110

closes odoo/odoo#148822

X-original-commit: cfca987efe83e6a6ba27779246a2d5da6b86dc7f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Andrzej Pietrusiak (pian) <pian@odoo.com>
2024-01-12 09:53:57 +00:00
Nishant Jain 83f63df06b [IMP] account: don't calculate cash rounding if state is posted
Steps:
1. Install the Accounting module.
2. Enable cash rounding for Customer Invoices in the settings.
3. Activate Developer mode.
4. Navigate to Accounting > Configuration > Management > Cash Rounding.
5. Create a Cash Rounding rule with the following settings:
   a. Rounding Precision = 1
   b. Rounding Method = UP
   c. Rounding Strategy = Add a rounding line.
6. Create a bill and apply the rounding rule. Add invoice lines with products
   priced at $99.5 and a tax rate of 15%.
7. Confirm the invoice.
8. Access the cash rounding settings and change the Rounding Method to Down.
9. Open the bill, navigate to the "Other Info" page, and select the "To Check"
   option.

This will result in a UserError: "You cannot modify the taxes related to a
posted journal item, you should reset the journal entry to draft to do so."

Reason:
If there is any change in the rounding method after the journal entry is
confirmed, the compute method of tax_totals is triggered when some field of that
record is modified. This may lead to the creation of another journal item or
changes to existing ones based on the new rounding configuration. However,
performing this on a confirmed entry is restricted so it will raise UserError.

Solution:
Don't compute rounding according to the amount_total after its conformation.
Instead, count it using journal items for type-rounding

Task - 3468308

closes odoo/odoo#149118

X-original-commit: 612d044b19072d549ba8b12eb3a9a7583adad174
Signed-off-by: William André (wan) <wan@odoo.com>
2024-01-11 21:50:36 +00:00
Anh Thao Pham (pta) e616795b08 [FIX] l10n_sa_edi: fix access to attachment of EDI document
Steps to reproduce:
- Install Accounting and l10n_sa_edi
- Connect with a non-admin user (e.g. Marc Demo)
- Switch to a SA company
- Create an invoice
- Click on "SEND & PRINT"
=> A traceback is raised when trying to access the attachment linked to
the ZATCA document.

Cause:
Since this commit https://github.com/odoo/odoo/commit/44a4cdb3944a4b722dcfbca5e2947a4372b8501d
the attachment of an EDI document is restricted to users with
"Administration: Settings" rights.

opw-3663305

closes odoo/odoo#149055

X-original-commit: 2fa9626f45b8c0c890d0771d731c4a13c5a7a9d1
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2024-01-11 17:00:55 +00:00
Samuel Degueldre 8f1f32d0fb [FIX] web: improve ListRenderer rendering speed
The ListRenderer disables the checkbox of all lines corresponding to a
record which cannot be selected. Unfortunately, because
`canSelectRecord` is a getter, it is invoked once per line, and this
getter in turns invokes the `editedRecord` getter which scans all record
to find which record is selected. This operation is O(n²), so it's very
slow when there are a lot of records.

This commit fixes that by computing the value once per render.

Time to render the list view of views (technical > User Interface >
views) with 600 records visible:
- before: ~1800ms
- after: ~250ms

closes odoo/odoo#149051

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-11 17:00:54 +00:00
Xavier Bol (xbo) b05c6df09a [FIX] project: unable to save the project for subtask
Before this commit when the user creates a task with a subtask and
save the form view and then go to the form view of the subtask and
set as project the same than the one set on the parent task, he cannot
save the form view. The reason is because the framework JS considers
there is nothing to save since in fact , the project set is the same
than the parent by default, it is just not displayed in the interface
thanks to the value of `display_in_project` field. The reason is
to be able to let the user choose if he wants to see the subtask in
the main views (list/kanban) of tasks linked to the project or just
below the parent task.

This commit fixes the issue by forcing to update the `display_in_project`
field even if it is not in the active fields since it is invisible
in the interface and only the widget set on the project field will
read and update it.

Steps to reproduce:
==================
- Install Project app
- Go to the project app
- Create project A
- Create a task inside that Project A
- Go to the form view of that task
- Create a subtask
- Save the form view
- Go to the form view of the subtask
- Set the project A as project for that subtask
- Save the form view

Current Behavior:
================
The form view cannot be saved because the framework JS considered
there is in fact, nothing to save since `display_in_project` is
not in the active fields and there is no force_save="1" set on the
field in the view definition.

Expected behavior:
=================
The form view should be saved.

closes odoo/odoo#149035

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-11 17:00:53 +00:00
Thomas Lefebvre (thle) 5f74235d4d [FIX] base, hr: avoid invalid access error in onchange() when editing user
Steps to reproduce:
-------------------
- install the "hr" module;
- remove access rights for "Employees";
- change language on the user profile.

Issue:
------
There's an Access Error because we can't read the `private_street` field
on the employee that corresponds to the user.

Cause:
------
The new version of onchange fetches the record values on the server side,
unlike the old version which used the values in the view.

In the old version, as we were using view values, this didn't cause any problems,
as the values came from a read that which took into account `SELF_READABLE_FIELDS`.

Note:
We do not have access to the value of the `private_street` field because it is a
related field with the attribute `related_sudo=False` and we do not have
access rights for the `hr.employee` model.

Solution:
---------
Use the cache and place the values of the fields in `SELF_READABLE_FIELDS` in it
before performing the onchange logic.

opw-3664929

closes odoo/odoo#148997

Signed-off-by: Raphael Collet <rco@odoo.com>
2024-01-11 17:00:50 +00:00
Raphael Collet 59eec8711c [FIX] core: avoid hiding access error in onchange() with Form
When the server-side form view reads its record, the call to web_read()
leaves data in cache, which may prevent some access error to be
triggered in the first call to onchange().  In order to avoid that,
simply clean up the environment like after the other method calls.

Part-of: odoo/odoo#148997
2024-01-11 17:00:50 +00:00
Pedram (pebr) 13649e6b46 [FIX] point_of_sale: display product attributes' images
Previously, product attributes were not displaying correctly due to
image retrieval from "product.attribute.value" conflicting with
searches based on "product.template.attribute.value" IDs. This commit
resolves the issue by ensuring the correct image display.

opw-3666883

closes odoo/odoo#148913

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-01-11 17:00:49 +00:00
Pedram (pebr) 2e7a18883a [FIX] point_of_sale: use system date format for date search
Prior to this commit, the date search was hardcoded to
"yyyy-MM-dd HH:mm a", inconsistent with the system's date format
display. This commit adjusts the date search to align with the system
date format.

opw-3677157

closes odoo/odoo#148827

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-11 17:00:48 +00:00
roen-odoo 9564374aa1 [FIX] point_of_sale: fix session report payment difference
Current behavior:
If you use a non cash payment method, with "identify customer" option
and register a payment difference at the closing of the session. The
difference is not taken into account in the session report.

Steps to reproduce:
- Activate "identify customer" option on the bank payment method
- Open a session
- Add a product to the order
- Pay the order with the bank payment method
- Close the session with a payment difference
- Print the session report
- Open the report, at the bottom you should see the payment difference
  but it is not the case

opw-3597291

closes odoo/odoo#148753

X-original-commit: 30ba7fd9eb3d1910431cbf543e2ca691f0fdcfc0
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2024-01-11 17:00:47 +00:00
dejan.mirosavljevic ec9610ddd7 [FIX] l10n_rs: remove duplicate report template inheritance
closes odoo/odoo#148651

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-01-11 17:00:46 +00:00
dejan.mirosavljevic 02d596ac9d [CLA] Update Modoolar CLA to include additional members of the team
Part-of: odoo/odoo#148651
2024-01-11 17:00:46 +00:00
vlst-odoo a0496586ff [IMP] pos_self_order: add barcode scanning
In this commit we implement barcode scanning functionality
in the `pos_self_order` module.

This is useful for kiosk devices in shops.

closes odoo/odoo#148480

Task: 3637834
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-11 17:00:45 +00:00
David Monnom (moda) 5924b75dbd [IMP] pos_restaurant: improve UX of order button
Before, when category name is small it can be difficult to read
quantities.

closes odoo/odoo#147753

Now: quantities are to the left of category names with a little padding
Taskid: 3630619
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-11 17:00:44 +00:00
vava-odoo 64aea1a402 [FIX] base_import_module: raise error if dependencies not in addons path
If the addons path does not contain enterprise, the industry module
cannot be installed since all of them rely on knowledge. The same
applies if there is a theme in the industry and that the design-themes
repository is not in the addons-path.

This commit raises a UserError in case the installation would fail due
to a missing repository in the addons-path.

closes odoo/odoo#147138

Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2024-01-11 17:00:42 +00:00
Flotchet d7d40f5233 [FIX] website_hr_recruitment: remove useless csrf_token field
Steps to reproduce the bug:
- Go to /@/jobs/apply/experienced-developer-4
- Click on "Edit" button
- Click anywhere in the form
- Try to add a field
=> Nothing happens

Expected behavior:
You should be able to add a field without any problem.

Explanation of the bug:
A dynamic element is in the form (csrf_token) and it is preventing
the form to be modified correctly.
This was an artifact of a mistake made in commit [1].

Behavior after the fix:
You can add a field without any problem.

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

task-3593111

closes odoo/odoo#143456

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-01-11 17:00:41 +00:00
Damien Bouvy 128032a8b1 [FIX] base: correct spanish address format
Commit 8889a896f introduced the state in the address format for spain
between parentheses, however if the state is unset this leads to weird
values like
```
Isabella López Navarro
()
Spain
```
which is bad.

This commit instead formats spanish addresses by adding the state below
the Zip+City line and above the Country, as suggested here:
https://en.wikipedia.org/wiki/Address#Spain

This avoids empty parentheses.

Task-3679058

closes odoo/odoo#149012

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2024-01-11 15:16:24 +00:00
Hubert Van De Walle e660cd94a8 [FIX] web: no_quick_create option ignored
Steps to reproduce
==================

1. Install event
2. Go to Events
3. Configuration > Event Templates
4. Click on any event
5. Click on Communication
6. Add a line, change type to SMS
7. Type anything in Template
8. Click on Create "..."
9. The operation cannot be completed

Cause of the issue
==================

For many2one and many2many editable fields, the server sets the
can_create and can_write attributes on the field nodes. [1][2]

In some cases [3], those attributes are missing even though the fields
are actually editable. They are also absent for reference fields.

The `canQuickCreate` props was set to the following value:
`canCreate && !noQuickCreate`. When canCreate was absent, this was
evaluated to undefined, thus ignoring the noQuickCreate option.

Solution
========

When the permission attributes are missing, we have to assume that the
user has the appropriate permissions.

We also have to cast the extracted props to booleans as if you have an
props with a value of undefined, it will fall back to the default value.

In the test `no_quick_create option on a many2one when can_create is absent`,
we set the field as readonly and then cancel the readonly on the view.
This reproduces one of the bug of [3] which causes the permission
attributes to be missing.

-----

[1]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1296-L1297
[2]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1080-L1086
[3]: https://github.com/odoo/odoo/pull/138032

opw-3609799

closes odoo/odoo#148163

X-original-commit: efcb2a820bb57f1fae809725e799b3145fbbe599
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2024-01-11 15:16:22 +00:00
roen-odoo 04943d400b [FIX] point_of_sale: correct refund amount on rounded orders
Current behavior:
When an order total is rounded, if you refund it from the backend. The
refund amount is not correct, and you will not be able to close your
pos session.

Steps to reproduce:
- Create a rounding of 0.05 HALF UP and activate it on the PoS
- Create a product with a price of 49.99
- Sell the product in the PoS
- Go back to the backend without closing the session
- Refund the order from the backend
- Try to close the session

opw-3574913

closes odoo/odoo#147931

X-original-commit: d5e955523efc05457744f4331d4c2ecda2b14215
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2024-01-11 13:42:57 +00:00
Anh Thao Pham (pta) ae2219d6f6 [FIX] account: fix single bill creation with PDF and XML from alias
Steps to reproduce:
- Install Accounting
- Configure an Email alias for Vendor Bills journal
- Send an email to the alias with an PDF containing an embedded EDI XML and
the EDI XML corresponding to the PDF as attachments

Issue:
- 2 bills are created (one with the PDF as attachment and one with the XML),
instead of one with both PDF and XML as attachments
- The PDF with the embedded XML is linked to the invoice created by the attached
XML file and not the embedded one
- The embedded XML is decoded before the attached XML file.

Cause:
The order in which the documents are decoded.

opw-3604697

closes odoo/odoo#144243

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-01-11 13:42:56 +00:00
Florian(flg) 179980768c [FIX] l10n_dk: Add Flex ERP as author
As Flex ERP help us a lot to implement this localization, we
add them as author of the module.

issue id: #148085

closes odoo/odoo#149006

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-01-11 11:40:29 +00:00
Djamel Touati 04a5806c8c [FIX] purchase_stock: allow validation of a receipt with invoiced qty
Steps to reproduce the bug:
- Create a storable product “P1”:
    - Product category > Costing method: AVCO
    - Purchase tab:
        - Vendor: Azure interior - 190$
        - Control Policy: On Ordered quantities

- Create a Purchase order with P1:
    - Confirm
    - Create a bill and don’t post it
    - Try to validate the transfer

Problem:
A traceback is triggered:

```
File "/home/odoo/src/odoo/saas-16.4/addons/purchase_stock/models/stock_move.py",line 76, in _get_price_unit
price_unit = float_round(remaining_value / remaining_qty, precision_digits=price_unit_prec)
ZeroDivisionError: float division by zero
```

opw-3667533

closes odoo/odoo#148911

X-original-commit: 40ef15f33a1e523350c653d93cedebb7543a3dce
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2024-01-11 11:40:28 +00:00
Lucas Perais a0db7871ab [FIX] web: useRecordObserver error bubbles
Have a fieldWidget using useRecordObserver. In its callback, have a line that will
throw an error.

Before this commit, the Promise created by the hook was not rejected, leaving the error untreated and
popping until the window's onunhandledrejection event handler.

After this commit, the error appears on the owl errors stack, catchable with the hook onError.

opw-3667395

closes odoo/odoo#148887

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2024-01-11 11:40:25 +00:00
roen-odoo 6c78e65959 [FIX] point_of_sale: fix access error for company branch
Current behavior:
When you create a new company branch, and setup a user that only have
access to this branch. Then try to open the PoS app, you get an access
error.
This was happening because we try to read the company of the journal
that is not accessible by the user when we do the `_compute_currency`

Steps to reproduce:
- Create a new company branch
- Change demo user to only have access to this branch
- Login as demo user
- Open PoS app
- Get access error

opw-3640468

closes odoo/odoo#148625

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-11 11:40:25 +00:00
nda c32628641b [FIX] base_import_module: use full version for uploadable module
uploadable modules latest_version are not fully defined (ex: 1.0 instead of
15.0.1.0), which lead to issues in the MigrationManager.

Steps (in 17.0):
- make sure you have the industry repository in the addons-path and the upgrade
one in the upgrade-path
- create an empty database
- On 'Hair Salon', click 'Activate'
- On the 'Install an App' popup window, click 'Install'
- Wait for the Hair Salon Industry to install > Once finished, go to the Website
- Click 'Edit' to open the website editor
- Click 'Theme'
- Next to the 'Theme' field under the 'Website' section, click 'Switch Theme'
- Click 'Ok' on the Confirmation popup window
- Click 'Use this theme' for the BEAUTY them
- The 'Building your website...' animation begins
An error is thrown
File "/home/odoo/src/odoo/17.0/odoo/addons/base/maintenance/migrations/theme_common/9.saas~13.1.1/pre-views.py", line 4, in <module>
from openerp.addons.base.maintenance.migrations import util
ModuleNotFoundError: No module named 'openerp'

opw-3589376

closes odoo/odoo#148955

X-original-commit: b96b34dc69458b165e8660520832bd8d02adec70
Signed-off-by: Raphael Collet <rco@odoo.com>
2024-01-11 10:06:44 +00:00
luvi 6872f0a547 [FIX] web: prevent annoying focus on touch devices
This commit fixes an annoying issue when using Odoo on a tablet or a PC when using
the touch screen primarly. The virtual keyboard popped way too much when navigating
in between views and screens, since the focus is often set on inputs (mostly the
search bar with useAutofocus).

Steps to reproduce:
- on a Windows laptop or tablet with a touch screen, open any view
- the virtual keyboard appears
- you must touch out of the keyboard to use Odoo

To fix the useAutofocus hook, hasTouch is now being used instead of relying on the size
of the screen.

Autofocus test with isSmall has been adapted to specify that touch isn't modified, and
that the autofocus is still present. And another test has been added asserting the
behavior on a touch device.

In the form renderer, the autofocus set manually on the first element is now prevented as
well, reducing the popping effect of the keyboard when opening a view. A test has been
added as well.

task-3627697

closes odoo/odoo#148925

X-original-commit: 1f2ab6d5dda61a6aad6e0e9bd282195cdd990f15
Related: odoo/enterprise#54074
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2024-01-11 10:06:41 +00:00
Daniel Kosky (dako) 2b296fa0c0 [FIX] l10n_ke_edi_tremol: fix reference to prepare_edi_tax_details
A recent commit (03466c2) introduced a change that allowed for users to
place multiple taxes on a line (provided only one of them was a VAT
tax) when sending invoices to the device. This made use of the
_prepare_edi_tax_details method, which is only available from the
account_edi module.

This fix adapts the function to make use of the
_pepare_invoice_aggregated_taxes method (available from) the account
move model instead. The references to the keys in the returned tax
details dictionary have also be corrected (since the structure of the
dictionary between from version 16 onwards).

closes odoo/odoo#148901

X-original-commit: 4fddcc8fdb0a82938be665c81232268ae59ed37e
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2024-01-11 10:06:40 +00:00
mano-odoo a66fe99800 [FIX] web: kanbancard reestablish 16.0 outline effect
Since milk redesign the kanbancard lost their outline bottom on focus
state.

Previous fixes where applied to solve this issue in commit[1]
and commit[2]. These fixes were a Catch-22:
fixing a behavior here, creating an issue there (double borders,
issue on drag..) which lead to more custom code.

In this commit, we remove the code added by the previous fixes and apply
a solution used in version 16.0 and prior. Relying on a negative margin
to hide the border of the following `kanban_record` and applying an
outline effect and a greater `z-index` on focus to make it appear on
top of the border. This z-index is set to 2 to compensate the
`z-index-1` on the kanban column when a card is focused and dragged.

[1]: odoo/odoo@d8fcc218bc
[2]: odoo/odoo@2495bfa725

task-3580229

closes odoo/odoo#148869

X-original-commit: ca388322327379e470e76f3a3c6ee2b2271e3895
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-01-11 10:06:38 +00:00
Claire Bretton (clbr) 493d5c3998 [FIX] account: add error when trying to update CoA with outdated module
Steps to reproduce:
1. Install a localization.
   For example l10n_ee.
2. Delete some tags to mimic an outdated module
   `DELETE FROM account_account_tag WHERE name->>'en_US' SIMILAR TO '(\+|-)1_1%';`
3. Click the reload button in accounting settings
=> Traceback

This happens because we didn't update the localization module first, thus the
tag is not yet created in the database.

We now raise a UserError telling the user he probably needs to update the module.

closes odoo/odoo#148956

X-original-commit: 3e93447ca6b464b96fa7d7eb3d671456576c0bf0
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2024-01-11 08:47:00 +00:00
Mattis Megevand (mmeg) 980e6a53b2 [FIX] sale{,_timesheet}: Generate activity on duplicated sales order
Steps to reproduce:
- Create a service product with Project & Task created on order
- Make an SO for 1 hour and confirm it
- In the task add 5 hours of timesheet
- An activity should be made in the SO
- Copy the SO and add the 5 hour of timesheet like before

Issue:
No activity is made.

opw-3660169

closes odoo/odoo#148929

X-original-commit: 1f7844f9384e3d78599923c2487ae938de9cddfc
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Mattis Megevand (mmeg) <mmeg@odoo.com>
2024-01-11 08:46:58 +00:00
David (dafr) 61ca757fd1 [FIX] mrp: 'move_finished_ids' depend on 'move_dest_ids'
During the creation of 'mrp.production'
'_compute_move_finished_ids' may be called before 'move_dest_ids' is set.
However, move_finished_ids depend on move_dest_ids (in the method _get_move_finished_values).

This may cause the move_orig_ids and move_dest_ids of the component and finished moves to not be set.

OPW-3652916

closes odoo/odoo#148922

X-original-commit: 44ed90245effa99f380b0b681dea0980f85930b7
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: David Fesquet (dafr) <dafr@odoo.com>
2024-01-11 08:46:57 +00:00
OmarAbosamaha 66b4e080e2 [FIX] repair: prevent uom comparison for non products
Issue:
When updating section line or note in a confirmed SO, the system tried to compare uom of them causing an error

Steps to reproduce:
1- Install sale and repair apps
2- Create a sale order with adding a product and a section line
3- Confirm sale order
4- Modify section line
5- Save

Solution:
We need to check if the order line is a product before performing the uom comparison

opw-3644939

closes odoo/odoo#148900

X-original-commit: e3cd490ab0e62865b5ad7516643a22c6ba3a3371
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Omar Abosamaha (abom) <abom@odoo.com>
2024-01-11 07:27:36 +00:00
Harsh Modi 96005942f8 [FIX] l10n_in_edi: fix invoice preview taxes table
Before this commit:
The taxes column on invoice preview
were displayed  abit congested due
to inherited attributes

After this commit:
We have removed inherited attributes
which resolves the above mentioned
issue

closes odoo/odoo#148988

X-original-commit: d7d0cac8da30a15ab0d1d8695024fcb3f8b6ac3b
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Harsh Modi (hamo) <hamo@odoo.com>
2024-01-11 06:20:49 +00:00
Zeel Patel c51395687a [IMP] l10n_in_edi: correct the warning for E - Invoice having API mismatch
Before this commit:
The warning message displayed for E-Invoices with API and
tax ID mismatch was incorrect. It stated: '[0] Unable to send e-Invoice. Create
an API user in NIC portal, and set it using the top menu:
Configuration > Settings.'

After this commit:
The warning message for E-Invoices with API and tax ID mismatch has been
updated. The new warning message now reads: 'Ensure GST Number set on company
setting and API are Verified.'

closes odoo/odoo#148919

X-original-commit: bf4409253597c0feedd0cccb42140a3a878276e1
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Zeel Patel (zepa) <zepa@odoo.com>
2024-01-11 05:08:55 +00:00
mebe-odoo 2eec0b650c [FIX] l10n_sa_edi: fix qr code for ZATCA Phase 1 invoices
Currently, when we try to print a ZATCA invoice after installing the l10n_sa_edi module, the system will always default to printing the Phase 2 QR code on the invoice reports, irrespective of whether or not the invoice itself is for Phase 1 or 2. To fix this, we check if the Invoice has edi_documents, in which case it is marked as Phase 2 and runs as usual. Otherwise, we mark it as Phase 1 and call the initial function.

closes odoo/odoo#148928

X-original-commit: 3d33d18bbe5c462e0b986cb4891a67a14c63eb62
Signed-off-by: Mehdi Bendali Hacine (mebe) <mebe@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-10 21:04:38 +00:00
Louis (loco) a5df9781be [FIX] web_editor: make the system robust when old mimetype is missing
Steps to reproduce:
- Add an image on the website.
- Save.
- With the HTML editor, change the src of the image (to
"https://odoo.com/logo.png" for example) and remove the
`mimetypeBeforeConversion` data attribute of the image. Note that it is
important to change the src of the image to ensure that the system does
not add the `mimetypeBeforeConversion` data attribute back on the image.
- Enter in edit mode and click on the image.

-> Traceback of type "Cannot read properties of undefined (reading
'split')".

This traceback appears because the `_renderCustomXML()` method of
`ImageHandlerOption` relies on the presence of formats on the list
returned by the `_computeAvailableFormats()` method. Since [1], if there
is no `mimetypeBeforeConversion` data attribute on the image, one of the
format in the list is `undefined`. As `_renderCustomXML()` tries to
perform a `split()` on this format, a traceback appears.

Although the steps to reproduce the result seem tricky, it has been
decided to create a fix for this situation. Indeed, in version prior to
16.4, the equivalent steps to reproduce (in which the `mimetype` data
attribute is removed instead of the `mimetypeBeforeConversion`) do not
lead to a traceback. In those versions, if there is no mimetype on the
image, the options such as "Filter", "Width" and "Quality" are not shown
in the editor panel. The goal of this commit is to apply the same logic
for the version 16.4; hide the "Format" option if the image does not
have the `mimetypeBeforeConversion` data attribute. To do so, the
`_computeWidgetVisibility()` method has been adapted consequently. To
avoid the traceback, the `_computeAvailableFormats()` method has been
adapted. It now returns an empty list if the image does not have the
`mimetypeBeforeConversion` data attribute. As there is no `undefined`
format in the returned list of valid formats, the traceback is avoided.

[1]: https://github.com/odoo/odoo/commit/730588b802506844e6ca54df312333bfd8df1d52

task-3631487

closes odoo/odoo#148882

X-original-commit: 485a5d74198668fa2f2240b4e31a871f36225857
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-01-10 21:04:36 +00:00
Antoine Vandevenne (anv) 2c79995c29 [FIX] payment: allow creating new payment methods from the provider
When browsing a payment provider's payment methods, the "New" button was
disabled because the action did not allow Kanban views.

closes odoo/odoo#148865

Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2024-01-10 21:04:35 +00:00