From e559b3bf6b334a040d3087a32f6512330dfc4151 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 18 Jun 2023 18:52:08 -0500 Subject: [PATCH] Add merge, delete-checked support for CORE Customers (classic) can be useful for manual cleanup --- tailbone_corepos/views/corepos/customers.py | 6 ++++++ tailbone_corepos/views/customers.py | 1 + 2 files changed, 7 insertions(+) diff --git a/tailbone_corepos/views/corepos/customers.py b/tailbone_corepos/views/corepos/customers.py index fd1ff65..cc3ea95 100644 --- a/tailbone_corepos/views/corepos/customers.py +++ b/tailbone_corepos/views/corepos/customers.py @@ -53,6 +53,8 @@ class CustomerClassicView(CoreOfficeMasterView): url_prefix = '/core-pos/customers' route_prefix = 'corepos.customers' results_downloadable = True + set_deletable = True + mergeable = True labels = { 'id': "ID", @@ -115,6 +117,10 @@ class CustomerClassicView(CoreOfficeMasterView): g.set_link('first_name') g.set_link('last_name') + def get_uuid_for_grid_row(self, customer): + # nb. uniquely identify records, for merge support + return customer.id + def configure_form(self, f): super().configure_form(f) diff --git a/tailbone_corepos/views/customers.py b/tailbone_corepos/views/customers.py index bcf9064..f23530f 100644 --- a/tailbone_corepos/views/customers.py +++ b/tailbone_corepos/views/customers.py @@ -93,6 +93,7 @@ class CustomerShopperViewSupplement(ViewSupplement): model = self.model g.append('corepos_customer_id') g.set_filter('corepos_customer_id', model.CoreCustomerShopper.corepos_customer_id) + g.set_sorter('corepos_customer_id', model.CoreCustomerShopper.corepos_customer_id) def configure_form(self, f): if not self.master.creating: