Changeset 69585ad in tailbone-corepos
- Timestamp:
- 08/02/2020 09:28:53 PM (3 years ago)
- Branches:
- master
- Children:
- fdb63fc
- Parents:
- acf6764
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tailbone_corepos/views/customers.py
racf6764 r69585ad 54 54 g.set_filter('corepos_account_id', model.CoreCustomer.corepos_account_id) 55 55 56 def configure_form(self, f): 57 super(CustomerView, self).configure_form(f) 58 f.set_required('corepos_account_id', False) 59 60 def objectify(self, form, data=None): 61 if data is None: 62 data = form.validated 63 customer = form.model_instance 64 65 # this field lives in an extension table, but the column does not allow 66 # null, which means we don't want to pass an empty value along unless 67 # there is already an extension record in place for this customer 68 if 'corepos_account_id' in data and data['corepos_account_id'] is None: 69 if self.creating: 70 data.pop('corepos_account_id') 71 elif self.editing and not customer._corepos: 72 data.pop('corepos_account_id') 73 74 return super(CustomerView, self).objectify(form, data) 75 56 76 def get_version_child_classes(self): 57 77 model = self.rattail_config.get_model()
Note: See TracChangeset
for help on using the changeset viewer.