summaryrefslogtreecommitdiff
path: root/addons/http_routing/models/ir_http.py
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2020-07-07 13:04:12 +0000
committerJeremy Kersten <jke@odoo.com>2020-07-07 13:11:57 +0000
commit30e4873a2f9ac7bd35c3b2cb5d2a0b63846263c2 (patch)
tree317591355f26a6ea3117a8a7a21ae940f7514e38 /addons/http_routing/models/ir_http.py
parent89af38d9171ce8005e968d73331a7d8394a2b8ef (diff)
[IMP] website: allow to have custom slug
Now, slug uses seo_name if field exists before to fallback on display_name. It allow to have a custom url without change the product name already used in backend e.g. or just because you want add some keywords for seo. task-2291676
Diffstat (limited to 'addons/http_routing/models/ir_http.py')
-rw-r--r--addons/http_routing/models/ir_http.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/http_routing/models/ir_http.py b/addons/http_routing/models/ir_http.py
index 9bd74a0a37d..bb5522fcdec 100644
--- a/addons/http_routing/models/ir_http.py
+++ b/addons/http_routing/models/ir_http.py
@@ -92,7 +92,7 @@ def slug(value):
if not value.id:
raise ValueError("Cannot slug non-existent record %s" % value)
# [(id, name)] = value.name_get()
- identifier, name = value.id, value.display_name
+ identifier, name = value.id, getattr(value, 'seo_name', False) or value.display_name
else:
# assume name_search result tuple
identifier, name = value