Skip to content

Commit

Permalink
Merge pull request #43301 from blaggacao/fix/undue-db-write-on-paymen…
Browse files Browse the repository at this point in the history
…t-entry

chore: cant write in (potential) read-only mode
  • Loading branch information
blaggacao authored Sep 19, 2024
2 parents 444f085 + 87d7c4f commit 3e54ad5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,10 @@ def set_missing_ref_details(
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"):
Expand Down

0 comments on commit 3e54ad5

Please sign in to comment.