fix in purchase order validate currency's error messages, production order's produced qty field marked as no copy
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py
index 5157f7c..e230e0f 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.py
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.py
@@ -407,9 +407,21 @@
if not default_currency:
msgprint('Message: Please enter default currency in Company Master')
raise Exception
- if (obj.doc.currency == default_currency and flt(obj.doc.conversion_rate) != 1.00) or not obj.doc.conversion_rate or (obj.doc.currency != default_currency and flt(obj.doc.conversion_rate) == 1.00):
- msgprint("Message: Please Enter Appropriate Conversion Rate.")
- raise Exception
+
+ if obj.doc.conversion_rate == 0:
+ msgprint('Conversion Rate cannot be 0', raise_exception=1)
+ elif not obj.doc.conversion_rate:
+ msgprint('Please specify Conversion Rate', raise_exception=1)
+ elif obj.doc.currency == default_currency and \
+ flt(obj.doc.conversion_rate) != 1.00:
+ msgprint("""Conversion Rate should be equal to 1.00, \
+ since the specified Currency and the company's currency \
+ are same""", raise_exception=1)
+ elif obj.doc.currency != default_currency and \
+ flt(obj.doc.conversion_rate) == 1.00:
+ msgprint("""Conversion Rate should not be equal to 1.00, \
+ since the specified Currency and the company's currency \
+ are different""", raise_exception=1)
def validate_doc(self, obj, prevdoc_doctype, prevdoc_docname):
if prevdoc_docname :
diff --git a/erpnext/production/doctype/production_order/production_order.txt b/erpnext/production/doctype/production_order/production_order.txt
index 62aa610..c244399 100644
--- a/erpnext/production/doctype/production_order/production_order.txt
+++ b/erpnext/production/doctype/production_order/production_order.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-03-27 14:36:05',
+ 'creation': '2012-05-15 12:14:48',
'docstatus': 0,
- 'modified': '2012-03-27 14:45:50',
+ 'modified': '2012-05-28 19:03:56',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -23,7 +23,7 @@
'section_style': u'Tabbed',
'server_code_error': u' ',
'show_in_menu': 0,
- 'version': 190
+ 'version': 1
},
# These values are common for all DocField
@@ -323,6 +323,7 @@
'fieldname': u'produced_qty',
'fieldtype': u'Currency',
'label': u'Produced Qty',
+ 'no_copy': 1,
'oldfieldname': u'produced_qty',
'oldfieldtype': u'Currency',
'permlevel': 1