refactor(Sales Invoice): convert to guard clause

This commit is contained in:
barredterra
2024-02-16 23:17:41 +01:00
parent cc83af0dd4
commit f99f7fd2cf

View File

@@ -591,7 +591,9 @@ class SalesInvoice(SellingController):
self.delete_auto_created_batches() self.delete_auto_created_batches()
def update_status_updater_args(self): def update_status_updater_args(self):
if cint(self.update_stock): if not cint(self.update_stock):
return
self.status_updater.append( self.status_updater.append(
{ {
"source_dt": "Sales Invoice Item", "source_dt": "Sales Invoice Item",
@@ -613,7 +615,10 @@ class SalesInvoice(SellingController):
where name=`tabSales Invoice Item`.parent and update_stock = 1)""", where name=`tabSales Invoice Item`.parent and update_stock = 1)""",
} }
) )
if cint(self.is_return):
if not cint(self.is_return):
return
self.status_updater.append( self.status_updater.append(
{ {
"source_dt": "Sales Invoice Item", "source_dt": "Sales Invoice Item",