Commit Graph
168531 Commits
Author SHA1 Message Date
Trinh Ngoc Hung db2c22f0d4 [FIX] l10n_vn: Account type
242: These future expenses must be deferred on the company’s balance
sheet until the moment in time they can be recognized, at once or over a
defined period, on the Profit and Loss statement.
6274, 6414, 6424: Fixed asset depreciation not expense

closes odoo/odoo#146802

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-01-03 09:17:49 +00:00
Theo VINCENT (thvi) 1479104495 [FIX] pos_online_payment: full flow test
- Replaces a randomly failing test by a simpler test.
As reported by XDO (https://github.com/odoo/odoo/pull/123237#discussion_r1410620206), executing web requests asynchronously during the execution of a tour which does an RPC is randomly failing.
The fix consists in not testing the full online payment flow with the cashier frontend interface, but instead simulate an order saved on the server and simulate real customer web requests for paying online for that order.

 - Simplifies the way payment portal URLs are build.

closes odoo/odoo#145595

closes odoo/odoo#146029

Task-id: 3632217
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Théo Vincent (thvi) <thvi@odoo.com>
2024-01-03 09:17:48 +00:00
Nicolas Martinelli 8239bfb226 [IMP] base: higher priority for vacuum
There are various cases where we observe crons which systematically
face a CPU / memory limit. In a setup where a single worker cron is
launched, a failing cron will prevent subsequent crons to run.

This happens because the limits are evaluated at the worker level: the
worker is killed, then starts over with the same job list order.

If the vacuum cron cannot be run anymore, it leads to tables not
garbage collected anymore (e.g. `bus_bus`), causing performance issues.
To avoid this, we give a higher priority to the vacuum cron.

closes odoo/odoo#144210

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2024-01-03 09:17:48 +00:00
Prakash Prajapati f1654683b6 [FIX] web: fix the test case related to the year
Before this commit, since we are no longer in 2023, the test failed
because there is no longer 2021 in the filters dynamically added in the
dropdown of the date filter. The reason is now we have the current year,
the previous one, and the one before, that is, 2024, 2023, 2022.

This commit adds a patchDate to be sure we will start the test in 2023,
to get the expected filters displayed (2023, 2022, 2021).

closes odoo/odoo#147809

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-02 16:09:51 +00:00
Prakash Prajapati 9a3d51c1e3 [FIX] spreadsheet: fix the test case related to the year
Part-of: odoo/odoo#147809
2024-01-02 16:09:51 +00:00
Xavier-Do 1b5d6893c6 [FIX] l10n_hk_hr_payroll: remove from standalone tests
This is breaking since 2024-01-01, disabling the test waiting for a
proper fix.

closes odoo/odoo#147846

X-original-commit: 56cdb8a4ad4a4650df2399305ed6210833b325b5
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2024-01-02 15:48:46 +00:00
Odoo Translation Bot ad35458e8b [I18N] Update translation terms from Transifex 2023-12-31 00:18:24 +01:00
Florian(flg) 1765637e5a [FIX] account: Don't show gap sequence warning for draft moves
When we have more than one draft move for the same journal,
it shows the gap sequence warning on the dashboard. Even if there
is no gap sequence.
It is caused by the fact that we used the sequence_prefix field
on account move to check if a sequence exists.
The aim of this commit is fixing the part of the sql
query modified in 61c9bd69bb0342d845608ad0671e36c70f64fbd3 by
verifying that the name != '/' like we did for the sql query
that computes the made_sequence_hole field.

task-3648745

closes odoo/odoo#147792

X-original-commit: 90ec2ed2043d90e5632d02416b9806c2c87e69c7
Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-30 09:38:03 +00:00
Jigar Vaghela 9ff2d9f16a [IMP] account: add support of financial year in sequence
For countries where the financial year is not from January to December
so the sequence may contain two years like 2022-2023 where 2022 is the financial year start and 2023 is the financial year end and this sequence is reset when the financial year ends.

so in this commit, we add support for this type of sequence
* INV/2022-2023/00001
* INV/22-23/00001
* INV/2022-23/00001

closes odoo/odoo#147785

X-original-commit: 072085b32c435fa88d6765469cb0908b9b5c3074
Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-29 19:47:34 +00:00
Killian Frappart bc0b090cd6 [FIX] bus, mail, im_livechat: open discuss from livechat history
The kanban view used to display message history of livechats sessions is
replaced by Discuss for a smooth and consistent user experience.

Minimum viable version for Task-3497801

closes odoo/odoo#146800

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-12-29 18:33:23 +00:00
Benjamin Vray 9351b2a5eb [FIX] sale: fix product configurator badge style
Since commit [1], we've applied a style to the badges (Bootstrap badge)
which display extra prices next to a product's variants.

However, this style unintentionally affected certain badges that should
not have been affected since this other commit [2].

Steps to reproduce the bug:

- Open the Website app.
- Go to "Configuration" in the main navbar.
- Select "Payment Providers" in the dropdown.
- Pick the "Demo" payment provider.
- Change the state to "Test Mode."
- Set "Bank" as the "Payment Journal".
- Go to the "/shop" page.
- Click on a product.
- Click on "Add to Cart" on the product page.
- Go to the cart and click on "Process Checkout".
- Bug: On the "/shop/payment" page, notice a slight text misalignment in
the badges next to the Payment Providers selector.

In this commit, we've adjusted the CSS rule to ensure that only product
configurator "extra price" badges receive this styling.

[1]: https://github.com/odoo/odoo/commit/3e03bd9a399d607d0f36c7e7652ee743a7cfe61a
[2]: https://github.com/odoo/odoo/commit/611e2f20f975c590eb75d64379be84dd4cc472ef

task-3626728

closes odoo/odoo#147755

X-original-commit: d30a081016d8547dd9bc7bff1d47d78ef2ceb2cb
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-12-29 16:10:47 +00:00
Djamel Touati 705b256b8c [REV] mrp: revert commit fe508c6
This reverts the following commits : https://github.com/odoo/odoo/commit/fe508c6b2cb1b92d7b063cc194a3dad37f4eb255

The behavior for tracked products is different; the quantity is modified
in a wizard by adding other `stock.move.line`, which does not trigger
the change of the 'picked' field to true and makes the behavior
different from non-tracked products.

We prefer to remove this fix and keep the same behavior for all types
of products. The user can manually select the checkbox for the 'picked'
field.

Update the optional show for the field “picked” in the MO form

closes odoo/odoo#147695

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-12-29 16:10:46 +00:00
nda 5054148633 [FIX] base_import_module: avoid warning when browsing industry modules
An ormcache has been added to a method that takes lists as parameters but
lists are not hashable.

steps to reproduce:
- go to apps and click on on 'Industries'

before this commit:
- a warning is raised in the logs:

WARNING industry odoo.tools.cache: cache lookup error on ('ir.module.module', <function IrModule._get_modules_from_apps at 0x7f99e842fc70>, ['icon', 'icon_flag', 'to_buy', 'name', 'state', 'summary', 'website', 'application', 'module_type', 'shortdesc'], 'industries', False, ['&', '!', ['name', '=like', 'theme_%'], '&', ['application', '=', True], ['module_type', '=', 'industries']], 80, 0)
Traceback (most recent call last):
  File "/home/nda/dev/odoo/17.0/odoo/odoo/tools/cache.py", line 99, in lookup
    r = d[key]
  File "<decorator-gen-5>", line 2, in __getitem__
  File "/home/nda/dev/odoo/17.0/odoo/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
  File "/home/nda/dev/odoo/17.0/odoo/odoo/tools/lru.py", line 34, in __getitem__
    a = self.d[obj]
TypeError: unhashable type: 'list'

after this commit:
- ormcache is properly used

opw-3660052

closes odoo/odoo#147730

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-12-29 14:59:44 +00:00
Flotchet 0b5639c540 [FIX] hr_recruitment: limit job title size
step to reproduce:
- go to recruitment
- create a job with a title with a abnormally long title
-> the title is not limited & overflows

Bug explaination:
The parent has no defined width, so the title cannot be limited by
the original css rule.

Expected behavior:
The title size should be limited or be able to wrapped.

Bug resolution:
Remove the o_text_overflow class and thus permit the title to be
wrapped.

behavior after this commit:
The title is able to be wrapped.

task-3598895

closes odoo/odoo#142480

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-12-29 13:42:56 +00:00
Killian Frappart 6b78c08783 [FIX] mail, im_livechat: remove automatic thread pin when opened
Threads are automatically marked as pinned when they are opened but this
behavior is not always desirable. They are now implicitly pinned when it
makes sense to do so.

closes odoo/odoo#146841

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-12-29 12:27:45 +00:00
tsm-odoo a42e42ff15 [FIX] mail: fix non deterministic im status test
Before this PR the "Can handle im_status of unknown partner" test was
sometimes failing. This test is not related to im_status: it tests
that receiving a `mail.record/insert` notification properly inserts
the data in the store. This flow is already thoroughly tested as many
discuss functionalities rely on this mechanism. This PR removes this
test.

fixes runbot-52628

closes odoo/odoo#147705

X-original-commit: 39a368238f5fc9b8d8d4115f14a05499322e92e6
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-29 11:06:59 +00:00
Antoine Dupuis (andu) c0450feaa3 [REF] l10n_ec: Refactor _l10n_ec_get_identification_type
_l10n_ec_get_identification_type will get called quite often in a loop
in the ATS report, so it's important that it gets orm-cached. This
reimplementation removes calls to ref() and replaces them with calls
to _xmlid_to_res_model_res_id() which is entirely orm-cached.

closes odoo/odoo#147723

X-original-commit: f95540bb8b92e795b1331910049d0d6de7da120c
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
2023-12-29 09:49:54 +00:00
nda 6be13ae31d [FIX] core: make properties fields work with inherits
Related fields created when using composition based inheritance are
created without the 'definition' attribute which leads to errors if
you try to read it.

steps to reproduce:
in an odoo 17 shell (it's easier to reproduce in 17 because there is
an example of a problematic field)

self.env["product.product"].search_read([], ["product_properties"])

before this commit:
an error is raised:
TypeError: tuple indices must be integers or slices, not NoneType

after this commit:
the field product_properties is read from product.template

opw-3618178

closes odoo/odoo#147729

X-original-commit: bd012785fe3081aa14a556a94702373cfce4f5db
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Signed-off-by: Nicolas Danhier (nda) <nda@odoo.com>
2023-12-28 22:21:50 +00:00
Walid 2be5206720 [FIX] mrp_subcontracting_purchase: svl component unit price
Steps to reproduce:
- Create product FNS, storable, avco
- Create product CMP, storable, avco, cost=$100, add 10 unit in stock
- Set resply subcontractor route in inventory tab
- Create BoM for FNS: subcontracted, cmp=1 unit of CMP, vendor=Azure Interior
- Add "Azure Interior" to the vendor list of FNS (under Purchase tab) with a price of $20
- Create purchase for 1 unit of FNS to "Azure Interior"
- Confirm: Receipt should show subcontracted
- Validate Receipt: Valuation of FNS should be $120
- Create vendor Bill, Validate
=> Product Valuation is overwritten, cost become $-80.0

Bug:
when checking price difference unit component price is suvtracted but
since they are out moves their valuation is already negtaive

opw-3618767

closes odoo/odoo#146538

Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2023-12-28 18:03:58 +00:00
Thomas Becquevort (thbe) 00435d2a3f [IMP] l10n_pl: Update of the polish accounts, groups and positions
Currently, the polish chart of account is not up to date and is therefore
underused by user since it is not relevant.

This PR aims to improve the polish chart of accounts, account groups and
fiscal position in order to make it usable by users.

This new chart of account and other elements linked to it that are modified
by the PR are based on the documents available on the gofin.pl website. The
chart of account is based on the one available at this link :
https://plankont.gofin.pl/ which was consulted on the 2nd of August 2023.

The polish chart of account should now be relevant and useable.

task-3332731

closes odoo/odoo#146452

Related: odoo/enterprise#52874
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-12-28 16:57:51 +00:00
Shaan Thakkar (THSH) 0080bff353 [FIX] portal_rating: fix review box border
Steps to Reproduce
===================
1. Go to website slides.
2. Open any Course.
3. Click on 'Add a review' or 'Edit your review'. 
-> Message box border is not visible.

After this commit
=================
The message box border will be visible
around the text area.

Task-3623765

closes odoo/odoo#146159

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-12-28 16:57:51 +00:00
Benoit Socias 55b818370f [FIX] website: request page name before duplicating pages
Since [1] page duplication was disabled because it caused an issue when
the same URL was used several times.

This commit runs through the `DuplicatePageDialog` to obtain a page name
when duplications are requested from the pages list.

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

task-3640878

closes odoo/odoo#147480

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-12-28 15:33:39 +00:00
tsm-odoo bb2a140a59 [FIX] bus, im_livechat: add guest channel instead of using context
In [1], a context object was added to websocket requests to subscribe
to guests channels on cors live chats. However, the common mechanism
to subscribe to record channels is to pass a string channel that will
then be validated by the `_subscribe` method of `ir_websocket`. This
approach works with OdooSH out of the box while the other one does
not.

This PR removes the mechanism introduce in [1] in favor of the string
approach.

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

closes odoo/odoo#147114

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-28 15:33:38 +00:00
Djamel Touati 40fb9ca18b [FIX] stock_account: update optional show fields for valuation report
Steps to reproduce the bug:
Go to inventory > reporting > valuation
The total value is hidden and the remaining is shown

Solution:
displaying total value as optional show and remaining_value as optional
hidden

opw-3644799

closes odoo/odoo#147661

Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-12-28 14:22:30 +00:00
sbel-odoo f83ce46fa2 [FIX] purchase, purchase_stock: add supplier discount on purchase order
Currently, when replenishing a product using a supplier that has a discount, the purchase order created didn't take the discount into account. It was set to zero.
Fix in `purchase` module, test in `purchase_stock` module.

Steps to reproduce:
-------------------
* Go to ´Inventory´ > ´Products´
* Select any product
* Configure the product:
* - Product type: storable
* - Enable ´can be purchased´
* - Under the ´Purchase´ tab, add a vendor with a discount price
* - Save
* Select ´Replenish´
* Select the vendor previously added
* Confirm
* Check the PO created

Why the fix:
------------
After debugging, I discovered that
```python
po_line_values.append(self.env['purchase.order.line']._prepare_purchase_order_line_from_procurement(
    procurement.product_id, procurement.product_qty,
    procurement.product_uom, procurement.company_id,
    procurement.values, po))
```
in `/home/odoo/odoo/addons/purchase_stock/models/stock_rule.py` would loose the discount value.

Discount can be found in `procurement.values.supplier.discount`.

Further investigation revealed that function `_prepare_purchase_order_line(self, product_id, product_qty, product_uom, company_id, supplier, po)` in `/home/odoo/odoo/addons/purchase/models/purchase_order_line.py` would not make use of the discount value.

In this function, we use the discount value from the seller instead of the supplier as the seller is computed in order to use the smallest discounted_price.

opw-3640396

closes odoo/odoo#147555

Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-12-28 14:22:29 +00:00
tsm-odoo be63841a6e [FIX] bus: fix non-deterministic channel managment test
This commit fixes a non-deterministic error in the bus module. Testing
the bus service is difficult because it relies heavily on async code.
Until now, `nextTick` was used but there is no guarantee that this is
enough. This commit introduces the `waitForChannels` method that
awaits the channel subscriptions to be done before resolving.

fixes runbot-21942,54467

closes odoo/odoo#147616

X-original-commit: 429a0668a4bed52eff1c7b8cd0c5c66261678699
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-28 13:09:29 +00:00
hapa-odoo 47852f79d2 [IMP] l10n_in_edi: made field Place of supply Selection only
In this commit,
- I have made the field  `Place Of Supply` Selection only.
- Now, the User will require to set the `Tin Number` on the
  `Place Of Supply(State)`. Otherwise, it will raise `UserError`.
- It is required to avoid errors given in the task description which isn't
  understandable for a user to understand.
- I have stopped the creation of a new state at the time of invoice creation.
  So, if the user wants to add a new state they can do so by
  `Contacts --> Fed. state`.

Task-id:- 3339099

closes odoo/odoo#147558

X-original-commit: b3a11e500a678f37f202d864a7726b1426f88d71
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-12-28 13:09:28 +00:00
Gabriel de Paula Felix (gdpf) 4bd40ec507 [FIX] microsoft_calendar: rollback sync view range approach
Before this commit, errors were introduced when optimizing the synchronization by limiting it to the calendar's view range. For users different than the first to synchronize its calendar, when trying to create events in Odoo before or after the synchronized view range (e.g. 1 month), these events were being auto-archived in Odoo right after their creation in Outlook. This happens because the first range to be sent to Microsoft Outlook is currently defining how much time in the past and in the future the events will be synchronized.

After this commit, the previous approach of defining a range of two years for the delta synchronization (events that were last updated) in the future is back temporarily, now with one year in the past. This behavior must be improved considering the calendar view range and must be flexible with the first synchronized view range.

Issue from: 3525764

closes odoo/odoo#147366

X-original-commit: 2a503c1b08bd31c9ac0098e774eea8dd5b5c2c1e
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Gabriel de Paula Felix (gdpf) <gdpf@odoo.com>
2023-12-28 13:09:27 +00:00
Louis (loco) e70a2eb0f6 [FIX] website: enable to add a description on form field
Steps to reproduce:
- Add a "Form" snippet on the website.
- Select the first field.
- Try to toggle the "description" option of the field.

-> Problem: there is no description added on the field.

The problems appeared since [this PR] and comes more precisely from
[this commit]. The problem is that one condition required to fill the
`default_description` parameter is that `field.type === "description"`.
This should not be the case. Indeed, here was the flow before
[this commit]; When the user toggled the description option,
`toggleDescription` assigned `field.description` to `true`. The field
was then rendered trough `renderField()`. During this rendering, the
system called the `website.form_field_description` template through
`website.form_field` independently of the field type. Because
`field.description` was set to `true`, a `div` with the description
"Describe your field here." was added on the rendered field. To solve
the problem, the `field.type === "description"` condition has been
removed as a condition to set the `default_description` parameter. Now,
as it was the case before [this commit], this parameter is filled either
if `field.description` is set, either if the field name is `email_cc` or
`email_to`.
The error probably comes from the fact that the name of the template
used to render the field is `"website.form_field_" + field.type`. As the
name of the template in charge of rendering the description is
`website.form_field_description`, the author probably thought that this
template should only be called when `field.type === "description"`. This
is not the case; the template `website.form_field_description` is always
called when rendering a field (independently of the field type through
the template `website.form_field`) but is only relevant if
`default_description` is set.

Note that this fix fixes also another bug:
- Add a "Form" snippet on the website.
- Add a field which is of type "Cc".

-> Problem: there should be a description of type "Separate email
addresses with a comma." on the field.

This commit also adapts the `website_form_editor_tour` tour to verify
that the description option works as wanted.

[this PR]: https://github.com/odoo/odoo/pull/130467
[this commit]: https://github.com/odoo/odoo/commit/363251986dcd753796b4b037a2da2e118b3e8e35

opw-3630348
opw-3604548

closes odoo/odoo#146115

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-12-28 11:45:49 +00:00
Romain Derie 60a3e7f926 [FIX] website: correct owl DuplicatePageDialog props
`onDuplicate` was marked as optional while it never was. If you don't
specify it, the call to `this.props.onDuplicate();` will still be
executed and will crash:
`Uncaught Promise > this.props.onDuplicate is not a function`

Randomly spotted while reviewing PR about duplicate button in list view
related to opw-3640878. But it's not related to it.

closes odoo/odoo#147647

X-original-commit: 296feaa9aa16cdb1766ce8d2f5ae8126d74f881b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-12-28 09:40:13 +00:00
Romain Derie eaf494328b [FIX] website: correctly sync website homepage url when page url change
This commit is fixing a last minute error in commit [1] after a push
force which move its code above the existing line `vals['url'] = url`.
After the code move, `vals['url']` was not the updated url value (which
went through slugify and unique path functions).

- Create a /test page, publish it.
- Set /test as homepage url directly on the website (in the settings)
- Go to that page
- Open the page properties and change its URL from /test to /test_un
-> The page url is /test-un but the website homepage_url is still
   /test_un (not slugified) in the website settings

[1]: https://github.com/odoo/odoo/commit/374a1b31f70a3209b1ae11db8e5886350579c7f9

closes odoo/odoo#147641

X-original-commit: 3c8a58b654418fc2fc0dc9bc28420c7dcb1bafee
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-12-28 09:40:12 +00:00
adsh-odoo a93956bb6b [FIX] website_slides: traceback while retaking quiz
Steps to reproduce
====================
1 Open the course and try to retake the quiz.
2 Traceback while submitting the quiz.

Technical
===========
Due to missing closing square bracket in the attribute selector of jquery.

After this commit
==================
There will be no traceback while submitting the quiz.

Task-3633410

closes odoo/odoo#147611

X-original-commit: eea7da64de4e6b70ea4d6b1fc277b36b278ad329
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-12-28 09:40:11 +00:00
Ritika Rathore a089b100ea [FIX] sale_timesheet: fix traceback while set empty in timesheet notebook
Steps to reproduce:
-------------------------
- Install project and sale_timesheet module
- Open the Project module
- Go to task's timesheet notebook
- Add a new line
- Set empty in so_line field, raises traceback

Issue:
--------
- In timesheet notebook, when we set so_line as an empty .it will raises
  traceback.

Cause:
---------
- #145821 when set empty so_line field there is undefined value read.

Fix:
-------
- On a field change, compare the so_line field value with proper record id check
  with new value.

task-3642371

closes odoo/odoo#147546

X-original-commit: ed2417225975001dd7b6ec1d3655fe880fe2c108
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-28 09:40:09 +00:00
sofiagvaladze 5faa73427f [FIX] hr_holidays: fix activity creation for second approval
Prior, if the time off type needed second approval, there was no activity generated for the responsible.

This commit fixes that. Moreover we also organize the code by taking
references out of the loop.

task - 3584190

closes odoo/odoo#142327

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-12-28 09:40:09 +00:00
sofiagvaladze f2516a2e73 [FIX] hr_holidays: allow message _subscribe to work in batch
In case more that one leave record in passed to message _subscribe
in will throw "Expected singleton" ValueError.

This commit fixed the issue.

Part-of: odoo/odoo#142327
2023-12-28 09:40:08 +00:00
Theo VINCENT (thvi) 7b95532d23 [FIX] pos_{adyen,self_order{,_adyen}}: permissions
- Adds some permissions to protect sensitive pos_adyen data and methods.
 - Reduces the risks of abuses of the pos_adyen features.

Those changes are not optimal. The whole system should be changed.

 - Fixes the printing of Adyen receipts data in the receipt.
 - Fixes an error when receiving a successful Adyen payment notification for the kiosk.
 - Fixes an error when Adyen returns an error for a payment for kiosk.
 - Fixes an error when requesting adjustment/capture to Adyen (pos_restaurant_adyen and kiosk).
 - Removes unused handling of adyen_latest_diagnosis field (the field will be removed in master).

closes odoo/odoo#140327

Task-id: 3500598
Signed-off-by: Théo Vincent (thvi) <thvi@odoo.com>
2023-12-28 09:40:08 +00:00
Djamel Touati d766d63b11 [FIX] purchase: Compute receipt_reminder_email based on the PO company
Steps to reproduce the issue:
- Have two companies in your database.
- Create a partner:
    - Set "receipt_reminder_email" to True for Company 1.
    - Set "receipt_reminder_email" to False for Company 2.

- Create a Purchase Order with Company 2.

Problem:
The field "receipt_reminder_email" is a related field, so its value
is False. However, if you switch the current company to "Company 1"
while keeping the Purchase Order in Company 2, the
"receipt_reminder_email" is updated to True.

Solution:
The field should be computed instead. the readonly for this field in not
neccessary anymore so the inverse is not mandoatory.

opw-3593577

closes odoo/odoo#147648

X-original-commit: 2211e08f69eed7af9be20f178f659f6a71fb6ac4
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-12-28 08:25:20 +00:00
Anh Thao Pham (pta) 78cbdc604e [FIX] web: fix checklist and blockquote style in report
Steps to reproduce:
- Go to Sales and create a quotation
- In "Terms and conditions" field, add a Checklist and a Quote,
using "/" command
- Print the quotation
=> Checkboxes are replaced by bullets and blockquote has no style.

Solution:
For blockquote in reports, use the same style than web_editor:
https://github.com/odoo/odoo/blob/b2fa69202c6b3ab677973643711ccd561a2edaea/addons/web_editor/static/src/scss/web_editor.common.scss#L648-L654

opw-3349082

closes odoo/odoo#147619

X-original-commit: 8d069bb036dea9b0fa68e89a8a1886424b6fcc46
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2023-12-27 20:54:10 +00:00
qsm-odoo 3ae5af0289 [FIX] website: restore timeline snippet date design
Each date in the timeline snippet was displayed with the time line going
through them. The line is supposed to be cut around the date. This
occurs since [1] which made it so `<span>` elements are automatically
removed by the editor if they do not have any attributes. Unfortunately,
this snippet relied on such a span, since [2]. This commit solves the
issue by making the snippet better (and the XML structure will further
be improved in the master forward-ported version). Unfortunately, this
is not entirely stable, even though it leads to the exact same result
provided no custom code tweaks the snippet. It will also solve existing
timeline snippets in current databases.

Note: [1] was obviously a mistake to merge in stable, although it might
be kept seeing the delay since it was merged and nothing critical seems
to have happened.

[1]: https://github.com/odoo/odoo/commit/a26e27c85e6a0685b6cf4d2dbab90453899df34c
[2]: https://github.com/odoo/odoo/commit/fbe38fb41dfdb76878748a1149f93700b566d228

task-3657771

closes odoo/odoo#147598

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-12-27 17:25:08 +00:00
miad-odoo 471563c38b [FIX] website_sale, *: allow zero price for specific products
*: website_event_sale, website_sale_slides, website_event_booth_sale

In website_sale, we have a setting to prevent the sale of zero priced products.
It works fine but triggers also on order of free events, free event booths and
free courses.

This is unwanted behavior and a check has been added to still allow those three
product types to be sold for 0.

Task-3388254

closes odoo/odoo#147589

X-original-commit: ab839650be3f04422aab8af81b72af475c0b6fd7
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-12-27 17:25:07 +00:00
Djamel Touati 19d5e1a222 [FIX] mrp: don’t check reserved qty for consu product
Steps to reproduce the bug:
- Create a storable product “P1”:
    - Tracked by: SN
    - BoM:
        - product qty: 1
        - Component: consumable product qty:1

- Create a MO to produce 12 unit of P1
- Update the qty of the consumable product to 31
- Confirm the MO
- Click on “Mass produce”

Problem:
An user error is triggered:
“It is not possible to unreserve more products of Consu than you have in stock”

The product is a consumable, we should not update its reserved quantity.

opw-3620437

closes odoo/odoo#147571

X-original-commit: 33728387925439eaf4971dc732ff46fd19432f2c
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-12-27 16:16:13 +00:00
Xavier ALT eb05e4889d [FIX] hr_contract: fix wrong salary structure in applicant salary conf.
To reproduce (on runbot):

- Enable "debug" mode
- Switch to company "My Begian Company"
- Go to: Payroll / Configuration / Contracts / Template

- Create a new contract template:
   * Name: Student contract template
   * Salary structure: Belgian Student
   * Job position: Student

- Create a new applicant for job position (Student)
  - name: John Doe
  - email: john@example.com

- Click "Generate Offer":
  - Contract Template: Student contract template
  - Click "Save"

- On the offer, click "Salary Configurator"

=> by default student has only 1 benefic in kind (regular pay) but on
the salary configurator you see many more entries listed (ex: 13th Month)
that are coming from another salary structure (Belgian Employee).

During the simulation as no employee exists (it's an applicant), a new
"temporary" employee is created and assignee to the contract; this
update the company which trigger a recomputation of the `structure_type_id`
field (since odoo/odoo@21aca4704) resetting its value to the country's
default.

This commit ensure we only reset that field when the country do change

closes odoo/odoo#147079

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-12-27 14:57:58 +00:00
tsm-odoo 56a10b4536 [FIX] mail: fix non deterministic steps in qunit tests
Several tests are non deterministic because they are using
`assert.verifySteps` at the wrong moment. Helpers such as
`afterNextRender`, `nextTick`, `Deferred` are used but those are
either not reliable or cumbersome to setup.

This PR introduces an asynchronous API on top of
`assert.step`/`assert.verifyStep`. This will wait until steps are
executed or until the timeout is reached.

fixes runbot-52660,54471,52794

closes odoo/odoo#147455

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-27 12:38:45 +00:00
Tiffany Chang (tic) b53d3cd726 [FIX] stock: always read field for default_order in move.line tree
Previous PR odoo/odoo#143570 moved some move line ordering logic from the
model to the view to avoid recomputing of these fields since it was
causing issues with the computes occurring at the wrong time.
Unfortunately every field used in the `default_order` in the view has to
be present in the view and since v16 any fields that have a groups
attribute that isn't met isn't loaded in the view.

Therefore we have to force the `result_package_id` to always be in the
view even if `stock.group_tracking_lot` is not true (i.e. packages are
active)

Steps to reproduce:
- create +save a receipt with a tracked product
- click on the burger button to open the detailed operations of the
  tracked product
- add 2 move lines + Confirm

Expected behavior:
the move lines save

Actual behavior:
JS traceback due to trying to sort on a field that isn't present in the
view

closes odoo/odoo#147188

Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-12-27 11:21:39 +00:00
Miquel Raïch ab0b9d1403 [FIX] stock: correctly calculate remainder in _compute_qty_to_order
When orderpoint.qty_multiple is decimal, then remainder may be wrong. The applied formula is: qty_to_order % qty_multiple = remainder

Examples:
510 % 10 = 0
51% 1 = 0
5.1 % 0.1 = 0.09999999999999937 which is rounded to 0.1 > 0
0.51 % 0.01 = 0.009999999999999998 which is rounded to 0.01 > 0

This PR fixes it.

closes odoo/odoo#147521

X-original-commit: e8f35a63fac9e9c3613c2b56fd6d65e79b64d6e9
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-12-27 10:07:20 +00:00
tsm-odoo 81de427ee0 [FIX] calendar: fix non deterministic calendar test
The `calendar notification` tests patch the `setTimeout` function.
This sometimes leads to infinite recursion when the `multi_tab`
service has enough time to initialize: this service make use of
`setTimeout` to call the `heartbeat` method repeatedly. Moreover,
patching the `setTimeout` method is not a good idea since it makes
this method synchronous which totally changes the flow that is tested.

This PR fixes this issue by using the `contains` helper instead: this
method will wait for the element to be inserted in the DOM and perform
the assertion afterwards.

closes odoo/odoo#147503

X-original-commit: 973db5a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-27 10:07:19 +00:00
Om Rabara 97f61bf3a7 [FIX] account: send & print invoice if there is no default email template
This error occurs because the user has deleted the default email template so
that it will not get the `default_mail_template_id`.

Steps to produce :
- Install the `Invoicing` module.
- Go to Settings > Technical > Email > Email Templates.
- Delete the `Invoice: Sending` email template.
- Open any existing invoice (not a draft one)
- Click on `Send & Print` button > Error will be generated.

Error : AttributeError: 'NoneType' object has no attribute 'id'

This issue is coming because here
https://github.com/odoo/odoo/blob/77d40f4e843d9f10bde93309087306117a538899/addons/account/models/account_move.py#L3869
it attempts to access the template id. In our case, since the template no longer
exists, it cannot retrieve the template id.
before this commit
https://github.com/odoo/odoo/commit/955091e707df1206ccda8314f1f182e2a37a8362
in previous version it sets the value if there is no default template id see
https://github.com/odoo/odoo/blob/eb8e2e98a429881f15b65b95fae41d2080b9bb24/addons/account/models/account_move.py#L3698

After this commit, if it cannot find the template, it will return a false value.

Sentry-4508631049

closes odoo/odoo#147104

X-original-commit: ffc80b30d66ce96bcdfa5444dc9b69ebe5f5aaad
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-12-27 10:07:18 +00:00
Thomas Becquevort (thbe) e2cf852150 [FIX] auth_totp: Ignore email alert for API connections
Description of the issue/behavior this commit addresses:

When 2FA is on on a user and he tries to use an API key to do a xmlrpc request,
the request fails. This is due to the system which choses whether or not to
send an alert via mail to look in the request's values while there is actually
no url request in that case.

Desired behavior after this commit is merged:

This commit adds a check to make sure a request is available before checking
its values.

opw-3645609

closes odoo/odoo#147475

Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
2023-12-27 08:49:59 +00:00
Demesmaeker 8994d0ff52 [FIX] sale_pdf_quote_builder: correctly fill editable fields
PDF written with scribus (and some other software) have a problem when filling fields: the output
does not work as expected. The replaced value is there, but hidden behind a blue overlay, shown
only when clicking on it.

We now show the field value and ensure filled fields are read only.

Additionally, some readers only allow a single value per field name. Even if the values were
different on the documents, only one would be shown. We now rename the fields to ensure they are
different when they have different values.

task-3626047

closes odoo/odoo#145163

Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-12-27 07:44:14 +00:00
Parth Solanki(PASO) 9f06286b2c [FIX] point_of_sale: invoice created for partner using qr code in receipt
Steps to produce
========================
- Activate QR code in pos config
- Open session
- Make an order for a certain partner (do not invoice)
- At receipt, scan the QR code
- Sign in as a normal user (like admin)
bug - Invoice is created for admin and not the partner in the order

After this commit
========================
The partner of the created invoice will be the partner of the pos order.

task - 3497301

closes odoo/odoo#147484

X-original-commit: 2b45e8732e39f13a6293ffda7bf9fed9e8d951f8
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Parth Solanki (paso) <paso@odoo.com>
2023-12-27 05:07:00 +00:00