Add way to hide "view profile" helper for customer view
This commit is contained in:
parent
e9e4d65c78
commit
bb0e2fb9e9
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
<%def name="object_helpers()">
|
<%def name="object_helpers()">
|
||||||
${parent.object_helpers()}
|
${parent.object_helpers()}
|
||||||
% if instance.people:
|
% if show_profiles_helper and instance.people:
|
||||||
${view_profiles_helper(instance.people)}
|
${view_profiles_helper(instance.people)}
|
||||||
% endif
|
% endif
|
||||||
</%def>
|
</%def>
|
||||||
|
|
|
@ -54,6 +54,9 @@ class CustomersView(MasterView):
|
||||||
people_detachable = True
|
people_detachable = True
|
||||||
touchable = True
|
touchable = True
|
||||||
|
|
||||||
|
# whether to show "view full profile" helper for customer view
|
||||||
|
show_profiles_helper = True
|
||||||
|
|
||||||
labels = {
|
labels = {
|
||||||
'id': "ID",
|
'id': "ID",
|
||||||
'default_phone': "Phone Number",
|
'default_phone': "Phone Number",
|
||||||
|
@ -245,6 +248,10 @@ class CustomersView(MasterView):
|
||||||
f.set_renderer('groups', self.render_groups)
|
f.set_renderer('groups', self.render_groups)
|
||||||
f.set_readonly('groups')
|
f.set_readonly('groups')
|
||||||
|
|
||||||
|
def template_kwargs_view(self, **kwargs):
|
||||||
|
kwargs['show_profiles_helper'] = self.show_profiles_helper
|
||||||
|
return kwargs
|
||||||
|
|
||||||
def unique_id(self, node, value):
|
def unique_id(self, node, value):
|
||||||
query = self.Session.query(model.Customer)\
|
query = self.Session.query(model.Customer)\
|
||||||
.filter(model.Customer.id == value)
|
.filter(model.Customer.id == value)
|
||||||
|
|
Loading…
Reference in a new issue