Merge branch 'hotfix'

This commit is contained in:
Nabin Hait 2016-12-08 12:33:53 +05:30
commit 7b91181fa0
3 changed files with 4 additions and 5 deletions

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '7.1.21'
__version__ = '7.1.22'
def get_default_company(user=None):
'''Get default company for user'''

View File

@ -296,4 +296,3 @@ def save_invoice(e, si_doc, name):
si_doc.docstatus = 0
si_doc.flags.ignore_mandatory = True
si_doc.insert()
frappe.log_error(frappe.get_traceback())

View File

@ -79,9 +79,9 @@ class Timesheet(Document):
self.status = "Completed"
def set_dates(self):
if self.docstatus < 2:
start_date = min([d.from_time for d in self.time_logs])
end_date = max([d.to_time for d in self.time_logs])
if self.docstatus < 2 and self.time_logs:
start_date = min([getdate(d.from_time) for d in self.time_logs])
end_date = max([getdate(d.to_time) for d in self.time_logs])
if start_date and end_date:
self.start_date = getdate(start_date)