From 24a35c69c00565ecd6bf91120a9544c0fb7d5ef4 Mon Sep 17 00:00:00 2001 From: marination Date: Tue, 21 Dec 2021 12:32:55 +0530 Subject: [PATCH] fix: Sider and Server side test - args passed to wrong function - missing space around '=' --- erpnext/stock/report/stock_ageing/stock_ageing.py | 15 ++++++++------- .../stock/report/stock_balance/stock_balance.py | 2 +- .../warehouse_wise_item_balance_age_and_value.py | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.py b/erpnext/stock/report/stock_ageing/stock_ageing.py index 0136007ca4..75e235ac05 100644 --- a/erpnext/stock/report/stock_ageing/stock_ageing.py +++ b/erpnext/stock/report/stock_ageing/stock_ageing.py @@ -13,7 +13,7 @@ from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos Filters = frappe._dict -def execute(filters: Filters =None) -> Tuple: +def execute(filters: Filters = None) -> Tuple: to_date = filters["to_date"] columns = get_columns(filters) @@ -213,10 +213,10 @@ def setup_ageing_columns(filters: Filters, range_columns: List): f"{cint(filters['range3']) + 1} - {_('Above')}" ] for i, label in enumerate(ranges): - fieldname = 'range' + str(i+1) - add_column(range_columns, label=f"Age ({label})",fieldname=fieldname) + fieldname = 'range' + str(i+1) + add_column(range_columns, label=f"Age ({label})",fieldname=fieldname) -def add_column(range_columns: List, label:str, fieldname: str, fieldtype: str ='Float', width: int =140): +def add_column(range_columns: List, label:str, fieldname: str, fieldtype: str = 'Float', width: int = 140): range_columns.append(dict( label=label, fieldname=fieldname, @@ -228,7 +228,7 @@ def add_column(range_columns: List, label:str, fieldname: str, fieldtype: str =' class FIFOSlots: "Returns FIFO computed slots of inwarded stock as per date." - def __init__(self, filters: Dict =None , sle: List =None): + def __init__(self, filters: Dict = None , sle: List = None): self.item_details = {} self.transferred_item_details = {} self.serial_no_batch_purchase_details = {} @@ -245,7 +245,7 @@ class FIFOSlots: consumed/updated and maintained via FIFO. ** } """ - if self.sle == None: + if self.sle is None: self.sle = self.__get_stock_ledger_entries() for d in self.sle: @@ -358,7 +358,8 @@ class FIFOSlots: posting_date <= %(to_date)s and is_cancelled != 1 {sle_conditions} - order by posting_date, posting_time, sle.creation, actual_qty""" #nosec + order by posting_date, posting_time, sle.creation, actual_qty + """ #nosec .format( item_conditions=self.__get_item_conditions(), sle_conditions=self.__get_sle_conditions() diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index 44d52f74bd..b4f43a7fef 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -33,7 +33,7 @@ def execute(filters=None): if filters.get('show_stock_ageing_data'): filters['show_warehouse_wise_stock'] = True - item_wise_fifo_queue = FIFOSlots().generate(filters, sle) + item_wise_fifo_queue = FIFOSlots(filters, sle).generate() # if no stock ledger entry found return if not sle: diff --git a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py index e5003ee025..22bdb89198 100644 --- a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py +++ b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py @@ -33,7 +33,7 @@ def execute(filters=None): item_map = get_item_details(items, sle, filters) iwb_map = get_item_warehouse_map(filters, sle) warehouse_list = get_warehouse_list(filters) - item_ageing = FIFOSlots().generate(filters) + item_ageing = FIFOSlots(filters).generate() data = [] item_balance = {} item_value = {}