mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +00:00
Merge branch 'master' into edge
Conflicts: patches/march_2013/p07_update_valuation_rate.py patches/patch_list.py
This commit is contained in:
@@ -4,12 +4,11 @@ def execute():
|
||||
webnotes.reload_doc("accounts", "doctype", "purchase_invoice_item")
|
||||
|
||||
for purchase_invoice in webnotes.conn.sql_list("""select distinct parent
|
||||
from `tabPurchase Invoice Item` pi_item where docstatus = 1 and ifnull(valuation_rate, 0)=0
|
||||
and exists(select name from `tabPurchase Invoice` where name = pi_item.parent)"""):
|
||||
pi = webnotes.get_obj("Purchase Invoice", purchase_invoice)
|
||||
pi.calculate_taxes_and_totals()
|
||||
pi.update_raw_material_cost()
|
||||
pi.update_valuation_rate("entries")
|
||||
for item in pi.doclist.get({"parentfield": "entries"}):
|
||||
webnotes.conn.set_value("Purchase Invoice Item", item.name, "valuation_rate",
|
||||
item.valuation_rate)
|
||||
from `tabPurchase Invoice Item` where docstatus = 1 and ifnull(valuation_rate, 0)=0"""):
|
||||
pi = webnotes.get_obj("Purchase Invoice", purchase_invoice)
|
||||
pi.calculate_taxes_and_totals()
|
||||
pi.update_raw_material_cost()
|
||||
pi.update_valuation_rate("entries")
|
||||
for item in pi.doclist.get({"parentfield": "entries"}):
|
||||
webnotes.conn.sql("""update `tabPurchase Invoice Item` set valuation_rate = %s
|
||||
where name = %s""", (item.valuation_rate, item.name))
|
||||
|
||||
@@ -5,7 +5,7 @@ def execute():
|
||||
where docstatus = 1 and ifnull(against_expense_account, '') = ''""")
|
||||
|
||||
for pi in pi_list:
|
||||
pi_obj = get_obj("Purchase Invoice", pi[0], with_children=1)
|
||||
pi_obj.set_against_expense_account()
|
||||
webnotes.conn.set_value("Purchase Invoice", pi[0],
|
||||
"against_expense_account", pi_obj.doc.against_expense_account)
|
||||
pi_obj = get_obj("Purchase Invoice", pi[0], with_children=1)
|
||||
pi_obj.set_against_expense_account()
|
||||
webnotes.conn.sql("""update `tabPurchase Invoice` set against_expense_account = %s
|
||||
where name = %s""", (pi_obj.doc.against_expense_account, pi[0]))
|
||||
Reference in New Issue
Block a user