fix: Patch and test codacy

This commit is contained in:
marination 2020-09-08 20:32:25 +05:30
parent 315bf3051c
commit 8484d1cd95
2 changed files with 8 additions and 6 deletions

View File

@ -7,19 +7,23 @@ import frappe
def execute():
parent_list = []
count = 0
for data in frappe.db.sql("""
select
frappe.reload_doc('stock', 'doctype', 'purchase_receipt')
frappe.reload_doc('stock', 'doctype', 'purchase_receipt_item')
for data in frappe.db.sql("""
select
`tabPurchase Receipt Item`.purchase_order, `tabPurchase Receipt Item`.name,
`tabPurchase Receipt Item`.item_code, `tabPurchase Receipt Item`.idx,
`tabPurchase Receipt Item`.parent
from
from
`tabPurchase Receipt Item`, `tabPurchase Receipt`
where
`tabPurchase Receipt Item`.parent = `tabPurchase Receipt`.name and
`tabPurchase Receipt Item`.purchase_order_item is null and
`tabPurchase Receipt Item`.purchase_order is not null and
`tabPurchase Receipt`.is_return = 1""", as_dict=1):
name = frappe.db.get_value('Purchase Order Item',
name = frappe.db.get_value('Purchase Order Item',
{'item_code': data.item_code, 'parent': data.purchase_order, 'idx': data.idx}, 'name')
if name:

View File

@ -260,8 +260,6 @@ class TestDeliveryNote(unittest.TestCase):
make_stock_entry(item_code="_Test Item", target="Stores - TCP1", qty=50, basic_rate=100)
actual_qty_0 = get_qty_after_transaction(warehouse="Stores - TCP1")
dn = create_delivery_note(qty=5, rate=500, warehouse="Stores - TCP1", company=company,
expense_account="Cost of Goods Sold - TCP1", cost_center="Main - TCP1")