Commit Graph
169983 Commits
Author SHA1 Message Date
Hubert Van De Walle bc326fa21e [FIX] web: prevent multiple updates when pressing enter
Steps to reproduce
==================

In 16.4:
- Go to Accounting > Reconcile 8 items
- Click on the first line on the right
- Edit the label and then press Enter
- Switch to another line

=> Odoo Server Error

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

When pressing Enter, two events are triggered: keydown and change.
In the useInputField hook, there is a listener for both of those events,
and they both end up calling `record.update` with the current value from
the input.

In the relational model, the update is locked inside a mutex.

So the first update (triggered by the keydown) does an onchange.
This onchange deletes the current records (Command.CLEAR) and returns
new records.

Once this is done, the mutex is released. The second update (triggered
by the change event) then tries the same update. Since the value was
obtained when queuing for the mutex, it uses the old (now deleted)
record.

Solution
========

This adds a test for https://github.com/odoo/odoo/pull/154991
as part of the fix got lost in a conflict resolution for previous versions.

opw-3726818

closes odoo/odoo#157155

X-original-commit: fbebffe446de9dd80db2dbe5ca7bd2746dc2a54f
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-03-11 11:55:08 +00:00
mebe-odoo c3a9173048 [FIX] l10n_sa_edi: fix discrepencies in invoice date checks
When trying to process invoices at a time close to Midnight, and the user is using the system from a location different from the hosting location of Odoo, the system tries to check that the date of the invoice is the same as the current date of the system. This creates problems when the hosting server's timezone is different than that of the user. For example: If the hosting location is in Middle East (India), and the user is using Odoo from Saudi Arabia,
there is a difference of 2.5 hours due to the timezone, so when the system creates the Invoice at 11 PM and tries to check the date, the date of the server is actually 29th of February, 11 PM while the date on the user's machine is 1st of March, 01:30 AM, which triggers a UserError from the _check_move_configuration function.

closes odoo/odoo#157144

X-original-commit: 601c8b8a0b4aff44811fd37f365cc62205cf96f0
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-03-11 10:17:50 +00:00
Dang Van Loc b7e4e5b2aa [FIX] mrp: incorrect quantity_done
Step:
* Create Bom A: product A - qty 1, bom line: product = Component X, qty
= 20
* Create MO with Bom A and 1 produced_qty = 1:
	+ on components: To Consume = 20, Consumed = 15
+ Unbuild MO, check Unbuild, check Product Moves of Unbuild, check line
product Component X has Quantity = 20, in fact quantity must = 15

closes odoo/odoo#156952

X-original-commit: 18c45260f50663e042da3bbec13d02ef269e26b2
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-03-11 10:17:49 +00:00
Petar Najman 3242a8e513 [FIX] l10n_rs - Invalid serbian translation for Specific VAT rate 10%
closes odoo/odoo#155198

Signed-off-by: John Laterre (jol) <jol@odoo.com>
2024-03-11 10:17:46 +00:00
Yannick Tivisse e365e22485 [FIX] hr_contract: Track some missing fields on contracts
closes odoo/odoo#157012

Related: odoo/enterprise#58326
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-11 08:35:07 +00:00
Gauthier Wala (gawa) 39c16212f2 [FIX] account: sorted on NewIds break
To reproduce:
- Install account_accountant
- Create an asset (monthly for example)
- Compute Depreciation
- Modify the date of the first entry to 2 months later
- Modify the date of the second entry to 1 month later (so same month)
=> Traceback

The problem is that sorted does not work with ids of NewId. We should
look at its _origin.
There is a PR that would try to fix it in general, but it's in master
(and is not sure to be merged https://github.com/odoo/odoo/pull/155850)

The problem only began to occur in 17.0 because of the changes of the
onchange function.

opw-3759153 (in chatter)

closes odoo/odoo#156874

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2024-03-11 08:35:05 +00:00
Thomas Lefebvre (thle) 176f5ec4a2 [FIX] api: assert cr is a cursor when creating a new environment
`Environment.__new__` expects a Cursor.
Ensure developers pass a Cursor and not another kind of unexpected object.
Passing another object with the same attributes would work during
the creation of the new environment, but then would fail later,
when using the created environment with the wrong `cr` attribute,
with a less comprehensive error.

Task-3796479

closes odoo/odoo#80644

Signed-off-by: Raphael Collet <rco@odoo.com>
2024-02-13 09:07:38 +00:00
bram1000 a24f15d628 [FIX] website_slides, website_twitter: restrict keys from employees
Social users / managers shouldn't be able to access these keys,
only admin should.

For instance, in the user interface, it's only displayed in
settings, which is available to administrators only.

Task-3762961

Signed-off-by: Yannick Tivisse <yti@odoo.com>
2024-02-08 15:43:18 +00:00
duongnguyen-viindoo 8d1b0f6a7a [FIX] core: post_load default value should be same as *_init_hook
-Step to reproduce: add a post_load method in the init of any module,
specify in the manifest like : 'post_load': 'post_load'. in v16 or above
Run
test_manifests of the test_lint module and we will get warning

closes odoo/odoo#156593

X-original-commit: f87473e82af8372346320ca747c1b41d3d5cf3c5
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2024-03-11 05:23:10 +00:00
Odoo Translation Bot 1b9fd01d46 [I18N] Update translation terms from Transifex 2024-03-10 00:13:03 +01:00
David Monnom (moda) 3eb6ceb5c7 [FIX] pos_self_order, pos_online_payment_self_order: conf page behavior
The confirmation page wasn't displayed and the order wasn't sent to the
preparation display when confirming an order with a total of 0.

Now the confirmation page is displayed and the order is send to the
preparation display when the order is confirmed regardless of the total
amount.

closes odoo/odoo#157028

Related: odoo/enterprise#58348
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2024-03-09 18:37:56 +00:00
clesgow e2b26d4522 [FIX] product_expiry: use new dict for lot zpl labels
The previous fix ae3ec52 introduced a dict to display the values
required in the zpl label template.
This change didn't also update the template inheriting this one, hence
the need for this fix.

closes odoo/odoo#157160

X-original-commit: 416d29a59fb310071c2b7ed25e3032968b23d966
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-03-09 09:56:40 +00:00
rupa-odoo 0db96b6d27 [FIX] sale_project: fixed traceback on SO stat button in project update
Step to Reproduce :
-> Create product: Project & task
-> Create SO > Add product > Confirm it
-> Go to Newly created project > Project update > Sales order
-> Click on the project stat button > again go to project status > Sales Order
-> Crash it

Before these commit:
-> Clicking on so stat button in project update caused a traceback error that
null value is not defined.
-> When we are passing the context It was observed that create key
has null value in that context.
-> In sale_project if create_for_project_id has a null value then create key
also have null value.

After these commit:
-> So if we set False in the context, If we get null value of create key
it is set to False.

task- 3586341

closes odoo/odoo#157170

X-original-commit: 26d4c86ca1f8186811275cf6d001ef7105a07776
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-03-09 07:04:04 +00:00
adda-odoo 37d797f6d6 [FIX] point_of_sale: improve perf on saving res.partner edits
Issue -->

`saveChanges` at https://github.com/odoo/odoo/blob/saass-16.3/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientListScreen.js#L155
calls `load_new_partners` that calls `prepare_new_partners_domain` to compute
the domain on which the res.partner model is to be searched on, after the save has been
 commited. The search is done to update client side res.partner data.

Domain in question --> https://github.com/odoo/odoo/blob/5404f3367a611e527fcecc2dd49e683864ba4b81/addons/point_of_sale/static/src/js/models.js#L784

This domain has the potential to make `search_read` return every res.partner
record and compute fields such as 'total_due' on each one of them.
This presents the issue of overworking postgres when we only need to update one
res.partner record.

Solution -->

Use the `_loadPartners` method instead to only reload the current partner being edited + saved.

opw-3619941

closes odoo/odoo#157120

X-original-commit: 7477978482bc3c22338faab486d67085452b006d
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Aditya Dasgupta (adda) <adda@odoo.com>
2024-03-09 00:24:57 +00:00
Anna Janiszewska 1032eacb6c [FIX] hr_timesheet: filter out ts for global time off
Fix to avoid considering TS lines for projects linked to global time off

closes odoo/odoo#157156

X-original-commit: 2e46a8e9179a83709638bdefc7e664837cbd8e92
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-03-08 22:55:43 +00:00
Robin Lejeune (role) 9cbc7a2dc7 [FIX] website: allow keyboard events on slideshow right away
When a slideshow opens, the keyboard events don't work right off the
bat. You first need to click on one of the arrows before being able to
interact with the keyboard, which defeats the purpose.

Steps to reproduce:
- Drop an Images Wall snippet and save.
- Click on an image: the slideshow appears.
=> Pressing left, right or escape doesn't work.
- Switch to the next image.
=> Pressing left, right or escape now works.

closes odoo/odoo#157126

X-original-commit: 32c6f7e7688eb3b05d569e1895e8fc102f71baf4
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2024-03-08 21:22:00 +00:00
sofiagvaladze 9b851eabe7 [FIX] hr_expense: fix action
In odoo/odoo#93802 some filters (including submitted) were removed from
hr.expense.sheet view in favor of the side panel.

Meanwhile, action_hr_expense_sheet_department_to_approve
was not adjusted and was still using the removed filter.

This commit changes the action to also use panel view.

task - 3578235

closes odoo/odoo#157109

X-original-commit: 664442e75787b9c61dcfbeea56c2bab071c2fa7a
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-03-08 21:21:59 +00:00
luve-odoo a568411cc8 [FIX] project : project stage column portal
When creating a sub-task from a task form view in portal, the domain of
the stage should exclude personal stages and include only the one of the
project.

taskid:3551354

closes odoo/odoo#156776

X-original-commit: 3be073e73b5866d7b5da8cc549146be5efb5d7d0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-03-08 21:21:58 +00:00
Lucas Lefèvre (lul) 5118f0d7e4 [FIX] spreadsheet_dashboard_purchase_stock: remove hardcoded domain date
Replace the hardcoded date "09-15-2022" in the list domain by
`context_today().strftime(\"%Y-%m-%d\")`

The domain is now stringified since it contains a dynamic value
which is not valid in a json file.

closes odoo/odoo#156550

Task: 3756934
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2024-03-08 21:21:58 +00:00
sesn-odoo 01ed3966a9 [FIX] l10n_it_edi: ensure receiving a bill produces the right sequence
Currently, if you have an empty MISC journal and receive a document,
that document will be assigned a MISC sequence, regardless of the actual
document's type.

Cause
-----
When a document is received, it is processed in two steps:
1. An empty account move is created and linked with the document.
2. The newly created move is populated with data extracted from the
   document.

At stage 1, when the move is created, it is temporarily placed in the
MISC journal. In the event that this journal is empty, a sequence is
assigned to the move. Consequently, even if the move's journal is
subsequently changed, the sequence remains unaltered.

Fix
---
Manually recompute the sequence when the move's type is set.

opw-3663873

closes odoo/odoo#155887

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2024-03-08 21:21:57 +00:00
Abdelouahab (abla) b389d2d792 [FIX] website_sale: fix selecting tag selects category
To reproduce:
=============
- create a `product.public.category` -> (id = 15 for example)
- create a `product.tag` with same id as the created category
- create two products, one with the category and the other with the tag
- go to the shop and make sure to have the categories positioned on left
(by default they are on top)
- select the tag (by clicking on the label not the checkbox)
-> the category is selected

Problem:
========
with this configuration the checkbox of the category has `id=15` attribute
and the tag has `id=15` attribute too.
so when we click on the tag label and thanks to the `for=15` attribute of the
label, we will trigger click event on `input#15` which is the category checkbox
because it's the first one in the DOM.

Solution:
=========
set id of the tag to `tag_15` and the for attribute of the label to `tag_15` to
avoid the conflict with the category checkbox.

opw-3759654

closes odoo/odoo#157095

X-original-commit: 15545301a05b538729da3c59e4d24063e9b02cb5
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2024-03-08 19:48:01 +00:00
Julien (jula) 41676cd170 [FIX] website_hr_recruitment: redirect deprecated /jobs routes
__Current behavior before commit:__
`/jobs` routes have been modified in [this commit][1]. Old ones are
deprecated but are still working for backward compatibility.

When searching on this page, search params are now just added at the end
of the URL (instead of being part of the path like before).
If the URL of the page is a deprecated one, this can create a conflict
with the previous way the params were handled and produce an error.

__Description of the fix:__
Redirect the user to the new route any time he tries to reach the
deprecated ones. Any parameters included in the old URL will be carried
over to the new route to maintain expected behavior. If a parameter is
provided both in the path and as a kwarg, the kwarg value will take
precedence.

__Steps to reproduce the issue on runbot:__
1. Go to `/jobs/country/20`
2. Make a search using the search bar -> Crash

opw-3781374

[1]: https://github.com/odoo/odoo/commit/54f246f9c75b8f1ebdc637c6000f3e4773d702d5

closes odoo/odoo#157079

X-original-commit: 5a9ce2d7773222ac8989e3172f9363a7d6f71871
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Julien Launois (jula) <jula@odoo.com>
2024-03-08 19:48:00 +00:00
Jeremy Kersten 5f454dc140 [FIX] website_blog: redirect /blog/x/post/y simplify
Don't try to keep extra params and co. Keep it simple...

Else we should pop from request.params `blog` and `post` keys because
now they are converted as query param with the slug format:

/blog/name-1/post-1?blog=blog.blog(1,)&question=blog.post(1,)

closes odoo/odoo#156990

X-original-commit: 5b1eacba2e09687d627988c53910110bfb63ed1d
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-03-08 16:50:33 +00:00
Loan (LSE) 03ced6a5c4 [FIX] pos_stripe: nullable cardPresent
According to stripe documentation, the `card_present` attribute can
be nullable, see:
https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present
https://docs.stripe.com/api/payment_methods/object#payment_method_object-card_present

As a consequence, if it is not given, card_present values would be
undefined which create a JS traceback when the `brand` attribute
is get.

It also looks like Canada can give the brand under a different
key `interac_present`:
https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-interac_present
If the `card_present` key is missing, we'll try to read it from there

opw-3752751

closes odoo/odoo#157056

X-original-commit: 31c0fdd2c7f1521e533e7eb0bc56a7c16cdfea8a
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Signed-off-by: Loan Sens (lse) <lse@odoo.com>
2024-03-08 14:30:59 +00:00
Paolo Gatti (pgi) 00b6d142e4 [FIX] l10n_it_edi: Codes in XML template shouldn't be translated
Codes like "Exch.Rate" in the Italian EDI XML template for invoices were
translated. They shouldn't be, as they have pretty short char limit and
it's risky to people change that. The XML users are either domestic or
the Italian Tax Agency itself, so no point in translating "Divisa" into
"Currency" anyway.

Link: https://www.odoo.com/web#model=project.task&id=3627379
opw-3627379

closes odoo/odoo#156987

X-original-commit: 8c6c244ada17b21c4f20c8ae566f44efdfeab162
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2024-03-08 14:30:57 +00:00
Mattis Megevand (mmeg) 0c5b2e25bd [FIX] sale_timesheet: allow selection of SO for person with company
Steps to reproduce:
- Create a new company contact and add a contact inside that company
- Create two service product that are service with following config:
    - Invoicing policy: Based on Timesheets
    - Create on Order: Project & Task
- Make an SO for the contact inside the company with the two service in
  the order
- Confirm the SO
- Click on the smart button "Recorded"
- Click on new
- Click on new line at the "Sale Order item" column

Issues:
The list display "No records"

Solution:
Make sure that we search with the correct attributes, before we were
trying to match partner_id and commercial_partner_id.
Although similar in our case they are not equal as commercial_partner_id
represent the company and partner_id represent the individual.

opw-3750939

closes odoo/odoo#156471

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-03-08 14:30:56 +00:00
lase@odoo.com aed0e74462 [FIX] l10n_de_skr03: fiscal positions with VAT id should be vat_required
Steps to reproduce:

- Install the l10n_de package
- Create and select a german company
- Accounting > Configuration > Settings > Fiscal localization
- Set: Deutscher Kontenplan SKR03 for the fiscal localization
- Accounting > Configuration > Accounting > Fiscal Positions
- Click on "Geschäftspartner EU (mit USt-ID)" (this fiscal position
  translates to "Business partner EU (with VAT ID)".

Issue: The `vat_required` field of this fiscal position is False but
sould be True as the fiscal position is "(with VAT id)".

Cause of the issue:

The `vat_required` field is a Boolean of the account.fiscal.position
model without defaut value nor compute method. As such it is interpreted
as "False" when unset (just like any unset python boolean).
Since the `vat_required` field is not set in the data file of the
`l10n_de_skr03` localization for the "Geschäftspartner EU (mit USt-ID)"
fiscal position, it will be interpreted as False.

Fix:

We update the data file of the fiscal localization to the expected value

opw-3721912

closes odoo/odoo#157022

X-original-commit: 19703adb2f7a5f790ee3c9a3037be6cdf189efd7
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Lancelot Semal (lase) <lase@odoo.com>
2024-03-08 12:49:02 +00:00
Serge Bayet (seba) 9079b70387 [FIX] website: Ensure no public users when archiving company
This commit prohibits the archival of a company if it is associated with
a website. Otherwise, the website wouldn't be accessible anymore by
public users (and so by all users if they need to login).

Step to reproduce:
- On website 2, change the company from SF to Chicago
- In the website list view (in debug mode), reorder the websites so
  website 2 is the first one in the tree view
- Archive the Chicago company (from debug > companies and do it from the
  list view)
- Try to access the website/runbot from an incognito tab
- It will show a raw 403 error

Note that the companies can only be archives since Odoo 16, thanks to
this commit: https://github.com/odoo/odoo/commit/7d0996bb151f68647b22719eee5ed4a4c35574bb

opw-3749772

closes odoo/odoo#156988

X-original-commit: d7456bf5376cf53670dbe8eaf1a2281aa254d521
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-03-08 12:49:01 +00:00
Dylan Kiss (dyki) 1a0e3ee5c1 [FIX] web: make "Save current search" translatable again
Due to a refactor of the code in [1], the string "Save current search"
in the filters dropdown was not translatable anymore.

This commit fixes that, so it is translatable again.

[1] 976491e012

closes odoo/odoo#156946

X-original-commit: 5f1d6f26d6bfe1f23f4098eae2e0b32300adefda
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2024-03-08 12:48:59 +00:00
Mehdi Outagant (MOU) cf7c78c9cb [FIX] web_editor: fix the linktools editing behaviour
Steps to reproduce:

- Go to website (Homepage) > Switch to "Edit" mode.
- double-click the "Contact Us" button in the header or keep clicking it
many times > Traceback: Cannot read properties of undefined (reading
'find')...

After converting the `linktools` widget to Owl in [1], the DOM element
of the component [2] was retrieved in an async process after it was
mounted, (some legacy code can trigger the instantiation of the
`linktools` when its parent component is not in the DOM and
`this.linkComponentWrapperRef.el` won't be returned, see: `Link` >
`onMounted`).

When double-clicking the link, This implementation will lead to a race
condition where the `onWillUpdateProps()` (mainly triggered by the click
to focus the URL input...) will try to access the DOM element from [2]
before being correctly set in `onMounted()`.

The goal of this commit is to fix this behaviour by simply waiting for
`onMounted` changes to be done before doing any adaptation on the
`linktools` DOM.

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

opw-3706902

closes odoo/odoo#155418

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2024-03-08 12:48:57 +00:00
asno-odoo 5d6dd7f0a0 [FIX] stock_delivery: memory error
compute_packages method fetches all columns for stock_move_lines and its
result_package_id. If stock_move_lines are a big number, it causes
memoryerror. Pre fetch only the required fields. Also its better
to use _read_group then search count in a loop. For one database
it needed '2546604' stock_move_lines for a memory error to occur.

closes odoo/odoo#154150

Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-03-08 12:48:56 +00:00
Paolo Gatti (pgi) e6cfef7084 [IMP] l10n_it, l10n_it_edi: Internal Reverse Charge, import & export
Add support for Internal Reverse Charge invoicing flows in Italy.

- Add 0% sale taxes and purchase taxes targeting VJ grids in `l10n_it`
  for every Tax Exemption Reason involved (Scrap, Gold...)
- Add a Fiscal Position (equivalent to the Belgian "CoContractant" one)
  mapping the sale tax and purchase taxes to their Reverse Charge
  corresponding taxes. Those fiscal positions all have a different
  law-required note (with the law reference) that has to be printed
  on the PDF invoice through Odoo standard mechanisms.
- The way we compare the invoice features and each document type
  requirements has been revised and expanded for the tax_tags sets case.
  Now it should also avoid comparisons after the first failure, instead
  of doing all the comparison anyway.
- Imported vendor bills that have TD16, TD17, TD18 now have their
  0% reverse charge sale taxes converted to their purchase
  22% VAT reverse charge corresponding tax impacting VJ tax grids,
  following this mapping:

  Sale tax examption reason -> VJ grid targeted by purchase tax
    N3.2:  VJ3
    N3.3:  VJ1
    N6.1:  VJ6
    N6.2:  VJ7
    N6.3:  VJ12
    N6.4:  VJ13
    N6.5:  VJ14
    N6.6:  VJ15
    N6.7:  VJ16
    N6.8:  VJ17

- Vendor bills that have taxes targeting grids VJ6, VJ7, VJ8, VJ12,
  VJ13, VJ14, VJ15, VJ16, VJ17 are exported as Tax Integrations XMLs
  to be sent to the Tax Agency with the document type TD16
- Vendor bills that have taxes targeting grids VJ3 are exported
  as Tax Integrations XMLs to be sent to the Tax Agency with
  the document type TD17
- Vendor bills that have taxes targeting grids VJ9 are exported
  as Tax Integrations XMLs to be sent to the Tax Agency with
  the document type TD18

Link: https://www.odoo.com/web#model=project.task&id=3724926
task-3724926

closes odoo/odoo#153556

Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-03-08 12:48:55 +00:00
Paolo Gatti (pgi) 449433b73e [IMP] account: EDI decoder should post in the chatter on error
Added a small message in the chatter on an invoice when the invoice fails import.
Silencing errors on a blank invoice doesn't help us fix issues and
doesn't solve the import problem.

Part-of: odoo/odoo#153556
2024-03-08 12:48:55 +00:00
Maximilien (malb) 98ff6909a7 [FIX] l10n_fr: translation issues
During this commit: https://github.com/odoo/odoo/commit/8bee46f117b1e6822429e8688f70cb27cc237bb4
We have translated the l10n_fr localisation, but we made a mistake on a line.
This PR will correct the translation issue

Task: 3792865
opw-3754691

closes odoo/odoo#157027

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-03-08 11:17:48 +00:00
Maximilien (malb) 109d6e14f2 [IMP] l10n_lu: Taxes update
In Luxembourg, during the year 2023, the VAT rates were decreased by 1%
temporarily. Now that we are in 2024, we need to deactivate the taxes added
previously. We will not remove them so that client can still use them if needed.

closes odoo/odoo#157015

Task: 3635758
X-original-commit: 75cb238785c4979846a2db434bb5a715fec44867
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2024-03-08 11:17:47 +00:00
aliya 8948bd6305 [FIX] account_peppol: don't validate partners without id
If a partner doesn't have peppol eas or endpoint set, we still go through with checking participant's registration. This is not an issue if checking on a partner form, as the Verify button is invisible without these details being filled in. However, in the partner list view the button is always visible and it is possible to run verification for non-peppol customers. As a result, all of them show up as valid Peppol participants.

With this commit we only run verification if there are eas and endpoint details.

opw-3784945

closes odoo/odoo#156973

X-original-commit: 3caea860633744b547126f579da0c712b318e515
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2024-03-08 11:17:46 +00:00
Adrien Widart (awt) 56c57e0bb2 [FIX] purchase_stock,stock_account: create and reconcile exch diff
When mixing anglo-saxon accounting and multi-currency, it sometimes
leads to incorrect AMLs in the stock-in account

To reproduce the issue:
(Company in USD)
1. Setup some currency rates:
   - Yesterday: 1000 EUR = 4335.1 USD
   - Today: 1000 EUR = 4348.0 USD
2. Create an auto-avco product
3. (Yesterday) Buy one product at 1000 EUR and receive it
4. Deliver the product
5. Bill the PO
6. Open the journal items of stock-in account

Error: The AML for the exchange difference has been created twice

When posting the bill, it leads to `_generate_price_difference_vals`
where we generate AML/SVL in case of price differences. There, we
also generate such records in case of exchange difference. This is
what we do in the above use case. However, the AML is wrongly
encoded, we need to respect some specific conditions:
https://github.com/odoo/odoo/blob/d780a2fc73259244411329027349fad1cb353f34/addons/account/models/account_move_line.py#L1773-L1779
Otherwise, the reconciliation process won't work correctly and will
generate its own AMLs for the exchange difference (hence the above
error).

On top of that, to ensure a full reconciliation, we need to first
reconcile the exchange diff AML with the bill one. This is what we
are supposed to do in `/stock_account`: we split all stock-in AMLs
into three recordsets: `correction_amls`, `invoice_aml`, `stock_aml`.
However, we don't correctly isolate the correction AMLs. Therefore,
we try to reconcile all AMLs at once, which will not work.

Note: This commit brings a behaviour change since the amount
currency of exch-diff AML will now be zero, as it should (again, see
the comment of the code quoted above in the reconciliation process).
This also explains why this commit modifies an existing test:
comparing the `balance` and the `amount_currency` of such AML is
incorrect.

OPW-3544318

closes odoo/odoo#156951

X-original-commit: 19403baf53c38d3969b3ef1f97af955b5d454481
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2024-03-08 11:17:45 +00:00
Pedram (pebr) f91f5ed51f [FIX] point_of_sale: ensure QR code is printed on receipt reprints
Before this commit, if a receipt was reprinted, the QR code was not
included. This could lead to issues with receipt validation and
scanning.

opw-3763169

closes odoo/odoo#156948

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-08 11:17:44 +00:00
Laurent Smet d8d78849f3 [FIX] account: Fix dashboard graph samples in multi-currency
- Setup 2 companies with a COA: compA & compB
- For compA, have a journal having some data
- Give you access to compA & compB but make sure compB is your main company
=> samples data are displayed on the accounting dashboard for the journal

- Setup 2 companies with a COA: compA & compB, compB being a branch of compA
- For compA, create a journal
- Add some data into this journal using compB
- Give you access to only compA
=> you should not be able to see the data from compA since the data belongs to compB

Introduced by:
https://github.com/odoo/odoo/commit/24789b2c906e71d347924bfa1bcc7d3ca77d8daf

This commit also adds the company check in all queries/domains to manage the
branches correctly.

closes odoo/odoo#156737

Issue: 3722386
X-original-commit: a8097355ee8c4891ba4161fd82eb54f5d2d80e8c
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-03-08 11:17:42 +00:00
Zeel Patel a35d47a988 [FIX] point_of_sale: allow to use parent fiscal position in branch
**Before Commit:**
- In the point-of-sale, when a company had branches,
- The branch company was unable to use the fiscal position of its parent
company.

**After Commit:**
- The branch company can now use the fiscal position of its parent company in
the point-of-sale.

Task ID: 3775865

closes odoo/odoo#156676

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-08 11:17:41 +00:00
Naman Shah fc83c4846b [FIX] point_of_sale: allow branch company to select temporary account
Before this commit:
When the user creates a branch company, the pos(accounting) setting does not
allow the selection of a default temporary account for the user.

After this commit:
The user is allowed to choose a temporary account from the branch company.

Task-3775873

closes odoo/odoo#156478

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-08 11:17:40 +00:00
Harsh Modi f2ce34aaf1 [FIX] point_of_sale: allow company branch to change default tax
Before this commit:
When a company having branches,
they uses the same taxes as the parent company,
In POS settings, the default tax used a company domain
which does not allow branch to change the default tax

After this commit:
A branch is allowed to change the default tax

task-3775857

closes odoo/odoo#156434

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-08 11:17:39 +00:00
Andrea Grazioso (agr-odoo) 7d2702fa2f [FIX] account: simulated epd line partner
Set 'Rounding Method' to 'Round globally'
Set 'Cash Discount Tax Reduction' to 'Always (upon invoice)'
Create a Payment term with 1% discount if paid before 30 days
Create a company partner with child contact
Create an invoice:
- Add as partner the company partner (parent contact)
- Add a line with product 420.99, tax 21% not included
- Add the payment term
Tax total will show 87.52
Add the child contact as partner (set again payment terms if needed)

Issue:
Tax total will show 87.53

This occurs because, when simulating the not yet stored epd vals,
we create the line using the `partner_id` and not the commercial
partner.
Then, when tax amounts are aggregated and rounding errors are managed
the partner is used as grouping key to retrieve vals, so we don't fix
the rounding error correctly

opw-3661210

closes odoo/odoo#156412

X-original-commit: 3c3c12f1427c7138357a7b4abffb4a15b1fd4dd5
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2024-03-08 11:17:38 +00:00
Khaled Said d78f3bb2d5 [CLA] signature for Khaled Said (kerbrose)
closes odoo/odoo#156322

X-original-commit: c789891a741679a2080843de61055fec39cc9341
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-03-08 11:17:37 +00:00
Thibault Delavallée e97bfd77b4 [CLA] Add Justine Doutreloux to Acsone's CLA
She disappeared between 15.2 and 16.0 but seems she is still alive. Commit
odoo/odoo@88483a6 does not seem to have been forward ported after 16.0.

closes odoo/odoo#151920

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-08 11:17:36 +00:00
Justine Doutreloux b9efd939b5 [FIX] event_sale: use sudo to write on registrations
If the user doesn't have rights to registrations and tries to change the partner
on a SO, this will raise an access error even if there's no registrations linked
to the SO.
We use sudo to be coherent with what is done in _update_registrations.

Followup of odoo/odoo@fb17edd coming from odoo/odoo@19878d0

X-original-commit: 808ceb2
Part-of: odoo/odoo#151920
2024-03-08 11:17:36 +00:00
Mihran Thalhath 95acbfcf9d [FIX] stock: consider archived locations for orderpoint creation
orderpoint creation should also consider archived location
while computing qty_available or else users will be faced with
a `KeyError`

closes odoo/odoo#156965

X-original-commit: 1467cc1a2d773b8c7cbb4410c5c2f756764ca7c8
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-03-08 09:42:58 +00:00
Romain Derie f052c8a858 [FIX] website_blog: set better size for img in dynamic blog post snippet
Some templates are rendering the blog post cover in a very blurry way.
It was not detected sooner because of a mix of:
- The default blog posts img do not go through the `/web/image` route
  and are not resized down / impacted
- Some of the layouts are working fine
- For the problematic layouts, the problem gets worse when you select
  only one or two "Fetched Elements".

Steps to reproduce:
- Add an image on a blog post (you can just download the one on the PR)
- Add a "Blog Posts" dynamic snippet on a page
- Select "Card Layout"
- By default, you'll see that the image is very blurry. If you select
  2 (or 1) instead of 3 fetched elements, it will get even worse.

Note that it's like that since forever, when it was introduced with
https://github.com/odoo/odoo/commit/3c0d98bcd8adf9325ee3497eb8d25ec7f904d6a5

opw-3771992
opw-3758676

closes odoo/odoo#156962

X-original-commit: 7d817e950f9e7c18a504d8bff04e02efb9d9dbde
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2024-03-08 09:42:58 +00:00
Abdelouahab (abla) e94a1dd2f9 [FIX] project: fix closing recurring task
to reproduce:
=============
- make a task recureent
- change its state to a closing one
-> Validation Error

Problem:
========
- when creating the next occurence, we insert the followers of the original
task in the new one, but it happens that we create a `mail_followers` twice
which violates an SQL constraint of `mail_followers`.
https://github.com/odoo/odoo/blob/ea170be9089ee6c784664475ac4ec1218d23dccd/addons/mail/models/mail_thread.py#L253-L262

the create method will create `mail_followers` for the task and as the condition
that follows is truthy in this use-case `_insert_followers` will be called
and create `mail_followers` again.

- In previous versions we didn't face this issue because the creation of
occurences was done by a cron, so the condition was never truthy thanks to
`and self.env.user.active`.

Solution:
=========
to make sure the conditon stays falsy, we set `mail_create_nosubscribe`
in context to `True` when creating the next occurence.

opw-3742737

closes odoo/odoo#156945

X-original-commit: 64ca453bc36740ce4afcd46c1afbbb31abffdf7c
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2024-03-08 09:42:57 +00:00
Thomas Binsfeld 09350ff0e8 [FIX] point_of_sale: sudo in _check_active if stock.picking.type
If the user has access to picking types as a stock manager without having access to pos config, deactivating a picking type triggers an AccessError on pos.config.

closes odoo/odoo#156820

X-original-commit: 743c70e8d4e753200411aeedc8482c374792b1d5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-08 09:42:54 +00:00