Fix: ProductLedger was crapping out because of ambiguous join in opening balace. (Probably triggered by upgrade in sqlalchemy)

Chore: Updated the dev dependencies as Angular 7 does not support Typescript 3.2 and further
This commit is contained in:
Amritanshu
2019-04-15 11:02:54 +05:30
parent 72e8801472
commit 403b9a207a
5 changed files with 8 additions and 9 deletions

View File

@ -38,7 +38,6 @@ def show_blank(request):
route_name="api_ledger_id",
renderer="json",
permission="Ledger",
trans=True,
)
def show_data(request):
account = (

View File

@ -46,7 +46,6 @@ def show_blank(request):
route_name="api_product_ledger_id",
renderer="json",
permission="Product Ledger",
trans=True,
)
def show_data(request):
id = to_uuid(request.matchdict["id"])
@ -158,7 +157,8 @@ def opening_balance(product_id, start_date, dbsession):
func.sum(Inventory.quantity * Journal.debit),
func.sum(Inventory.amount * Journal.debit),
)
.join(Voucher)
.join(Inventory.voucher)
.join(Voucher.journals)
.filter(Voucher.id == Inventory.voucher_id)
.filter(Voucher.id == Journal.voucher_id)
.filter(Inventory.product_id == product_id)