[feature] Ability to set UOM as Integer-only and related validations.

This commit is contained in:
Rushabh Mehta
2013-07-25 17:45:59 +05:30
parent 966c9f6a8e
commit 4dca40195e
39 changed files with 153 additions and 78 deletions

View File

@@ -58,6 +58,9 @@ class DocType(BuyingController):
pc_obj.get_prevdoc_date(self)
self.check_for_stopped_status(pc_obj)
self.validate_uom_is_integer("uom", "qty")
self.validate_uom_is_integer("stock_uom", ["qty", "required_qty"])
self.validate_with_previous_doc()
self.validate_for_subcontracting()
self.update_raw_materials_supplied("po_raw_material_details")

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:06",
"docstatus": 0,
"modified": "2013-07-10 14:54:14",
"modified": "2013-07-25 16:32:51",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -265,12 +265,13 @@
{
"doctype": "DocField",
"fieldname": "stock_uom",
"fieldtype": "Data",
"fieldtype": "Link",
"hidden": 0,
"in_list_view": 0,
"label": "Stock UOM",
"oldfieldname": "stock_uom",
"oldfieldtype": "Data",
"options": "UOM",
"print_hide": 1,
"print_width": "100px",
"read_only": 1,

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:42",
"docstatus": 0,
"modified": "2013-07-10 14:54:15",
"modified": "2013-07-25 16:33:05",
"modified_by": "Administrator",
"owner": "dhanalekshmi@webnotestech.com"
},
@@ -111,10 +111,11 @@
{
"doctype": "DocField",
"fieldname": "stock_uom",
"fieldtype": "Data",
"fieldtype": "Link",
"label": "Stock Uom",
"oldfieldname": "stock_uom",
"oldfieldtype": "Data",
"options": "UOM",
"read_only": 1
}
]

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:42",
"docstatus": 0,
"modified": "2013-07-10 14:54:17",
"modified": "2013-07-25 16:34:11",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
@@ -130,10 +130,11 @@
{
"doctype": "DocField",
"fieldname": "stock_uom",
"fieldtype": "Data",
"fieldtype": "Link",
"label": "Stock Uom",
"oldfieldname": "stock_uom",
"oldfieldtype": "Data",
"options": "UOM",
"read_only": 1
},
{

View File

@@ -36,6 +36,7 @@ class DocType(BuyingController):
self.validate_common()
self.validate_with_previous_doc()
self.validate_uom_is_integer("uom", "qty")
def on_submit(self):
purchase_controller = webnotes.get_obj("Purchase Common")