Commit d6574721 authored by Gladys Forte's avatar Gladys Forte

delegation code generate

parent f06a076e
......@@ -101,7 +101,11 @@ class Delegation(AuditClass):
def save(self, *args, **kwargs):
super(Delegation, self).save(*args, **kwargs)
code = number_generator(enums.GenerateCode.DELEGATION.value, self.id)
Delegation.objects.filter(id=self.id).update(code=code)
if self.code == '':
self.code = code
self.created = datetime.now()
self.save()
class Company(AuditClass):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment