Fix: Purchase Return was being saved as Purchase entries

Fix: Receipt Vouchers could not be deleted as wrong permission was checked

v7.1.1
This commit is contained in:
Amritanshu Agrawal 2020-09-13 07:24:24 +05:30
parent 9b483e6d65
commit 8b82cf8157
4 changed files with 4 additions and 4 deletions

View File

@ -250,5 +250,5 @@ def get_id(
def show_blank(
request: Request, db: Session = Depends(get_db), user: UserToken = Security(get_user, scopes=["purchase-return"]),
):
additional_info = {"date": get_date(request.session), "type": "Purchase"}
additional_info = {"date": get_date(request.session), "type": "Purchase Return"}
return blank_voucher(additional_info, db)

View File

@ -71,7 +71,7 @@ def post_voucher(
def check_delete_permissions(voucher: Voucher, user: UserToken):
voucher_type = VoucherType.by_id(voucher.type).name.replace(" ", "-").lower()
if voucher_type in ["payment", "purchase"]:
if voucher_type in ["payment", "receipt"]:
voucher_type = "journal"
if voucher.posted and "edit-posted-vouchers" not in user.permissions:
raise HTTPException(

View File

@ -1,6 +1,6 @@
{
"name": "overlord",
"version": "7.1.0",
"version": "7.1.1",
"scripts": {
"ng": "ng",
"start": "ng serve",

View File

@ -11,7 +11,7 @@ with open(os.path.join(here, 'requirements.txt'), "r") as r:
requires = r.read().splitlines()
setup(name='brewman',
version='7.1.0',
version='7.1.1',
description='brewman',
long_description=README + '\n\n' + CHANGES,
classifiers=[