Fix bug when editing vendor
This commit is contained in:
parent
1f3877b7cb
commit
f708cb0b25
13
tailbone/views/vendors/core.py
vendored
13
tailbone/views/vendors/core.py
vendored
|
@ -78,7 +78,7 @@ class VendorView(MasterView):
|
||||||
]
|
]
|
||||||
|
|
||||||
def configure_grid(self, g):
|
def configure_grid(self, g):
|
||||||
super(VendorView, self).configure_grid(g)
|
super().configure_grid(g)
|
||||||
|
|
||||||
g.filters['name'].default_active = True
|
g.filters['name'].default_active = True
|
||||||
g.filters['name'].default_verb = 'contains'
|
g.filters['name'].default_verb = 'contains'
|
||||||
|
@ -124,8 +124,9 @@ class VendorView(MasterView):
|
||||||
def objectify(self, form, data=None):
|
def objectify(self, form, data=None):
|
||||||
if data is None:
|
if data is None:
|
||||||
data = form.validated
|
data = form.validated
|
||||||
vendor = super(VendorView, self).objectify(form, data)
|
vendor = super().objectify(form, data)
|
||||||
vendor = self.objectify_contact(vendor, data)
|
vendor = self.objectify_contact(vendor, data)
|
||||||
|
app = self.get_rattail_app()
|
||||||
|
|
||||||
if 'orders_email' in data:
|
if 'orders_email' in data:
|
||||||
address = data['orders_email']
|
address = data['orders_email']
|
||||||
|
@ -169,7 +170,7 @@ class VendorView(MasterView):
|
||||||
self.Session.delete(cost)
|
self.Session.delete(cost)
|
||||||
|
|
||||||
def get_version_child_classes(self):
|
def get_version_child_classes(self):
|
||||||
return super(VendorView, self).get_version_child_classes() + [
|
return super().get_version_child_classes() + [
|
||||||
(model.VendorPhoneNumber, 'parent_uuid'),
|
(model.VendorPhoneNumber, 'parent_uuid'),
|
||||||
(model.VendorEmailAddress, 'parent_uuid'),
|
(model.VendorEmailAddress, 'parent_uuid'),
|
||||||
(model.VendorContact, 'vendor_uuid'),
|
(model.VendorContact, 'vendor_uuid'),
|
||||||
|
@ -186,14 +187,14 @@ class VendorView(MasterView):
|
||||||
]
|
]
|
||||||
|
|
||||||
def configure_get_context(self, **kwargs):
|
def configure_get_context(self, **kwargs):
|
||||||
context = super(VendorView, self).configure_get_context(**kwargs)
|
context = super().configure_get_context(**kwargs)
|
||||||
|
|
||||||
context['supported_vendor_settings'] = self.configure_get_supported_vendor_settings()
|
context['supported_vendor_settings'] = self.configure_get_supported_vendor_settings()
|
||||||
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def configure_gather_settings(self, data, **kwargs):
|
def configure_gather_settings(self, data, **kwargs):
|
||||||
settings = super(VendorView, self).configure_gather_settings(
|
settings = super().configure_gather_settings(
|
||||||
data, **kwargs)
|
data, **kwargs)
|
||||||
|
|
||||||
supported_vendor_settings = self.configure_get_supported_vendor_settings()
|
supported_vendor_settings = self.configure_get_supported_vendor_settings()
|
||||||
|
@ -205,7 +206,7 @@ class VendorView(MasterView):
|
||||||
return settings
|
return settings
|
||||||
|
|
||||||
def configure_remove_settings(self, **kwargs):
|
def configure_remove_settings(self, **kwargs):
|
||||||
super(VendorView, self).configure_remove_settings(**kwargs)
|
super().configure_remove_settings(**kwargs)
|
||||||
app = self.get_rattail_app()
|
app = self.get_rattail_app()
|
||||||
names = []
|
names = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue