mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
refactor(Sales Invoice): convert to guard clause
This commit is contained in:
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user