mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-31 02:40:43 +02:00
fix: cannot update auth token until token expiry if credentials change
This commit is contained in:
@@ -10,3 +10,8 @@ class EInvoiceSettings(Document):
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
if self.enable and not self.credentials:
|
if self.enable and not self.credentials:
|
||||||
frappe.throw(_("You must add atleast one credentials to be able to use E Invoicing."))
|
frappe.throw(_("You must add atleast one credentials to be able to use E Invoicing."))
|
||||||
|
|
||||||
|
prev_doc = self.get_doc_before_save()
|
||||||
|
if prev_doc.client_secret != self.client_secret or prev_doc.client_id != prev_doc.client_id:
|
||||||
|
self.auth_token = None
|
||||||
|
self.token_expiry = None
|
||||||
|
|||||||
Reference in New Issue
Block a user