Add category, family, report code support for generic product batch
This commit is contained in:
parent
f8d26b4f8f
commit
798a9893e9
2 changed files with 68 additions and 0 deletions
|
@ -826,6 +826,22 @@ class MasterView(View):
|
|||
url = self.request.route_url('subdepartments.view', uuid=subdepartment.uuid)
|
||||
return tags.link_to(text, url)
|
||||
|
||||
def render_category(self, obj, field):
|
||||
category = getattr(obj, field)
|
||||
if not category:
|
||||
return ""
|
||||
text = "({}) {}".format(category.code, category.name)
|
||||
url = self.request.route_url('categories.view', uuid=category.uuid)
|
||||
return tags.link_to(text, url)
|
||||
|
||||
def render_family(self, obj, field):
|
||||
family = getattr(obj, field)
|
||||
if not family:
|
||||
return ""
|
||||
text = "({}) {}".format(family.code, family.name)
|
||||
url = self.request.route_url('families.view', uuid=family.uuid)
|
||||
return tags.link_to(text, url)
|
||||
|
||||
def render_report(self, obj, field):
|
||||
report = getattr(obj, field)
|
||||
if not report:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue