Merge pull request #312 from saurabh6790/master

updated accounts_controller.py, buying_controller.py, selling_controller.py
This commit is contained in:
Anand Doshi 2013-03-20 03:55:40 -07:00
commit 2d12a42145
3 changed files with 10 additions and 4 deletions

View File

@ -22,6 +22,10 @@ from webnotes.utils import flt
from utilities.transaction_base import TransactionBase
class AccountsController(TransactionBase):
def validate(self):
if self.meta.get_field("grand_total"):
self.validate_value("grand_total", ">=", 0)
def get_gl_dict(self, args, cancel=None):
"""this method populates the common properties of a gl entry record"""
if cancel is None:

View File

@ -28,6 +28,7 @@ from controllers.stock_controller import StockController
class BuyingController(StockController):
def validate(self):
super(BuyingController, self).validate()
if self.meta.get_field("currency"):
self.company_currency = get_company_currency(self.doc.company)
self.validate_conversion_rate("currency", "conversion_rate")

View File

@ -23,6 +23,7 @@ from controllers.stock_controller import StockController
class SellingController(StockController):
def validate(self):
super(SellingController, self).validate()
self.set_total_in_words()
def set_total_in_words(self):