Last active
January 16, 2025 12:35
-
-
Save faniska/7651362697f12b45574169f626d0a1d7 to your computer and use it in GitHub Desktop.
Try to delete multiple records in Odoo without interrupting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def try_unlink(self): | |
for record in self: | |
try: | |
with self.env.cr.savepoint(): | |
record.unlink() | |
self.env.invalidate_all() | |
except Exception as e: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment