built item grids for sales, purchase, stock

This commit is contained in:
Rushabh Mehta
2014-07-29 16:07:43 +05:30
committed by Anand Doshi
parent c13727adba
commit b5e768906a
18 changed files with 642 additions and 378 deletions

View File

@@ -6,6 +6,7 @@ import frappe
from frappe.utils import cint, flt, rounded, cstr, comma_or
from erpnext.setup.utils import get_company_currency
from frappe import _, throw
from erpnext.stock.get_item_details import get_available_qty
from erpnext.controllers.stock_controller import StockController
@@ -17,6 +18,12 @@ class SellingController(StockController):
"other_charges": "templates/print_formats/includes/taxes.html",
}
def onload(self):
if self.doctype in ("Sales Order", "Delivery Note", "Sales Invoice"):
for item in self.get(self.fname):
item.update(get_available_qty(item.item_code,
item.warehouse))
def validate(self):
super(SellingController, self).validate()
self.validate_max_discount()