fix: do not update PE title during data import (#24835)

* fix: do not update PE title during data import

Related issue: ISS-20-21-10132

* fix: make title field read only
This commit is contained in:
Ankush Menat
2021-03-11 16:08:40 +05:30
committed by GitHub
parent 86a163fce5
commit 5ae40871d8
2 changed files with 8 additions and 3 deletions

View File

@@ -531,7 +531,8 @@
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
"label": "Title", "label": "Title",
"print_hide": 1 "print_hide": 1,
"read_only": 1
}, },
{ {
"depends_on": "party", "depends_on": "party",
@@ -575,7 +576,7 @@
} }
], ],
"is_submittable": 1, "is_submittable": 1,
"modified": "2019-11-06 12:59:43.151721", "modified": "2021-03-10 13:05:16.958866",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Payment Entry", "name": "Payment Entry",
@@ -619,4 +620,4 @@
"sort_order": "DESC", "sort_order": "DESC",
"title_field": "title", "title_field": "title",
"track_changes": 1 "track_changes": 1
} }

View File

@@ -441,6 +441,10 @@ class PaymentEntry(AccountsController):
.format(total_negative_outstanding), InvalidPaymentEntry) .format(total_negative_outstanding), InvalidPaymentEntry)
def set_title(self): def set_title(self):
if frappe.flags.in_import and self.title:
# do not set title dynamically if title exists during data import.
return
if self.payment_type in ("Receive", "Pay"): if self.payment_type in ("Receive", "Pay"):
self.title = self.party self.title = self.party
else: else: