Skip to content
Snippets Groups Projects
Commit fe4a5869 authored by Houzefa Abbasbhay's avatar Houzefa Abbasbhay :slight_smile:
Browse files

Fix buttons (name_get with multiple records)

parent b8a3ae8d
No related branches found
No related tags found
No related merge requests found
Pipeline #5733 failed
......@@ -192,4 +192,8 @@
self._refresh_ref_preview()
def name_get(self):
"""Override to name this record as we display it inline."""
ret = []
for record in self:
......@@ -195,6 +199,4 @@
for record in self:
"""Override to name this record as we display it inline."""
account = record.account_id
# 0 & 1 below: name_get returns a list of (ID, name) tuples.
......@@ -198,6 +200,5 @@
account = record.account_id
# 0 & 1 below: name_get returns a list of (ID, name) tuples.
return (
record.id,
ret.append(
(
......@@ -203,6 +204,7 @@
(
record.id,
_("Account consultation - %s")
% (
account.name_get()[0][1]
if account
else record.partner_id.name_get()[0][1]
......@@ -204,9 +206,9 @@
_("Account consultation - %s")
% (
account.name_get()[0][1]
if account
else record.partner_id.name_get()[0][1]
)
),
),
)
)
......@@ -211,5 +213,7 @@
)
return ret
def get_partner_account_fields(self):
"""Provide partner fields that reference accounts. This method is here
to allow overrides.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment