Fix: in the current sqlalchemy non-lowercased labels are not being quoted causing an error.

This commit is contained in:
Amritanshu 2014-05-27 12:01:45 +05:30
parent 17750f7721
commit eb63166f39

@ -33,7 +33,7 @@ def report_data(request):
def build_report(date):
date = datetime.datetime.strptime(date, '%d-%b-%Y')
amount_sum = func.sum(Journal.debit * Inventory.quantity * Inventory.rate * (1 + Inventory.tax)).label('Amount')
amount_sum = func.sum(Journal.debit * Inventory.quantity * Inventory.rate * (1 + Inventory.tax)).label('amount')
quantity_sum = func.sum(Journal.debit * Inventory.quantity).label('Quantity')
query = DBSession.query(Product, quantity_sum, amount_sum) \
.join(Product.inventories).join(Inventory.voucher).join(Voucher.journals) \