Commit Graph
20 Commits
Author SHA1 Message Date
Saurabh Choraria 90f235fcef [FIX] base: raise ValueError when user enters wrong path
When the user tries to add properties field in domain of a model
without property name the error occurs.

To reproduce the issue:
- Install knowledge module.
- Go to Settings > Technical > User Defined Filters.
- Enter a name, add 'Knowledge Article' as model and then add domain
[('article_properties', '!=', False)].
- Click on save button and then on refresh button below code editor of domain.
- The traceback will be generated

Error: IndexError: list index out of range

The issue is occurring because we are getting single element
in path over here -
https://github.com/odoo/odoo/blob/f4e60765db57fe3612f267e8fa44d10ccf5ff107/odoo/osv/expression.py#L649
but we are trying to access path[1] due to which IndexError is occurring
over here -
https://github.com/odoo/odoo/blob/f4e60765db57fe3612f267e8fa44d10ccf5ff107/odoo/osv/expression.py#L683
and here -
https://github.com/odoo/odoo/blob/f4e60765db57fe3612f267e8fa44d10ccf5ff107/odoo/osv/expression.py#L687

The condition is also wrong over here -
https://github.com/odoo/odoo/blob/f4e60765db57fe3612f267e8fa44d10ccf5ff107/odoo/osv/expression.py#L683-L684
in which we are checking length of path is not equals to 2 and then also
we are trying to access path[1], due to which ValueError becomes a dead code.

To fix this issue 'and' is replaced with 'or' in that condition.

sentry-4499339271

closes odoo/odoo#141533

X-original-commit: da41853fc93a60a0a05083d79f0bb08f429cded9
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-11-08 12:14:50 +00:00
Saurabh Choraria 85b5ddfc0d [FIX] base_import: accept single character in text delimiter
When a user tries to import the CSV file with an empty text delimiter
or more than one character in text delimiter at that time the traceback
will be generated.

Steps to reproduce:
- Install Accounting module.
- Click on import in the bank statement.
- Select any CSV file for the bank statement line or can download and import
this file - https://drive.google.com/file/d/1lnScw4RN6T01pOkyNON8vvb3FQOPiy1O/view?usp=drive_link
- Enter empty text delimiter or more than one character in text delimiter.
- Click on the test or Import button.
- Error will occur.

Error: ValueError: Unsupported file format "text/csv", import only supports
CSV, ODS, XLS and XLSX

The issue is occurring because text delimiter (options['quoting']) is used
as quotechar while reading csv file and quotechar is always a single
character string. Check here -
https://github.com/odoo/odoo/blob/0fde590bee71618f78e5f954349530bd007c62cf/addons/base_import/models/base_import.py#L494-L497

To solve this issue the length of text delimiter has been checked and if it
is not equal to one then a warning is given to the user.

sentry-4390461991

closes odoo/odoo#138638

X-original-commit: 1f4aa620779ebe6a0cb7f7ca1910080a258d6fac
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-10-13 14:14:05 +00:00
Saurabh Choraria 2cf99aa452 [FIX] web: groupby date for pivot view
When user tries to apply any Group By as date or datetime in the pivot
view and the column value of pivot view is also a date or dateime, the
traceback will be generated.

To reproduce the issue:
- Install Point of Sale
- Go to 'Reporting' and click on 'Orders'
- Select pivot view
- Go to Group By and select 'Order Date' same as column value
- Issue can be produce in the same way in other modules, such as - 'sale',
'sale_subscription', 'crm', 'planning', 'hr_expense' etc.

Error: TypeError: can only concatenate str (not "relativedelta") to str

The issue is occurring because we are getting duplicate values in
groupby like ['date:month', 'date:month'] while calling orm method over here -
https://github.com/odoo/odoo/blob/6cf3b617d8082df5820283d07e6623b7684cefdd/addons/web/static/src/core/orm_service.js#L143

To solve this issue groupby has been passed into a Set so that no
duplicate values occurs in groupby.

sentry-4262719543

closes odoo/odoo#137550

X-original-commit: de8e6a901b780d8c10484edae5ec1fe6b9fc7d3c
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-10-04 20:52:42 +00:00
Saurabh Choraria efe41244b6 [FIX] auth_signup: update log while SignupError occurs
When a user tries to signup in odoo and enters an invalid email address
a logger error occurs which creates noise in sentry.

Error: SignupError('Login must be a valid email address : tme')

The logger is updated to use the 'warning' level instead of the 'error' level.
This change reflects a less severe logging level for cases when SignupError
occurs while signup.

sentry-3933777844

closes odoo/odoo#135343

X-original-commit: b59d0ef1568adc3296534f2dc5542afc02e04b1b
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-09-14 04:42:43 +00:00
Saurabh Choraria f893eef973 [FIX] base_import: raise ImportValidationError when invalid seperator selected
When a user tries to import the CSV file with a different separator at that
time, the values in mapper and rows_to_import are not correctly mapped. So
the traceback will be generated.

Steps to reproduce:
1. Click on import in the bank statement.
2. Select any CSV file for the bank statement line or can download and import
this file https://drive.google.com/file/d/1lnScw4RN6T01pOkyNON8vvb3FQOPiy1O/view?usp=drive_link
3. Select any separator other than a comma.
4. Click on the test or Import button.
5. Error will occur.

Error: IndexError: list index out of range.

To solve this issue, a row's length is checked with the
number of fields.

sentry-4021250095

closes odoo/odoo#134596

X-original-commit: 0eb30132c14420d42f88a5f54a81ba1dc51a867c
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-09-07 04:53:26 +00:00
Saurabh Choraria f7d43662e3 [FIX] web: update log while error in generating report
When there is an error in a report and user tries to
download that report a logger exception occurs.

Exception: Error while generating report
studio_customization.studio_report_docume_1c084f7d-9ac2-4dd4-9977
-03d87251392c

The error occurs from report_download controller -
https://github.com/odoo/odoo/blob/0d70e38ab4bab850ee4bddc7b21b4c6c10809294/addons/web/controllers/report.py#L136

The logger is updated to use the 'warning' level instead of the 'exception'
level when an error occurs while generating report.

sentry-4321014875

closes odoo/odoo#132528

X-original-commit: 1210e1c7bc97ea772df5d2230a3b8f42b13e9e10
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-08-21 17:01:02 +02:00
Saurabh Choraria ea9d6649ee [FIX] base: handle error when editing comment in view's architecture
Currently, When the user is adding a double hyphen or space or anything within a
comment in a view's architecture and tries to save the view, then an error
occurs.

To reproduce the issue:
1. Go to Settings > Technical > Views > open a view.
2. In View Architecture comment out a line.
3. Add a double hyphen or space or anything within the comment.
4. Then save manually, the error will occur.

To solve this issue the error has been handled using a try-except block in
'parse_html' method.

sentry-4306359331

closes odoo/odoo#132267

X-original-commit: ba6f90fac142ae53995f4fce4b75799e61b95b6c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-08-19 10:05:45 +02:00
Saurabh Choraria 3d38f684d5 [FIX] payment_stripe: update log when creation of payment intent fails
When the payment method was detached from the customer, trying to pay with the
linked payment token would end up with a crash because Stripe failed to send us
the payment intent, as it could not create it. In that case, a logger error
occurs on the server which creates noise in the sentry.

Error: The creation of the payment intent failed.
Stripe gave us the following info about the problem:
'Your card has insufficient funds.'

The logger is updated to use the 'warning' level instead of the 'error' level.
This change reflects a less severe logging level for cases where the creation
of payment intent fails.

sentry-4363481906

closes odoo/odoo#131334

X-original-commit: 772457554083847eb6088509ed57acff86702783
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-08-09 11:52:08 +02:00
Saurabh Choraria 81fe7464f3 [FIX] auth_signup: prevent traceback when mail template is not found
When user deletes 'Settings: Unregistered User Reminder' record from
'mail.template' model and when 'Users: Notify About Unregistered Users'
scheduled action is executed at that time traceback is generated on the user
side as well as in the log.

Applying this commit will fix this issue.

sentry-4174950325

closes odoo/odoo#129461

X-original-commit: 2a77e72a27ebd2bdbf32995f34d219f51d33dacf
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2023-07-25 17:36:00 +02:00
Saurabh Choraria a85bc31c04 [FIX] website_slides: prevent traceback while accessing archived embedded slide
When user archive a slide from a course and try to access route
'/slides/embed/<int:slide_id>' of that particular slide, user get the error.

steps to reproduce:
    1. Go to Website and click on courses menu.
    2. Open a course and archive a slide in it.
    3. Then go to '/slides/embed/<int:slide_id>' route.
    4. Access that particular slide that you have archived in route.
    5. The error will occur.

Applying this commit will fix this issue.

sentry-4025579653

closes odoo/odoo#128797

X-original-commit: c097112109fb2de003242bda89e10e656236b774
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-18 11:42:39 +02:00
Saurabh Choraria de782a680d [FIX] payment_stripe: handle error for unsupported country while stripe setup
Currently, When a user tries to set up a stripe account but his country is not
supported by stripe then he receives a error message at backend side and a
ValidationError ("Stripe Proxy: An error occurred when communicating with
the proxy.") on frontend side.

After applying this commit the error message will be updated to a warning level
which will reduce the noise in sentry. I have also added a condition in
'action_stripe_connect_account' method to check whether the country is
supported by stripe or not and if it is not supported the user will be
redirected to other payment providers page.

sentry-3935758343

closes odoo/odoo#128140

X-original-commit: c7b0d8eebe686d9c38f9f5c71577c80718ffb791
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-07-15 04:01:14 +02:00
Saurabh Choraria 5ee7fa1e29 [FIX] auth_signup: prevent traceback while connection refused of SMTP server
When there is no valid outgoing mail server and user tries to send email by
'send an invitation email' or 'send password reset instructions' button, it
shows the error in our locolhost.

see this traceback : https://tinyurl.com/2fdn2m5z

steps to reproduce :
    1. Go to users in settings and select a user.
    2. Click on 'send an invitation email' or 'send password reset instructions'
       button
    3. the error will occur.

Applying this commit will resolve this issue.

sentry-3961333326

closes odoo/odoo#117613

Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2023-07-03 21:55:43 +02:00
Saurabh Choraria c3ffbd338b [FIX] partner_autocomplete: update log when sending partner to sync fails
In the start_sync method, the logger is updated to use the 'warning' level
instead of the 'error' level. This change reflects a less severe logging level
for cases where sending a partner to sync fails.

The changes have been made to reduce the noise level in the sentry.

sentry-3955309841

closes odoo/odoo#126111

X-original-commit: c1b608c2d28962ed0ccbf15e9eeb2ecf5281b758
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
2023-06-26 15:12:03 +02:00
Saurabh Choraria 2a9d0ce128 [FIX] base_geolocalize: update log when request to openstreetmap fails
When the user will not get an HTTP response as 200 while retrieving the location
using OpenStreetMap Nominatim service, the logger error will occur.

The logger is updated to use the 'warning' level instead of the 'error' level.
This change reflects a less severe logging level for cases where a request to
OpenStreetMap fails.

sentry-4151622143

closes odoo/odoo#125835

X-original-commit: a73a65efc0daa702b6a3fd40ad63d2ef39ace302
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-06-21 15:53:15 +02:00
Saurabh Choraria 93b7463113 [FIX] event_sms: check model of sms template
When notification type is set as sms we need to check whether the template
which is referenced is coming from a correct model or not.

Applying this commit will fix this issue.

sentry-4195133685

closes odoo/odoo#125831

X-original-commit: 745bcab5ee524ae1c42e5773a86b15ef3a7019d3
Related: odoo/enterprise#42882
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-06-21 06:57:53 +02:00
Saurabh Choraria 8e93e0e6e3 [FIX] base: prevent traceback when Portal User Template is not found
When user deletes 'Portal User Template' record from 'res.users' model and when
'action_open_template_user' function is executed at that time traceback is
generated on the user side as well as in the log.

Steps to reproduce:
    1. Install Website module.
    2. Go to settings > Users&Companies > Users.
    3. Remove Internal Users from default filter.
    4. Add Inactive Users in filter and delete Portal User Template.
    5. Go to Website Settings > Privacy > Customer Account.
    6. Click on Free sign up and then on Save button.
    7. Now in Website Settings click on Default Access Rights button.
    8. The error will occur.

Applying this commit will fix this issue.

sentry-4184456381

closes odoo/odoo#125761

X-original-commit: f1906f4bb21a88e0c8008393557a16b098dea3c2
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-06-20 18:01:56 +02:00
Saurabh Choraria 2476a5b1bb [FIX] base: prevent traceback when icon file is not found
When user tries to import a module which does not consist of an icon and then
when user tries to access that module the error occurs.

Steps to reproduce:
1. Install web_studio.
2. Import a module(without icon) from apps > import module menu.
3. Now search that module in apps and click on module info.
4. The error will occur.

Applying this commit will fix this issue.

sentry-4206999375

closes odoo/odoo#124540

X-original-commit: 4b0221800ab75d5573e7066bf8beee14488062dd
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-06-12 12:41:15 +02:00
Saurabh Choraria 1a1011d78e [FIX] base,website_sale,gamification: prevent quick create of new field
When user tries to quick create a field where model is not specified, the error
will occur.

Steps to reproduce:
1. Turn on developer mode.
2. Go to Settings > Technical > Fields Selection.
3. Create a new record and quick create a field.

Traceback will be generated.

Applying this commit will fix this issue.

sentry-3956146718

closes odoo/odoo#124442

X-original-commit: 9e64211eb4398b25c57d73bc5a92eda88d314bd1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-09 13:50:14 +02:00
Saurabh Choraria 5156b22072 [FIX] base_import: prevent traceback if image data contains non ASCII characters
When user tries to add non ascii characters in image field column in a file and
then when he tries to import it the error will occur.

Steps to reproduce:
1. Install contacts
2. export a contact and keep image field in fields to export.
3. Now in that file change the image data and add non ASCII characters
(for example: 'ô').
4. Now try to import this file in contacts.
5. The error will occur.

Applying this commit will fix this issue.

Currently, a ValueError is raised when we give non-ascii characters as input.
So I have reported an issue in python in which I have mentioned to edit the
documentation to note that it may raise ValueError for non-ascii content, or
to fix '_bytes_from_decode_data' function to raise binascii.Error instead of
ValueError.

To track the issue - https://github.com/python/cpython/issues/105193

sentry-4029823200

closes odoo/odoo#123572

X-original-commit: ceb67160e1747f0a886efb8ca0a60499e2b080d1
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-06-05 11:49:50 +02:00
Saurabh Choraria f7c61e9412 [FIX] payment_{paypal,alipay}: update log for invalid notification origin
When the user configures PayPal/Alipay and in his PayPal/Alipay account he set
the IPN address to the webhook_url he receives a notification from PayPal/Alipay
with data. Then origin of that notification is checked and when PayPal/Alipay
sends 'invalid'/'false' as a response the error occurs.

To fix this issue the log is updated into a warning.

sentry-4116633764

closes odoo/odoo#121476

X-original-commit: 100f2526e91d781a01d959d08dc0ccfae4389061
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-05-16 06:49:56 +02:00