fix(italy): skip e-invoicing for opening invoices#57314
Conversation
Confidence Score: 5/5Safe to merge — the change is three one-line guard additions that only affect opening invoices, and no existing logic or queries are modified. All three guards use the established No files require special attention. Reviews (3): Last reviewed commit: "fix(italy): skip e-invoicing for opening..." | Re-trigger Greptile |
| def test_opening_sales_invoice_skips_einvoice_validation_and_export(self): | ||
| invoice = frappe._dict(doctype="Sales Invoice", is_opening="Yes") | ||
|
|
||
| sales_invoice_validate(invoice) | ||
| sales_invoice_on_submit(invoice, None) |
There was a problem hiding this comment.
Test lacks explicit assertions
The test verifies the guard implicitly — if the early-return wasn't there, both functions would throw (e.g., sales_invoice_validate would reach if not doc.company_address and throw, and sales_invoice_on_submit would call get_company_country(None)). That implicit check is enough to catch a regression, but adding self.assertIsNone(sales_invoice_validate(invoice)) (and similarly for on_submit) would make the intent explicit and guard against future refactors that silently swallow the call.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
ce0e82d to
f328018
Compare
Changes: