Don't require CORE ID when creating/editing Person

This commit is contained in:
Lance Edgar 2020-09-20 17:42:15 -05:00
parent 52bc90a88e
commit 3e037965ab

View file

@ -57,6 +57,15 @@ class PersonView(base.PeopleView):
model = self.rattail_config.get_model() model = self.rattail_config.get_model()
g.set_filter('corepos_customer_id', model.CorePerson.corepos_customer_id) 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): def get_version_child_classes(self):
model = self.rattail_config.get_model() model = self.rattail_config.get_model()
return super(PersonView, self).get_version_child_classes() + [ return super(PersonView, self).get_version_child_classes() + [