refactor: itemgetter instead of assigned lambda
This commit is contained in:
parent
010060d92e
commit
9fec0a5c68
@ -4,6 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from operator import itemgetter
|
||||||
from frappe.utils import date_diff, flt, cint
|
from frappe.utils import date_diff, flt, cint
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
||||||
@ -12,7 +13,7 @@ def execute(filters=None):
|
|||||||
columns = get_columns(filters)
|
columns = get_columns(filters)
|
||||||
item_details = get_fifo_queue(filters)
|
item_details = get_fifo_queue(filters)
|
||||||
to_date = filters["to_date"]
|
to_date = filters["to_date"]
|
||||||
_func = lambda x: x[1]
|
_func = itemgetter(1)
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
for item, item_dict in iteritems(item_details):
|
for item, item_dict in iteritems(item_details):
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
from operator import itemgetter
|
||||||
import frappe, erpnext
|
import frappe, erpnext
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import flt, cint, getdate, now, date_diff
|
from frappe.utils import flt, cint, getdate, now, date_diff
|
||||||
@ -44,7 +45,7 @@ def execute(filters=None):
|
|||||||
data = []
|
data = []
|
||||||
conversion_factors = {}
|
conversion_factors = {}
|
||||||
|
|
||||||
_func = lambda x: x[1]
|
_func = itemgetter(1)
|
||||||
|
|
||||||
for (company, item, warehouse) in sorted(iwb_map):
|
for (company, item, warehouse) in sorted(iwb_map):
|
||||||
if item_map.get(item):
|
if item_map.get(item):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user