diff --git a/tailbone_corepos/views/batch/coremember.py b/tailbone_corepos/views/batch/coremember.py index 2e4886d..084e66e 100644 --- a/tailbone_corepos/views/batch/coremember.py +++ b/tailbone_corepos/views/batch/coremember.py @@ -24,12 +24,15 @@ Views for CORE member batches """ -from tailbone.views.batch import BatchMasterView +from corepos.db.office_op import model as corepos from rattail_corepos.db.model import CoreMemberBatch, CoreMemberBatchRow from rattail_corepos.batch.coremember import CoreMemberBatchHandler from rattail_corepos.config import core_office_url, core_office_customer_account_url +from tailbone.views.batch import BatchMasterView +from tailbone_corepos.db import CoreOfficeSession + class CoreMemberBatchView(BatchMasterView): """ @@ -92,6 +95,13 @@ class CoreMemberBatchView(BatchMasterView): def configure_row_grid(self, g): super(CoreMemberBatchView, self).configure_row_grid(g) + app = self.get_rattail_app() + member_types = app.cache_model(CoreOfficeSession(), + corepos.MemberType, + normalizer=lambda mtype: mtype.description, + key=lambda mtype, normal: mtype.id) + g.set_enum('member_type_id', member_types) + g.set_link('card_number') g.set_link('first_name') g.set_link('last_name') @@ -109,7 +119,7 @@ class CoreMemberBatchView(BatchMasterView): kwargs['batch'] = batch kwargs['instance_title'] = batch.id_str - fields = list(self.handler.importing_fields) + fields = batch.get_param('fields') kwargs['diff_fields'] = fields kwargs['diff_old_values'] = dict([