Skip to content

Commit 15a098b

Browse files
committed
[IMP] util/report: do not show None or empty link
Sometimes we get unexpected empty (or NULL) values in some records when reporting about them. To avoid `None` or just an empty link we make a default value for `name` in such cases. closes #215 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent f7eea1f commit 15a098b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/util/report.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ def ref(xid):
289289

290290
def get_anchor_link_to_record(model, id, name, action_id=None):
291291
_validate_model(model)
292+
if not name:
293+
name = "{}(id={})".format(model, id)
292294
if version_gte("saas~17.2"):
293295
part1 = "action-{}".format(action_id) if action_id else model
294296
url = "/odoo/{}/{}?debug=1".format(part1, id)

0 commit comments

Comments
 (0)