Merge branch 'shf_rename'
Conflicts:
erpnext/patches/patch_list.py
diff --git a/erpnext/patches/may_2012/reload_sales_invoice_pf.py b/erpnext/patches/may_2012/reload_sales_invoice_pf.py
new file mode 100644
index 0000000..63acbed
--- /dev/null
+++ b/erpnext/patches/may_2012/reload_sales_invoice_pf.py
@@ -0,0 +1,16 @@
+def execute():
+ import webnotes
+ import webnotes.modules
+ res = webnotes.conn.sql("""\
+ select module, name, standard from `tabPrint Format`
+ where name like 'Sales Invoice%'""", as_dict=1)
+ for r in res:
+ if r.get('standard')=='Yes' and \
+ r.get('name') in [
+ 'Sales Invoice Classic',
+ 'Sales Invoice Spartan',
+ 'Sales Invoice Modern'
+ ]:
+ print r.get('name')
+ webnotes.modules.reload_doc(r.get('module'), 'Print Format', r.get('name'))
+
\ No newline at end of file
diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py
index 444be49..9da373a 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -352,4 +352,10 @@
'patch_file': 'page_role_series_fix',
'description': 'reset series of page role at max'
},
+ {
+ 'patch_module': 'patches.may_2012',
+ 'patch_file': 'reload_sales_invoice_pf',
+ 'description': 'Reload sales invoice print formats'
+ },
+
]
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index 5413b66..5756710 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -83,7 +83,7 @@
if doc.fields.get('item_code'):
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')};
- ret = obj.get_item_defaults(arg, self)
+ ret = obj.get_item_defaults(arg)
for r in ret:
if not doc.fields.get(r):
doc.fields[r] = ret[r]
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index c26da90..9e76327 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -100,7 +100,7 @@
if doc.fields.get('item_code'):
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')};
- ret = obj.get_item_defaults(arg, self)
+ ret = obj.get_item_defaults(arg)
for r in ret:
if not doc.fields.get(r):
doc.fields[r] = ret[r]
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py
index 4e66719..fa4144b 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -117,7 +117,7 @@
if doc.fields.get('item_code'):
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')};
- ret = obj.get_item_defaults(arg, self)
+ ret = obj.get_item_defaults(arg)
for r in ret:
if not doc.fields.get(r):
doc.fields[r] = ret[r]
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index b5d9e60..dd6588a 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -49,7 +49,8 @@
# get item details
# ----------------
def get_item_details(self, arg):
- arg, actual_qty, in_rate = eval(arg), 0, 0
+ import json
+ arg, actual_qty, in_rate = json.loads(arg), 0, 0
item = sql("select stock_uom, description, item_name from `tabItem` where name = %s and (ifnull(end_of_life,'')='' or end_of_life ='0000-00-00' or end_of_life > now())", (arg.get('item_code')), as_dict = 1)
if not item:
diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py
index 86a384f..0cb4b96 100644
--- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py
+++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py
@@ -97,7 +97,7 @@
msgprint("Serial no is mandatory for item: "+ d.item_code, raise_exception = 1)
# validate rejected serial nos
- if fname == 'purchase_receipt_details' and d.rejected_qty and ar_required == 'Yes' and not d.rejected_serial_no:
+ if fname == 'purchase_receipt_details' and flt(d.rejected_qty) > 0 and ar_required == 'Yes' and not d.rejected_serial_no:
msgprint("Rejected serial no is mandatory for rejected qty of item: "+ d.item_code, raise_exception = 1)