Make vendor field renderer show ID in readonly mode.
This commit is contained in:
parent
e43ceda6bc
commit
d8ee09916a
|
@ -117,9 +117,14 @@ class VendorFieldRenderer(AutocompleteFieldRenderer):
|
||||||
"""
|
"""
|
||||||
Renderer for :class:`rattail.db.model.Vendor` instance fields.
|
Renderer for :class:`rattail.db.model.Vendor` instance fields.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
service_route = 'vendors.autocomplete'
|
service_route = 'vendors.autocomplete'
|
||||||
|
|
||||||
|
def render_readonly(self, **kwargs):
|
||||||
|
vendor = self.raw_value
|
||||||
|
if not vendor:
|
||||||
|
return ''
|
||||||
|
return "{0} - {1}".format(vendor.id, vendor.name)
|
||||||
|
|
||||||
|
|
||||||
class PriceFieldRenderer(TextFieldRenderer):
|
class PriceFieldRenderer(TextFieldRenderer):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue