Add default help link for Receiving feature

also stop showing "buyer" filter by default
This commit is contained in:
Lance Edgar 2022-03-11 20:55:01 -06:00
parent 6037519fbe
commit da910b1414
2 changed files with 8 additions and 4 deletions

View file

@ -155,6 +155,7 @@ class MasterView(View):
use_index_links = False
has_versions = False
default_help_url = None
help_url = None
labels = {'uuid': "UUID"}
@ -2167,6 +2168,9 @@ class MasterView(View):
if self.help_url:
return self.help_url
if self.default_help_url:
return self.default_help_url
return global_help_url(self.rattail_config)
def render_to_response(self, template, data, **kwargs):

View file

@ -49,6 +49,7 @@ class PurchasingBatchView(BatchMasterView):
default_handler_spec = 'rattail.batch.purchase:PurchaseBatchHandler'
supports_new_product = False
cloneable = True
default_help_url = 'https://rattailproject.org/docs/rattail-manual/features/purchasing/receiving/index.html'
labels = {
'po_total': "PO Total",
@ -179,10 +180,9 @@ class PurchasingBatchView(BatchMasterView):
g.filters['department'] = g.make_filter('department', model.Department.name)
g.sorters['department'] = g.make_sorter(model.Department.name)
g.joiners['buyer'] = lambda q: q.join(model.Employee).join(model.Person)
g.filters['buyer'] = g.make_filter('buyer', model.Person.display_name,
default_active=True, default_verb='contains')
g.sorters['buyer'] = g.make_sorter(model.Person.display_name)
g.set_joiner('buyer', lambda q: q.join(model.Employee).join(model.Person))
g.set_filter('buyer', model.Person.display_name)
g.set_sorter('buyer', model.Person.display_name)
# TODO: we used to include the 'complete' filter by default, but it
# seems to likely be confusing for newcomers, so it is no longer