Skip to content

fix: set values to None so set_missing_values works - #11

Merged
barredterra merged 2 commits into
version-16from
fix-empty-address
Sep 8, 2026
Merged

fix: set values to None so set_missing_values works#11
barredterra merged 2 commits into
version-16from
fix-empty-address

Conversation

@HenningWendtland

@HenningWendtland HenningWendtland commented Sep 8, 2026

Copy link
Copy Markdown
Member

The bug:
Surfaced on further testing of the changes introduced in PR #10:
set_missing_values() does not auto-fill empty strings (''), just None. The Problem was already present for the "sales_taxes_and_charges" field.

Impact:
If a value in the simple subscription in for example the "customer_address" field get's set and unset it is '' in the DB, not None. So the Address is then empty after invoice creation.

Further Note on the Taxes Site:
The Bug did only hit when a Pricing Rule existed and matched. Otherwise (for example if only a Default 19% Template was present or if Item Taxes applied it did not bite)

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking gap in regression coverage for the newly corrected defaulting behavior.

The normalization matches the documented semantics of optional fields and no behavioral or security defect was established, but the interaction with Sales Invoice defaulting is not directly tested.

Files Needing Attention: simple_subscription/simple_subscription/doctype/simple_subscription/simple_subscription.py

Prompt To Fix All With AI
### Issue 1
simple_subscription/simple_subscription/doctype/simple_subscription/simple_subscription.py:118-129
**Defaulting Behavior Lacks Coverage**

These assignments now normalize three optional values to `None` and rely on the later `set_missing_values()` call to populate address and tax defaults. No regression test covers invoice creation with blank versus explicitly selected values, so changes to Frappe's defaulting behavior or this method could silently break the fix.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix: simplify syntax and add taxes case ..." | Re-trigger Greptile

@barredterra
barredterra merged commit ae115ab into version-16 Sep 8, 2026
6 checks passed
@barredterra
barredterra deleted the fix-empty-address branch September 8, 2026 21:11
@barredterra barredterra changed the title fix empty address fix: empty address Sep 8, 2026
@barredterra barredterra changed the title fix: empty address fix: set values to None so set_missing_values works Sep 8, 2026
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.

2 participants