Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] better error catching #60260

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

sebastienbeau
Copy link
Contributor

Description of the issue/feature this PR addresses:

When having a custom module that reuse the load method (here is the project : https://github.com/shopinvader/pattern-import-export.

Current behavior before PR:
If you pass an invalid type of field for the id the error is not catched correctly and you have a pg traceback

Desired behavior after PR is merged:
If you pass an invalid type of field for the id the error is catched correctly.

@rco-odoo

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo robodoo added seen 🙂 CI 🤖 Robodoo has seen passing statuses and removed ☐ legal/cla labels Oct 19, 2020
@C3POdoo C3POdoo added the ORM ORM, python Framework related label Oct 19, 2020
@sebastienbeau sebastienbeau changed the title [FIX] better error catching [14.0][FIX] better error catching Oct 19, 2020
@sebastienbeau
Copy link
Contributor Author

note previous version are also impacted

@sebastienbeau
Copy link
Contributor Author

@rco-odoo any news?

@sebastienbeau
Copy link
Contributor Author

@rco-odoo up

record=stream.index,
field='.id',
message=_(u"Invalid database identifier '%s'") % dbid))

if not self.search([('id', '=', dbid)]):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rco-odoo what do you think about modifying the search here and adding a with_context(active_test=False) ?
Indeed if you want to import (using id) in order to active a archived product, the search will not find the id

@lathama
Copy link
Contributor

lathama commented Apr 15, 2024

@sebastienbeau knowing that 14 is no longer updated, is this PR still needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses ORM ORM, python Framework related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants