From 3e037965abac016a8a0e3d05b608bf0dc70ae0c8 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 20 Sep 2020 17:42:15 -0500 Subject: [PATCH] Don't require CORE ID when creating/editing Person --- tailbone_corepos/views/people.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tailbone_corepos/views/people.py b/tailbone_corepos/views/people.py index de6c9d0..6108c1a 100644 --- a/tailbone_corepos/views/people.py +++ b/tailbone_corepos/views/people.py @@ -57,6 +57,15 @@ class PersonView(base.PeopleView): model = self.rattail_config.get_model() g.set_filter('corepos_customer_id', model.CorePerson.corepos_customer_id) + def configure_form(self, f): + super(PersonView, self).configure_form(f) + + # corepos_customer_id + if self.creating: + f.remove('corepos_customer_id') + elif self.editing: + f.set_required('corepos_customer_id', False) + def get_version_child_classes(self): model = self.rattail_config.get_model() return super(PersonView, self).get_version_child_classes() + [