mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-08 21:12:32 +00:00
fix: last purchase rate not updating when voucher cancelled if only one voucher is present - v12 (#24323)
* fix: update last purchase rate * chore: use orm for update Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
32bdb691df
commit
d2442da6f2
@@ -35,9 +35,7 @@ def update_last_purchase_rate(doc, is_submit):
|
||||
frappe.throw(_("UOM Conversion factor is required in row {0}").format(d.idx))
|
||||
|
||||
# update last purchsae rate
|
||||
if last_purchase_rate:
|
||||
frappe.db.sql("""update `tabItem` set last_purchase_rate = %s where name = %s""",
|
||||
(flt(last_purchase_rate), d.item_code))
|
||||
frappe.db.set_value('Item', d.item_code, 'last_purchase_rate', flt(last_purchase_rate))
|
||||
|
||||
def validate_for_items(doc):
|
||||
items = []
|
||||
|
||||
Reference in New Issue
Block a user