Merge pull request #43301 from blaggacao/fix/undue-db-write-on-payment-entry

chore: cant write in (potential) read-only mode
This commit is contained in:
David Arnold
2024-09-19 16:49:31 +02:00
committed by GitHub

View File

@@ -524,7 +524,10 @@ class PaymentEntry(AccountsController):
continue
if field == "exchange_rate" or not d.get(field) or force:
d.db_set(field, value)
if self.get("_action") in ("submit", "cancel"):
d.db_set(field, value)
else:
d.set(field, value)
def validate_payment_type(self):
if self.payment_type not in ("Receive", "Pay", "Internal Transfer"):