2
0

Merge PR #1790 into 16.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot 2024-03-06 08:46:48 +00:00
commit 5386050da6

View File

@ -1235,15 +1235,14 @@ class AccountAsset(models.Model):
try:
with self.env.cr.savepoint():
result += depreciation.create_move()
except Exception:
e = exc_info()[0]
except Exception as e:
tb = "".join(format_exception(*exc_info()))
asset_ref = depreciation.asset_id.name
if depreciation.asset_id.code:
asset_ref = "[{}] {}".format(depreciation.asset_id.code, asset_ref)
error_log += _(
"\nError while processing asset '{ref}': {exception}"
).format(ref=asset_ref, exception=str(e))
).format(ref=asset_ref, exception=repr(e))
error_msg = _("Error while processing asset '{ref}': \n\n{tb}").format(
ref=asset_ref, tb=tb
)