Fix handling of Vendor.id
field
since that is really a "synonym" we must be explicit about it (for now..?)
This commit is contained in:
parent
1ec511b60c
commit
700584a084
|
@ -34,6 +34,7 @@ class VendorView(CoreOfficeMasterView):
|
|||
Base class for vendor views.
|
||||
"""
|
||||
model_class = corepos.Vendor
|
||||
model_key = 'id'
|
||||
model_title = "CORE-POS Vendor"
|
||||
url_prefix = '/core-pos/vendors'
|
||||
route_prefix = 'corepos.vendors'
|
||||
|
@ -68,10 +69,17 @@ class VendorView(CoreOfficeMasterView):
|
|||
def configure_grid(self, g):
|
||||
super(VendorView, self).configure_grid(g)
|
||||
|
||||
# TODO: this is only needed b/c of orm.synonym usage
|
||||
g.set_sorter('id', corepos.Vendor.id)
|
||||
|
||||
g.set_link('id')
|
||||
g.set_link('name')
|
||||
g.set_link('abbreviation')
|
||||
|
||||
# TODO: ugh, would be nice to not have to do this...
|
||||
def get_action_route_kwargs(self, row):
|
||||
return {'id': row.id}
|
||||
|
||||
def configure_form(self, f):
|
||||
super(VendorView, self).configure_form(f)
|
||||
|
||||
|
|
Loading…
Reference in a new issue