* fix: auto update price list rate * fix: hide field when auto insert isn't enabled (cherry picked from commit bb3957eba35a5204a1a01e412dee596532bd525e) Co-authored-by: Sagar Sharma <63660334+s-aga-r@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
aed45f22f4
commit
c0b889b94d
@ -21,6 +21,7 @@
|
||||
"mr_qty_allowance",
|
||||
"column_break_12",
|
||||
"auto_insert_price_list_rate_if_missing",
|
||||
"update_existing_price_list_rate",
|
||||
"allow_negative_stock",
|
||||
"show_barcode_field",
|
||||
"clean_description_html",
|
||||
@ -290,6 +291,13 @@
|
||||
"fieldname": "mr_qty_allowance",
|
||||
"fieldtype": "Float",
|
||||
"label": "Over Transfer Allowance"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "auto_insert_price_list_rate_if_missing",
|
||||
"fieldname": "update_existing_price_list_rate",
|
||||
"fieldtype": "Check",
|
||||
"label": "Update Existing Price List Rate"
|
||||
}
|
||||
],
|
||||
"icon": "icon-cog",
|
||||
@ -297,7 +305,7 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2021-06-28 17:02:26.683002",
|
||||
"modified": "2021-11-06 19:40:02.183592",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Settings",
|
||||
@ -317,4 +325,4 @@
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
@ -706,7 +706,7 @@ def insert_item_price(args):
|
||||
{'item_code': args.item_code, 'price_list': args.price_list, 'currency': args.currency},
|
||||
['name', 'price_list_rate'], as_dict=1)
|
||||
if item_price and item_price.name:
|
||||
if item_price.price_list_rate != price_list_rate:
|
||||
if item_price.price_list_rate != price_list_rate and frappe.db.get_single_value('Stock Settings', 'update_existing_price_list_rate'):
|
||||
frappe.db.set_value('Item Price', item_price.name, "price_list_rate", price_list_rate)
|
||||
frappe.msgprint(_("Item Price updated for {0} in Price List {1}").format(args.item_code,
|
||||
args.price_list), alert=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user