Merge branch 'master' of github.com:webnotes/erpnext into handlerupdate

This commit is contained in:
Rushabh Mehta 2012-03-28 08:04:17 +02:00
commit bb769c5461
7 changed files with 44 additions and 11 deletions

View File

@ -134,6 +134,16 @@
'to_field': 'serial_no'
},
# Field Mapper Detail
{
'checking_operator': u'=',
'doctype': u'Field Mapper Detail',
'from_field': u'export_rate',
'map': u'Yes',
'match_id': 1,
'to_field': u'export_rate'
},
# Table Mapper Detail
{
'doctype': 'Table Mapper Detail',
@ -186,4 +196,4 @@
'to_table': 'Sales Team',
'validation_logic': 'name is not null'
}
]
]

View File

@ -136,6 +136,16 @@
'to_field': 'incentives'
},
# Field Mapper Detail
{
'checking_operator': u'=',
'doctype': u'Field Mapper Detail',
'from_field': u'export_rate',
'map': u'Yes',
'match_id': 1,
'to_field': u'export_rate'
},
# Table Mapper Detail
{
'doctype': 'Table Mapper Detail',
@ -188,4 +198,4 @@
'to_table': 'Sales Team',
'validation_logic': 'name is not null'
}
]
]

View File

@ -0,0 +1,7 @@
def execute():
import webnotes
from webnotes.modules.module_manager import reload_doc
reload_doc('stock', 'DocType Mapper', 'Sales Order-Delivery Note')
reload_doc('accounts', 'DocType Mapper', 'Sales Order-Receivable Voucher')
reload_doc('accounts', 'DocType Mapper', 'Delivery Note-Receivable Voucher')

View File

@ -207,5 +207,10 @@ patch_list = [
'patch_file': 'update_se_fld_options',
'description': 'Purpose SE: Others to Other'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'reload_mapper',
'description': 'SO-DN, SO-Rv, DN-RV'
},
]

View File

@ -131,10 +131,10 @@
{
'checking_operator': u'=',
'doctype': u'Field Mapper Detail',
'from_field': u'basic_rate',
'from_field': u'export_rate',
'map': u'Yes',
'match_id': 1,
'to_field': u'basic_rate'
'to_field': u'export_rate'
},
# Field Mapper Detail
@ -264,4 +264,4 @@
'to_table': u'Delivery Note',
'validation_logic': u'docstatus = 1'
}
]
]

View File

@ -337,12 +337,12 @@ class DocType:
and t1.docstatus != 2
""", self.doc.item_code)
if ((flt(ret[0]['re_order_level']) > flt(current_qty)) and ret[0]['re_order_level']):
self.create_auto_indent(ret[0], doc_type, doc_name)
if ((flt(ret[0]['re_order_level']) > flt(current_qty[0][0])) and ret[0]['re_order_level']):
self.create_auto_indent(ret[0], doc_type, doc_name, current_qty[0][0])
def create_auto_indent(self, i , doc_type, doc_name):
def create_auto_indent(self, i , doc_type, doc_name, cur_qty):
""" Create indent on reaching reorder level """
indent = Document('Indent')
@ -361,7 +361,7 @@ class DocType:
indent_details_child.item_name = i['item_name']
indent_details_child.description = i['description']
indent_details_child.item_group = i['item_group']
indent_details_child.qty = i['re_order_qty']
indent_details_child.qty = i['re_order_qty'] or (flt(i['re_order_level']) - flt(cur_qty))
indent_details_child.brand = i['brand']
indent_details_child.save()
indent_obj = get_obj('Indent',indent.name,with_children=1)

View File

@ -75,7 +75,8 @@ class DocType:
def validate_item(self, item, count):
""" Validate item exists and non-serialized"""
det = sql("select item_code, has_serial_no from `tabItem` where name = '%s'"% cstr(item), as_dict = 1)
det = sql("select item_code, has_serial_no from `tabItem` \
where name = %s", cstr(item), as_dict = 1)
if not det:
msgprint("Item: " + cstr(item) + " mentioned at Row No. " + cstr(count) + "does not exist in the system")
self.validated = 0
@ -88,7 +89,7 @@ class DocType:
def validate_warehouse(self, wh, count,):
"""Validate warehouse exists"""
if not sql("select name from `tabWarehouse` where name = '%s'" % cstr(wh)):
if not sql("select name from `tabWarehouse` where name = %s", cstr(wh)):
msgprint("Warehouse: " + cstr(wh) + " mentioned at Row No. " + cstr(count) + " does not exist in the system")
self.validated = 0