Merge pull request #1834 from nabinhait/v4-hotfix

Multiple fixes
This commit is contained in:
Rushabh Mehta 2014-06-24 12:09:12 +05:30
commit 5dfacf2615
3 changed files with 17 additions and 7 deletions

View File

@ -62,7 +62,7 @@
"options": "Price List",
"permlevel": 0,
"read_only": 0,
"reqd": 1
"reqd": 0
},
{
"fieldname": "company",
@ -147,7 +147,7 @@
"options": "Warehouse",
"permlevel": 0,
"read_only": 0,
"reqd": 1
"reqd": 0
},
{
"fieldname": "cost_center",
@ -205,7 +205,7 @@
],
"icon": "icon-cog",
"idx": 1,
"modified": "2014-05-27 03:49:14.735138",
"modified": "2014-06-23 16:40:59.510132",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Setting",

View File

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

View File

@ -16,8 +16,7 @@ def validate_receiver_nos(receiver_list):
validated_receiver_list = []
for d in receiver_list:
# remove invalid character
invalid_char_list = [' ', '+', '-', '(', ')']
for x in invalid_char_list:
for x in [' ', '+', '-', '(', ')']:
d = d.replace(x, '')
validated_receiver_list.append(d)
@ -48,6 +47,13 @@ def get_contact_number(contact_name, value, key):
@frappe.whitelist()
def send_sms(receiver_list, msg, sender_name = ''):
import json
if isinstance(receiver_list, basestring):
receiver_list = json.loads(receiver_list)
if not isinstance(receiver_list, list):
receiver_list = [receiver_list]
receiver_list = validate_receiver_nos(receiver_list)
arg = {