Add support for 'department' field in purchases / batches
Also fix logic for deleting a purchase (delete its batches first)
This commit is contained in:
parent
6c3d221e98
commit
c73ba56505
6 changed files with 62 additions and 13 deletions
|
@ -526,7 +526,12 @@ class MasterView(View):
|
|||
Return a "humanized" (and plural) version of the model name, for
|
||||
display in templates.
|
||||
"""
|
||||
return getattr(cls, 'model_title_plural', '{0}s'.format(cls.get_model_title()))
|
||||
if hasattr(cls, 'model_title_plural'):
|
||||
return cls.model_title_plural
|
||||
try:
|
||||
return cls.get_model_class().get_model_title_plural()
|
||||
except (NotImplementedError, AttributeError):
|
||||
return '{}s'.format(cls.get_model_title())
|
||||
|
||||
@classmethod
|
||||
def get_route_prefix(cls):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue