2019-07-15 12:32:58 +00:00
|
|
|
import frappe
|
|
|
|
from frappe.model.utils.rename_field import rename_field
|
|
|
|
|
2021-09-02 11:14:59 +00:00
|
|
|
|
2019-07-15 12:32:58 +00:00
|
|
|
def execute():
|
|
|
|
frappe.reload_doc("stock", "doctype", "item")
|
|
|
|
frappe.reload_doc("stock", "doctype", "stock_settings")
|
|
|
|
frappe.reload_doc("accounts", "doctype", "accounts_settings")
|
|
|
|
|
2022-03-28 13:22:46 +00:00
|
|
|
rename_field("Stock Settings", "tolerance", "over_delivery_receipt_allowance")
|
|
|
|
rename_field("Item", "tolerance", "over_delivery_receipt_allowance")
|
2019-07-15 12:32:58 +00:00
|
|
|
|
|
|
|
qty_allowance = frappe.db.get_single_value("Stock Settings", "over_delivery_receipt_allowance")
|
|
|
|
frappe.db.set_value("Accounts Settings", None, "over_delivery_receipt_allowance", qty_allowance)
|
|
|
|
|
2021-08-19 08:11:10 +00:00
|
|
|
frappe.db.sql("update tabItem set over_billing_allowance=over_delivery_receipt_allowance")
|