Merge branch 'shf_rename'
Conflicts: erpnext/patches/patch_list.py
This commit is contained in:
commit
1bba28a723
16
erpnext/patches/may_2012/reload_sales_invoice_pf.py
Normal file
16
erpnext/patches/may_2012/reload_sales_invoice_pf.py
Normal file
@ -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'))
|
||||||
|
|
@ -352,4 +352,10 @@ patch_list = [
|
|||||||
'patch_file': 'page_role_series_fix',
|
'patch_file': 'page_role_series_fix',
|
||||||
'description': 'reset series of page role at max'
|
'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'
|
||||||
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -83,7 +83,7 @@ class DocType(TransactionBase):
|
|||||||
if doc.fields.get('item_code'):
|
if doc.fields.get('item_code'):
|
||||||
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
|
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')};
|
'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:
|
for r in ret:
|
||||||
if not doc.fields.get(r):
|
if not doc.fields.get(r):
|
||||||
doc.fields[r] = ret[r]
|
doc.fields[r] = ret[r]
|
||||||
|
@ -100,7 +100,7 @@ class DocType(TransactionBase):
|
|||||||
if doc.fields.get('item_code'):
|
if doc.fields.get('item_code'):
|
||||||
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
|
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')};
|
'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:
|
for r in ret:
|
||||||
if not doc.fields.get(r):
|
if not doc.fields.get(r):
|
||||||
doc.fields[r] = ret[r]
|
doc.fields[r] = ret[r]
|
||||||
|
@ -117,7 +117,7 @@ class DocType(TransactionBase):
|
|||||||
if doc.fields.get('item_code'):
|
if doc.fields.get('item_code'):
|
||||||
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
|
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')};
|
'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:
|
for r in ret:
|
||||||
if not doc.fields.get(r):
|
if not doc.fields.get(r):
|
||||||
doc.fields[r] = ret[r]
|
doc.fields[r] = ret[r]
|
||||||
|
@ -49,7 +49,8 @@ class DocType(TransactionBase):
|
|||||||
# get item details
|
# get item details
|
||||||
# ----------------
|
# ----------------
|
||||||
def get_item_details(self, arg):
|
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)
|
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:
|
if not item:
|
||||||
|
@ -97,7 +97,7 @@ class DocType:
|
|||||||
msgprint("Serial no is mandatory for item: "+ d.item_code, raise_exception = 1)
|
msgprint("Serial no is mandatory for item: "+ d.item_code, raise_exception = 1)
|
||||||
|
|
||||||
# validate rejected serial nos
|
# 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)
|
msgprint("Rejected serial no is mandatory for rejected qty of item: "+ d.item_code, raise_exception = 1)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user