[fix] Not able to cancel the invoice if it's linked with the timesheet (#9157)

This commit is contained in:
rohitwaghchaure 2017-06-07 11:52:04 +05:30 committed by Nabin Hait
parent 2a0d650735
commit ce6e621c18

View File

@ -243,7 +243,6 @@ class SalesInvoice(SellingController):
(not self.project and not data.sales_invoice) or \
(not sales_invoice and data.sales_invoice == self.name):
data.sales_invoice = sales_invoice
if self.project: return
def on_update(self):
self.set_paid_amount()
@ -483,6 +482,7 @@ class SalesInvoice(SellingController):
self.set('packed_items', [])
def set_billing_hours_and_amount(self):
if not self.project:
for timesheet in self.timesheets:
ts_doc = frappe.get_doc('Timesheet', timesheet.time_sheet)
if not timesheet.billing_hours and ts_doc.total_billable_hours: