fix(accounting): Ensure correct sub-model check is conducted within model type

ref: #742 #737
This commit is contained in:
2025-05-08 14:47:56 +09:30
parent 46c4fe9516
commit 9bd9652b3d

View File

@ -118,13 +118,13 @@ class AssetBase(
None: The ticket is for the Base class. Used to prevent creating a base ticket.
"""
ticket_type = str(self._meta.sub_model_type).lower().replace(' ', '_')
sub_model_type = str(self._meta.sub_model_type).lower().replace(' ', '_')
if ticket_type == 'ticket':
if sub_model_type == 'asset':
return None
return ticket_type
return sub_model_type
def get_model_type_choices():