add email of the owner to email field

This commit is contained in:
Zlash65
2018-10-10 17:28:20 +05:30
parent 8c02ad1ad5
commit 8e3ea4e1f6

View File

@@ -12,3 +12,7 @@ class DeveloperSprint(Document):
autoname = 'DEV-SPRINT-.YYYY.-.###' autoname = 'DEV-SPRINT-.YYYY.-.###'
self.name = make_autoname(autoname) self.name = make_autoname(autoname)
def validate(self):
self.year = '2018'
if self.owner not in ["Guest", "Administrator"] and not self.get("email"):
self.email = frappe.db.get_value('User', self.owner, "email")