Commit Graph
168497 Commits
Author SHA1 Message Date
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
Nasreddin Boulif (bon) c54a377490 [FIX] purchase: sent message with date_planned localised in PO timezone
Steps to reproduce:

  - Activate debug mode
  - Install `Purchase` module
  - Set user timezone to `Europe/Brussels`
  - Create a purchase order and add an order line
  - Set `Receipt Date` to any date in the future with time 01:00:00
  - Confirm the purchase order
  - Click on "Confirm Receipt Date" button
  - Check message in the chatter

Issue:

  The receipt date is the day before the one set in the purchase order.
  (Same issue when sending reminder by mail)

Cause:

  `date_planned` is stored in UTC in the database and used as it is in
  the message.

Solution:

  Convert `date_planned` to the order timezone before sending the
  message.

opw-3503928

closes odoo/odoo#147525

X-original-commit: 7407cf441ae271aa6a4e67c351a5d5ca8de30b08
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-12-26 22:56:44 +00:00
Nasreddin Boulif (bon) 26314ddf4f [FIX] project: display avatar in 'my tasks' page
Steps to reproduce:

 - Install Project module
 - Login as admin
 - Create a task an assign it to admin
 - Go to 'My Tasks' page (`example.com/my/tasks`)

Issue:

  The avatar of assignee is not displayed.

Cause:

  Using a row over two elements that are already in a table.

Solution:

  Add `px-0` bootstrap CSS class to the avatar.

opw-3592972

closes odoo/odoo#147369

X-original-commit: fc94a19c3ae66765a2f814533c17d6ec0f9533fb
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-12-26 20:37:09 +00:00
nda 9988231286 [FIX] website_sale: forbid payment if an error is displayed
steps to reproduce:
- as admin, go to /shop and add a storable product to cart
- disable all delivery methods
- use a coupon to set the price to 0

before this commit:
- the payment button is clickable even if there is a big red
warning saying "Sorry, we are unable to ship your order"

after this commit:
- the payment button is hidden if an error is displayed and
the route /shop/payment/validate is blocked if there is an
error displayed

opw-3582207-nda

closes odoo/odoo#146251

X-original-commit: 6db61c5cc0ca49a31252985fa2d690cb6514e7f7
Related: odoo/enterprise#52753
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Nicolas Danhier (nda) <nda@odoo.com>
2023-12-26 18:08:20 +00:00
roen-odoo 4f9d623d41 [FIX] pos_sale: prevent crash of modified quotation with settled order
Current behavior:
When a quotation is modified and the order is settled in the same time,
you get an error when trying to pay for the order.

Steps to reproduce:
- Create a quotation with 3 lines
- Settle the order in the PoS
- Modify the quotation (remove one line)
- Go back to PoS, and try to pay for the order

opw-3614770

closes odoo/odoo#147499

X-original-commit: 7e48111a9678c5acf8188796824f2cb9b4f1af9d
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-12-26 17:00:37 +00:00
nda 54e2fa15f8 [FIX] point_of_sale: retrieve unit price from sale order line
Unit price is recomputed on non groupable order line instead
of being the same as its sale order line counterpart.

Steps to reproduce:

- make sure unit measure category are not groupable
- create a sale order and add a line with a product with UOM
unit (ex: acoustic bloc screens) and quantity 3
- change the default unit price (100$ instead of 295$)
- open the point of sale
- open the SO and click on settle the order
=> price is 295$ instead of 100$ on each of the 3 lines

opw-3569481

closes odoo/odoo#147487

X-original-commit: 00d8a876c501098da1e8b2f7484e5e3808b61865
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Nicolas Danhier (nda) <nda@odoo.com>
2023-12-26 17:00:36 +00:00
Walid a9ff983d8f [FIX] purchase_stock: bill before reciept
Steps to reproduce:
- Create a product with AVCO that you invoice on Ordered quantities in the Vendor tab.
- Create a PO with a value of 200
- Create an invoice and change the price to 100. Then cancel the Invoice.
- Create a new invoice and confirm it without changing anything (so price is 200)
- Receive the product
- The valuation will be 150, the average of the 2 invoices.

Bug:
all linked invoices are taken into account

Fix:
only consider posted ones

opw-3633051

closes odoo/odoo#147485

X-original-commit: b899edd5b9c2f5e813fc0a83ea5506672785f47b
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-12-26 17:00:35 +00:00
Andrea Grazioso (agr-odoo) 93fe7f9e6a [FIX] purchase_stock: traceback on empty date
Configure a product having category set with:
- Costing Method: Average Cost (AVCO)
- Inventory Valuation: Manual
Create a purchase order with the product
Confirm
Receive Products
Create bill (do not set date)
Confirm

Traceback will appear:
'AssertionError: convert amount from unknown date'
It occurs because of an attempted currency conversion without a date
As the bill is without date it should raise an UserError instead

opw-3628295

closes odoo/odoo#147367

X-original-commit: 03436a006f31f4bf42336fe31514161562c9b180
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-12-26 17:00:34 +00:00
clesgow 1f1a95282d [FIX] stock: avoid recomputing the schedule_date too early
Steps to reproduce:
- Inventory -> Delivery -> New Planned transfer
- Add two lines with two different products and save
- Set different scheduled dates for each move
- Set the earliest move quantity_done to the demand
- Validate and create a backorder

Issue:
The done picking scheduled date will be changed to the latest move (that
is moved to the backorder).

This is due to a recompute of the picking's scheduled_date *before* the
remaining moves are assigned to the backorder.

Note:
The order on the `stock.move.line` had to be removed, as it forced a
recompute of the original picking *before* the assignation of the
remaining moves to the backorder.
What happens is :
- Updating the move will check its move lines
- To follow the SML order, it will need their pickings
- To follow the picking order, it will need their scheduled date
- Their scheduled dates can be out of date (since we already put some
moves to `done`)
- This will lead to a recompute of the original picking's scheduled date

Instead, what we do is adapt the changes from odoo/odoo#79069, moving
the order from the model to the reports where it's used.

opw-3346598

closes odoo/odoo#147330

X-original-commit: 92092420548cb68db03ac139c23608fc1aa3a7cd
Related: odoo/enterprise#53320
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2023-12-26 15:49:37 +00:00
tsm-odoo d8c95bddec [FIX] mail: fix non deterministic crosstab test
The "Channel subscription is renewed when channel is left" test
ensures the bus subscription is renewed when the user leaves the
channel. In order to do so, the test relies on a patch of the bus
service and awaits the `waitUntilSubscribe` helper. This is not
correct: the subscription will never be triggered since the bus
service method is patched to only call `assert.step`.

This test passes most of the time by luck: `waitUntilSubscribe`
detects the first subscription (the one that is triggered when
starting the bus service) and the delay is most of the time enough for
the step to be ready.

This PR fixes the issue by:
- waiting the first subscription to ensure it does not interfere with
the test.
- removing the bus service patch: waiting for the subscription is
enough.

fixes runbot-46941

closes odoo/odoo#147255

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-12-26 12:21:47 +00:00
Pedram (PEBR) fb203ec2b4 [FIX] point_of_sale: prevent assignment of payment method during copy
Befoer this commit, duplicating a POS payment method led to automatic
assignment to the source payment method's POS configs. This behavior
caused issues, particularly when the POS session was open.

opw-3635647

closes odoo/odoo#147238

X-original-commit: 0725850a9d2893ea80518575735ca407cc608968
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-12-26 11:03:19 +00:00
Benoit Socias f2bee5d2a1 [FIX] web_editor: restore gradient custom buttons
Since [1] when the `Colorpicker` template cache was moved from
`ColorPalette` to `getColorPickerTemplateService`, the custom buttons
fill color cannot be set as a gradient anymore.
This happens because the needed `getTemplate` props is injected for the
font and background colors, for the `we-colorpicker` but not for the
link tools color palettes.

This commit restores the gradient color selection for custom buttons by
linking the `getColorPickerTemplateService` to the link tools color
palettes.

Steps to reproduce:
- Edit Home page.
- Click on "Contact Us" link in header.
- Select link style "Custom" in link tools.
- Open "Fill Color" palette.

=> Gradient tab was not shown in palette.

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

task-3641914

closes odoo/odoo#147373

X-original-commit: 087861bcbfe444765fdb0b81e0398c12d8db34e8
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-12-26 08:36:46 +00:00
dominikkertys 19c4b3a2ef [CLA] Update 26house CCLA
closes odoo/odoo#147295

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-12-26 08:36:45 +00:00
Romain Derie cb1ad42130 [FIX] website: make anchor links work in offcanvas mobile menu
A anchor menu in the mobile offcanvas related to an element in the
current page doesn't work in offcanvas:
- The offcanvas doesn't close
- The page doesn't scroll to the clicked location

This is because the menu anchor navigation is hooked to use our own
scrolling behavior instead of the browser one.

Doing so, we preventDefault, which prevent the offcanvas menu to close
itself when clicking on a anchor menu.

This commit simply manually closes the offcanvas and once the closing
animation is complete, starts our own smooth scrolling.
It also targets the desktop offcanvas menu (when hamburger layout is
selected) so it got a smoother UX: it closes then scrolls, instead of
scrolling but not closing.

Another possibility would have been to just close manually the offcanvas
without a preventDefault and without a call to our custom scrolling
method.
Doing so, the browser would naturally scroll to the element while we
close the offcanvas but it would be less elegant as you wouldn't see the
scrolling animation.

Note that the offcanvas was introduced with commit [1].

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

opw-3604963

closes odoo/odoo#146907

X-original-commit: db881e66785a866319bd4980a9ae7b6393e55457
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-12-26 08:36:44 +00:00
Romain Derie 97333d421f [FIX] test_lint: sync with regular rslintrc file
Keeping things in the same order between both files will help when
modifying this file later.

After this commit, the `globals` in both files are 100% sync'd.

Part-of: odoo/odoo#146907
2023-12-26 08:36:44 +00:00
Romain Derie 9e8651d5e2 [FIX] web, test_lint: regroup bootstrap globals
A later commit will add `Offcanvas` as new bootstrap global in the
eslintrc files.
Since the globals are randomly sorted, the chance is taken to regroup
those.

Part-of: odoo/odoo#146907
2023-12-26 08:36:44 +00:00
Romain Derie b68914221f [FIX] web, test_lint: remove afterEach from eslintrc test suite
Commit [1] added a call to "afterEach" and added it to the test suite
eslintrc but since it's only called there from the testing suite once
and since it was not sync'd in the regular eslintrc, it's better to add
it as a global in the file directly.

[1]: https://github.com/odoo/odoo/commit/84389729392df491d5a67ebe25a8fa44beac1930

Part-of: odoo/odoo#146907
2023-12-26 08:36:44 +00:00
Romain Derie 5081951213 [FIX] web: remove "_" from eslintrc
Underscore was removed with commit [1], this is most likely a leftover.

[1]: https://github.com/odoo/odoo/commit/28e1e61e5c419ee7aa0e6268d7899dcfa115d333

Part-of: odoo/odoo#146907
2023-12-26 08:36:44 +00:00
Romain Derie 318dde2029 [FIX] web_editor, website: hide animation option when cors protected img
Before this commit, the "on hover" animation option would be shown for
images of type url-attachment-redirect.
Selecting that "On Hover" option value would result in a crash if the
image was CORS protected (which is often the case).

Steps to reproduce:
- Drag & drop "Text - Image" snippet
- Double click on an image to replace it
- Select in the media dialog "Add URL" and insert a CORS protected
  image URL
- The image is correctly added, and its url is something like
  `/web/image/123-redirect/xxx.jpg`
- Click on the image and then click on its "Animation" option and select
  "on hover" as value
-> It crashes

The same error will happen with absolute URL of a CORS protected image
(instead of the relative local redirect attachment-url
`/web/image/123-redirect/xxx.jpg`).

Technical stack:
> the XML option `data-animation-mode="onHover"`
  > call the js method `animationMode()`
    > calls `trigger_up('enable_hover_effect')`
      > calls `setImgShape()`
        > calls `_applyShapeAndColors()`
          > calls `_writeShape()`
            > calls `applyModifications()`
              > calls `loadImage()` which fails to load the image

-----------

Technical note: JS `fetch()` takes advantage of the browser cache, no
need to create a `Map` cache for it, despite the `_computeVisibility()`
method being called multiple times.

----------

Related to commit [1].
The code is failing since commit [2] which added the "On hover" image
animation.

Other animation values won't fail. And not-cors-protected images will
work fine with the on hover option.

[1]: https://github.com/odoo/odoo/commit/f0fe283c761cd6b1d7293dd41795ac6fc721e341
[2]: https://github.com/odoo/odoo/commit/7f730f81ec541cc7791fc6b3fded17c838433f85

closes odoo/odoo#146732

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-12-26 07:33:27 +00:00
Romain Derie fc8248e4b6 [FIX] web_editor: also remove img animate class when cleaning attributes
There is a code in charge of removing image animation attributes, but
this code was not removing the `o_animate_on_hover` class.

Probably not that big of a deal but during the investigation of a bug,
this class was not removed while the attributes where, which seems to
lead to a crash later.

Related to commit https://github.com/odoo/odoo/commit/7f730f81ec541cc7791fc6b3fded17c838433f85

Part-of: odoo/odoo#146732
2023-12-26 07:33:27 +00:00
Romain Derie c3d796d044 [FIX] web_editor: prevent crash if data-shape-colors is not set
There is cases leading to have a `data-shape` but no
`data-shape-colors`. It then makes the code crash.

Step to reproduce:
- Drag & drop "Text - Image" snippet
- Double click on an image to replace it
- Select in the media dialog "Add URL" and insert a CORS protected
  image URL
- The image is correctly added, and its url is something like
  `/web/image/123-redirect/xxx.jpg`
- Click on the image and then click on its "Animation" option
-> It crashes

In such a case, the code was crashing on the line below this fix:
`img.dataset.shapeColors.split(';')`

The modified code here is related to commit [1].
But the code only break in Odoo 17, probably following commit [2].

[1]: https://github.com/odoo/odoo/commit/cd403480f90cf7103651f3be818a14b06d3c73ca
[2]: https://github.com/odoo/odoo/commit/7f730f81ec541cc7791fc6b3fded17c838433f85

Part-of: odoo/odoo#146732
2023-12-26 07:33:27 +00:00
kcv-odoo 513be97b2f [IMP] payment_razorpay: support tokenization in Razorpay's "Payment" gateway
See README for technical details.

task-3495914

closes odoo/odoo#143525

Related: odoo/documentation#6732
Signed-off-by: Kartik Chavda (kcv) <kcv@odoo.com>
2023-12-24 07:01:14 +00:00
Odoo Translation Bot 50e8e08183 [I18N] Update translation terms from Transifex 2023-12-24 00:18:24 +01:00
Olivier Dony 9de51e74f3 [FIX] tools: update default hashing rounds
The default is 25000 rounds, which is too low nowadays.
An off-the-shelf laptop takes ~400ms for a single hash at 600k rounds.

closes odoo/odoo#147202

X-original-commit: e200e96bfbb9cc29771b3727231e2f9a9ae01825
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
2023-12-23 19:13:42 +00:00
Rémy Voet (ryv) 914ac6d0b9 [FIX] tests: fix assert message of required field check
closes odoo/odoo#147400

X-original-commit: 0b9257009154eb92a723f72ad64a31cf9b577748
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-12-23 17:01:38 +00:00
Andrzej(pian) b0067dfd72 [FIX] mail: mime type alias
Some printers incorrectly specify the content-type of PDFs as "pdf" instead of
the correct "application/pdf." To handle this situation,
an alias has been introduced, treating content-type "pdf" as "application/pdf."

[Reproducing original bug]
1. run odoo with documents module
2. prepare email file
2.1 create email with a pdf attached
2.2 export email to .eml
2.3 modify content-type of the pdf from "application/pdf" to "pdf"
3. send prepared email to odoo to inbox-financial alias (the default one
   creating documents)
4. Go to documents, observe that the created PDF is blank!

[Motivation for fix]
Since:
1. Odoo uses the Python built-in module for parsing emails*
    (the actual issue lies outside Odoo code).
2. "pdf" is not an accepted MIME type according to current norms
    (https://datatracker.ietf.org/doc/html/rfc6838#section-4.2).
It's not an actual Odoo bug.
However, redirecting this issue to the appropriate printer manufacturer and
waiting for a fix may be time-consuming, hence the proposed fix.

*function parsing email with the Python built-in module
https://github.com/odoo/odoo/blob/407ea60796a2b18eb02f5569e1cfab9f1163a572/addons/mail/models/mail_thread.py#L1282

opw-3462260

closes odoo/odoo#147363

X-original-commit: e95a19341536e442239a7e940089d7f66ab9f534
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-12-23 15:09:31 +00:00
Levi Siuzdak (sile) 41b4f14d8b [FIX] project: remove task_properties from project sharing view
Versions:
---------
- saas-16.2+

Steps to reproduce:
-------------------
1. Have a project with tasks & sub-tasks;
2. invite portal user to project;
3. log in as portal user;
4. go to a sub-task;
5. click the parent task button.

Issue:
------
Javascript is trying to get the type attribute of an `undefined` value.

Cause:
------
Commit 590beec447 added `task_properties`
to `view_task_search_form`, this search view is used by
`action_project_sharing_view_parent_task`, bringing it into view for
portal users who do not have read access to this field.

Solution:
---------
Add a `search_view_ref` to the context to force using
`project_sharing_project_task_view_search` instead.

opw-3498012

closes odoo/odoo#147377

X-original-commit: 47b0f6a42464ff41d40507cec5771b6dc3131d47
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-22 22:58:50 +00:00
Bastien (bvdn) 78ab391990 [IMP] product: reset product catalog quantity to 0 when user inputs empty value
When the user inputs nothing in the setQuantity input in the product catalog input,
NaN is fixed in the productCatalogData.quantity value, which is fine for the backend
since the NaN will be converted to Null then 0 when fixed in the SOL qty_product
but the product card will display an empty input which is not good.

with this change the productCatalogData.quantity will be fixed to 0, making the input space
(and minus/plus buttons) disapear, which is more logical since the product quantity has
been set to 0

In addition to this it'll prevent a traceback in industry_fsm_sale module where we used
float_round() to fix the product quantity, which doesn't handle Null value

Task-3599491

closes odoo/odoo#142523

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-22 22:58:49 +00:00
Brice bib Bartoletti 6e652c94b5 [FIX] account_report: prevent tax tag renaming
The aim of this commit is to prevent the tax tag to be renamed when the
engine and the formula are changed at the same time.

Context:
For the french report, we had to introduce new expressions and change
the existing ones.
The nex expression would have the same formula than the previous one and
the old one would change their engine and formula.

Before this commit:
The tags are renamed to match the new formula.
This would be useless as the new engine won't use those tax

After this commit:
The tags aren't renamed.

closes odoo/odoo#147392

Task-id: 3607253
X-original-commit: 659f20add8b7c9c1a342a021bfc3c80316816c22
Related: odoo/enterprise#53341
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-12-22 21:37:44 +00:00
Julien Van Roy 4667fdd695 [FIX] l10n_fr: support french fiscal rounding
Each line of the french VAT report should be rounded to the unit. In
addition, the tax amounts should be recomputed using the rounded base
amounts!

The rounding of each line is enabled using the 'integer_rounding' option
introduced in
https://github.com/odoo/enterprise/commit/1916433a951fb98baf1a54e6b6e0f8a3f59920a4.
The recomputation of the tax lines base on the rounded base lines is
done using aggregation expression (so the `tax` tags are no longer used
in the report).

The rounding difference is accounted during the closing entry.

task-3607253

X-original-commit: 12477a5401c4d0eaf39c87c17afc7f82d9018986
Part-of: odoo/odoo#147392
2023-12-22 21:37:44 +00:00
guva-odoo c9c50a92a0 [FIX] account, analytic: add analytic distribution, remove precompute
Related to https://github.com/odoo/enterprise/pull/52648
we add the analytic distributino to the move vals for
the exchange diff move.
We also remove the precompute on the fields, manual backport
of https://github.com/odoo/odoo/commit/b9047febf3c4d67ce409f9f1dba8a9cc7c7165fe

opw-3603668

closes odoo/odoo#147332

X-original-commit: 41b38f1dc7df824e6c09e66e293e82f2823915aa
Related: odoo/enterprise#53322
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-12-22 18:42:23 +00:00
Maruan Aguerdouh (magm) 6afe525d93 [FIX] sales_team, crm: field template not missing for mobile view
Steps to reproduce:

- Install Contacts and Sales.
- Activate debug mode and go to contacts.
- Create new contact and get the mobile view inside the contact form.
- Go under Sales & Purchases and look for sales team.
- Try to change it in mobile.

The issue is that we were missing the template view for these specific
fields when on mobile, specifically we didn't had the proper kanban view
set for these fields.

opw-3323976

closes odoo/odoo#147365

X-original-commit: 52992f9cbd94aaea6d1500f20862bf2d6fa811ab
Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
2023-12-22 17:35:53 +00:00
aliya 2d0cf9bdb9 [FIX] l10n_ee: add taxes with the new VAT rate
The VAT rate is increasing from 20% to 22% from January 1st, 2024.
We need to keep both 20% and 22% taxes until the end 2025 for phasing out period.
20% taxes will be inactive for new customers.

task-3615036

closes odoo/odoo#147331

X-original-commit: 2c41415f1010fac3bfcc510fc08f659cfe009420
Related: odoo/enterprise#53321
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-12-22 17:35:52 +00:00
Anh Thao Pham (pta) a8dfb18dfa [FIX] account_payment: fix portal pay button
Steps to reproduce:
- Install Accounting
- Activate a payment provider (e.g. Stripe)
- Configure payment provider with "Capture Amount Manually" option activated
- Invoice Online Payment in Accounting settings
- Create an invoice
- Go to invoice portal preview
- Pay it via "Pay Now" button
- Go back to invoice portal preview
=> The "Pay Now" button is still there (not expected)

- Uninstall "account_payment_invoice_online_payment_patch" module
- Go back to invoice portal preview
=> The "Pay Now" button does not appear anymore (expected)

Cause:
"account_payment_invoice_online_payment_patch" module has been created to
allow to disable invoice online payment without uninstalling "account_payment"
module.

However, it overrides 2 different "t-if" conditions:

1) (invoice.amount_residual or not tx_ids) and
   invoice.state == 'posted' and
   invoice.payment_state in ('not_paid', 'partial') and
   invoice.amount_total

2) invoice.state == 'posted' and
   invoice.payment_state in ('not_paid', 'partial') and
   invoice.amount_total and
   invoice.move_type == 'out_invoice' and
   (pending_manual_txs or not tx_ids or invoice.amount_paid < invoice.amount_total)

with the same condition "invoice._has_to_be_paid()" that corresponds to:
   (self.amount_residual or not transactions) and
   self.state == 'posted' and
   self.payment_state in ('not_paid', 'partial') and
   self.amount_total and
   self.move_type == 'out_invoice'

One part of the second "t-if" condition is removed by the override:
(pending_manual_txs or not tx_ids or invoice.amount_paid < invoice.amount_total)

The second condition is used and is overridden 2 times.

Solution:
Add (pending_manual_txs or not tx_ids or invoice.amount_paid < invoice.amount_total)
in the "_has_to_be_paid" method.

opw-3378400

closes odoo/odoo#147316

X-original-commit: df110bb524f780433cdaf64e482329989e9d513b
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2023-12-22 16:14:54 +00:00
Gitashri Mantha(gman) 06d6000ae9 [FIX] delivery: return label portal download
Before this commit
================
- Portal users were not able to download the return label via the portal because
the Access token is not passed.

After this commit
================
- Portal users are able to download return labels via the portal.

task-3245766

closes odoo/odoo#147315

X-original-commit: 2b9fe4854078e237b5da7e97e4ff3fa8d6c270a9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-12-22 16:14:53 +00:00