Skip to content

qt: disable Save button for certain multiline payment identifiers - #10930

Draft
accumulator wants to merge 2 commits into
spesmilo:masterfrom
accumulator:qt_edit_saved_invoice_fixes
Draft

qt: disable Save button for certain multiline payment identifiers#10930
accumulator wants to merge 2 commits into
spesmilo:masterfrom
accumulator:qt_edit_saved_invoice_fixes

Conversation

@accumulator

@accumulator accumulator commented Sep 4, 2026

Copy link
Copy Markdown
Member

we can save multiline PI's as invoice, as long as we don't enter the do_edit_invoice flow with outputs that cannot be rendered to multiline CSV.

This means in these cases saving invoice should be enabled only when:

  1. amount to send is non-zero (at least one of the outputs has a non-zero value), or
  2. if total amount to send is zero, all outputs are addresses

In case (1), we skip the do_edit_invoice flow
In case (2), we can render all outputs

fixes #10132

Note: this PR doesn't handle existing saved invoices that violate the above constraints.

Note2: this also fixes another pre-existing bug, where do_edit_invoice flow is entered for a multi-output invoice, but only the first output is put in the recipient field, ignoring the other outputs when subsequently saving/paying.

@accumulator
accumulator force-pushed the qt_edit_saved_invoice_fixes branch 2 times, most recently from 14a649c to 24ff861 Compare September 4, 2026 13:13
we can save multiline PI's as invoice, as long as we don't enter the
do_edit_invoice flow with outputs that cannot be rendered to multiline CSV.

This means in these cases saving invoice should be enabled only when:
1. amount to send is non-zero (at least one of the outputs has a non-zero value), or
2. if total amount to send is zero, all outputs are addresses

In case (1), we skip the do_edit_invoice flow
In case (2), we can render all outputs

Note: this doesn't handle existing saved invoices that violate the above
constraints.

Note2: this also fixes a pre-existing bug, where do_edit_invoice flow is entered
for a multi-output invoice, but only the first output is put in the recipient field,
ignoring the other outputs when subsequently saving/paying.
@accumulator
accumulator force-pushed the qt_edit_saved_invoice_fixes branch from 24ff861 to 61fd484 Compare September 4, 2026 14:51
@accumulator
accumulator force-pushed the qt_edit_saved_invoice_fixes branch from 748a325 to 901a52c Compare September 4, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'NoneType' object has no attribute 'strip'

1 participant