diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index 26a2c98959..ca95bbbb3c 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -89,6 +89,32 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "country", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Country", + "length": 0, + "no_copy": 0, + "options": "Country", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -685,7 +711,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-04-13 05:47:43.797061", + "modified": "2016-04-28 17:36:44.742525", "modified_by": "Administrator", "module": "Buying", "name": "Supplier", @@ -832,6 +858,7 @@ "write": 0 } ], + "quick_entry": 0, "read_only": 0, "read_only_onload": 0, "search_fields": "supplier_name, supplier_type", diff --git a/erpnext/buying/doctype/supplier/test_records.json b/erpnext/buying/doctype/supplier/test_records.json index f335d5c423..d2b399544f 100644 --- a/erpnext/buying/doctype/supplier/test_records.json +++ b/erpnext/buying/doctype/supplier/test_records.json @@ -1,4 +1,10 @@ [ + { + "doctype": "Supplier", + "supplier_name": "_Test Supplier with Country", + "supplier_type": "_Test Supplier Type", + "country": "Greece" + }, { "doctype": "Supplier", "supplier_name": "_Test Supplier", diff --git a/erpnext/buying/doctype/supplier/test_supplier.py b/erpnext/buying/doctype/supplier/test_supplier.py index a7a65f1dbd..1d089e7098 100644 --- a/erpnext/buying/doctype/supplier/test_supplier.py +++ b/erpnext/buying/doctype/supplier/test_supplier.py @@ -70,3 +70,18 @@ class TestSupplier(unittest.TestCase): frappe.db.set_value("Supplier", "_Test Supplier", "disabled", 0) po.save() + + + def test_supplier_country(self): + # Test that country field exists in Supplier DocType + supplier = frappe.get_doc('Supplier', '_Test Supplier with Country') + self.assertTrue('country' in supplier.as_dict()) + + # Test if test supplier field record is 'Greece' + self.assertEqual(supplier.country, "Greece") + + # Test update Supplier instance country value + supplier = frappe.get_doc('Supplier', '_Test Supplier') + supplier.country = 'Greece' + supplier.save() + self.assertEqual(supplier.country, "Greece")