Auto-set datetime for orders

This commit is contained in:
Raphael Michel
2015-03-08 16:01:01 +01:00
parent 099158603d
commit 81ab0a4fd2

View File

@@ -1299,6 +1299,8 @@ class Order(Versionable):
def save(self, *args, **kwargs):
if not self.code:
self.assign_code()
if not self.datetime:
self.datetime = now()
super().save(*args, **kwargs)
def assign_code(self):