Fixes in pricing rule

This commit is contained in:
Nabin Hait 2014-06-24 11:00:13 +05:30
parent 65efd0a9a1
commit f62b75c731

View File

@ -6,6 +6,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
import json import json
import copy
from frappe import throw, _ from frappe import throw, _
from frappe.utils import flt, cint from frappe.utils import flt, cint
from frappe.model.document import Document from frappe.model.document import Document
@ -106,8 +107,9 @@ def apply_pricing_rule(args):
args.transaction_type = "buying" if frappe.get_meta(args.parenttype).get_field("supplier") \ args.transaction_type = "buying" if frappe.get_meta(args.parenttype).get_field("supplier") \
else "selling" else "selling"
args_copy = copy.deepcopy(args)
args_copy.pop("item_list")
for item in args.get("item_list"): for item in args.get("item_list"):
args_copy = args.copy()
args_copy.update(item) args_copy.update(item)
out.append(get_pricing_rule_for_item(args_copy)) out.append(get_pricing_rule_for_item(args_copy))