fix logic of quantity validation (#9311)

This commit is contained in:
Sagar Vora 2017-06-16 11:43:36 +05:30 committed by Rushabh Mehta
parent b07535bb64
commit 5f407907a2
5 changed files with 6 additions and 4 deletions

View File

@ -59,6 +59,7 @@ class PurchaseInvoice(BuyingController):
self.check_for_closed_status()
self.validate_with_previous_doc()
self.validate_uom_is_integer("uom", "qty")
self.validate_uom_is_integer("stock_uom", "stock_qty")
self.set_expense_account(for_validate=True)
self.set_against_expense_account()
self.validate_write_off_account()

View File

@ -57,7 +57,8 @@ class SalesInvoice(SellingController):
self.so_dn_required()
self.validate_proj_cust()
self.validate_with_previous_doc()
self.validate_uom_is_integer("stock_uom", "qty")
self.validate_uom_is_integer("stock_uom", "stock_qty")
self.validate_uom_is_integer("uom", "qty")
self.check_close_sales_order("sales_order")
self.validate_debit_to_acc()
self.clear_unallocated_advances("Sales Invoice Advance", "advances")

View File

@ -43,7 +43,7 @@ class PurchaseOrder(BuyingController):
self.check_for_closed_status()
self.validate_uom_is_integer("uom", "qty")
self.validate_uom_is_integer("stock_uom", ["qty", "required_qty"])
self.validate_uom_is_integer("stock_uom", "stock_qty")
self.validate_with_previous_doc()
self.validate_for_subcontracting()

View File

@ -32,7 +32,7 @@ class SalesOrder(SellingController):
self.validate_mandatory()
self.validate_proj_cust()
self.validate_po()
self.validate_uom_is_integer("stock_uom", "qty")
self.validate_uom_is_integer("stock_uom", "stock_qty")
self.validate_uom_is_integer("uom", "qty")
self.validate_for_items()
self.validate_warehouse()

View File

@ -102,7 +102,7 @@ class DeliveryNote(SellingController):
self.check_close_sales_order("against_sales_order")
self.validate_for_items()
self.validate_warehouse()
self.validate_uom_is_integer("stock_uom", "qty")
self.validate_uom_is_integer("stock_uom", "stock_qty")
self.validate_uom_is_integer("uom", "qty")
self.validate_with_previous_doc()