Changeset - 2fddb86c05a9
[Not reviewed]
default
0 1 0
Dennis Fink - 2 years ago 2022-03-01 10:48:26
dennis.fink@c3l.lu
Specifiy in prompts that 0 can be used to abort
1 file changed with 12 insertions and 5 deletions:
0 comments (0 inline, 0 general)
stockcli/stock.py
Show inline comments
 
@@ -124,7 +124,7 @@ def transfer_by_barcode(barcode: str) ->
 
    )
 

	
 
    from_id = int_prompt.ask(
 
        "From",
 
        "From (Enter 0 to abort)",
 
        choices=choices,
 
        default=int(choices[0]),
 
    )
 
@@ -153,7 +153,7 @@ def transfer_by_barcode(barcode: str) ->
 
    )
 

	
 
    to_id = int_prompt.ask(
 
        "To",
 
        "To (Enter 0 to abort)",
 
        choices=choices,
 
        default=int(choices[0]),
 
    )
 
@@ -161,7 +161,7 @@ def transfer_by_barcode(barcode: str) ->
 
    if not to_id:
 
        return
 

	
 
    amount = int_prompt.ask("Amount")
 
    amount = int_prompt.ask("Amount (Enter 0 to abort)")
 

	
 
    if not amount:
 
        return
 
@@ -197,7 +197,11 @@ def add_by_barcode(barcode: str) -> None
 
        )
 
    )
 

	
 
    amount = int_prompt.ask("Amount")
 
    amount = int_prompt.ask("Amount (Enter 0 to abort)")
 

	
 
    if not amount:
 
        return
 

	
 
    data = {"amount": amount, "transaction_type": "purchase"}
 

	
 
    response = utils.post_request(
 
@@ -231,7 +235,10 @@ def update_by_barcode(barcode: str) -> N
 
            subtitle="[blue]Update stock[/blue]",
 
        )
 
    )
 
    amount = prompt.ask("Amount")
 
    amount = int_prompt.ask("Amount (Enter 0 to abort)")
 

	
 
    if not amount:
 
        return
 

	
 
    data = {
 
        "new_amount": amount,
0 comments (0 inline, 0 general)