many fixes to print

This commit is contained in:
Rushabh Mehta
2014-07-21 18:25:45 +05:30
committed by Anand Doshi
parent d82352eacc
commit 5b51cc86a9
38 changed files with 480 additions and 924 deletions

View File

@@ -11,6 +11,13 @@ from erpnext.accounts.party import get_party_details
from erpnext.controllers.stock_controller import StockController
class BuyingController(StockController):
def __setup__(self):
if hasattr(self, "fname"):
self.table_print_templates = {
self.fname: "templates/print_formats/includes/item_grid.html",
"other_charges": "templates/print_formats/includes/taxes.html",
}
def validate(self):
super(BuyingController, self).validate()
if getattr(self, "supplier", None) and not self.supplier_name:
@@ -324,4 +331,4 @@ class BuyingController(StockController):
if d.meta.get_field("stock_qty") and not d.stock_qty:
if not d.conversion_factor:
frappe.throw(_("Row {0}: Conversion Factor is mandatory"))
d.stock_qty = flt(d.qty) * flt(d.conversion_factor)
d.stock_qty = flt(d.qty) * flt(d.conversion_factor)