mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 23:22:52 +00:00
Merge pull request #17760 from nabinhait/multi-fixes99
fix: Error due to merging of lead/customer to party_name
This commit is contained in:
@@ -237,6 +237,10 @@ class AccountsController(TransactionBase):
|
|||||||
document_type = "{} Item".format(self.doctype)
|
document_type = "{} Item".format(self.doctype)
|
||||||
parent_dict.update({"document_type": document_type})
|
parent_dict.update({"document_type": document_type})
|
||||||
|
|
||||||
|
# party_name field used for customer in opportunity and quotation
|
||||||
|
if not parent_dict.get("customer") and parent_dict.get("party_name"):
|
||||||
|
parent_dict.update({"customer": parent_dict.get("party_name")})
|
||||||
|
|
||||||
for item in self.get("items"):
|
for item in self.get("items"):
|
||||||
if item.get("item_code"):
|
if item.get("item_code"):
|
||||||
args = parent_dict.copy()
|
args = parent_dict.copy()
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ def get_data(filters):
|
|||||||
`tabCommunication`.content, `tabCommunication`.communication_date
|
`tabCommunication`.content, `tabCommunication`.communication_date
|
||||||
from
|
from
|
||||||
(
|
(
|
||||||
(select name, lead from `tabOpportunity` where lead = %(lead)s)
|
(select name, party_name as lead from `tabOpportunity` where opportunity_from='Lead' and party_name = %(lead)s)
|
||||||
union
|
union
|
||||||
(select name, lead from `tabQuotation` where lead = %(lead)s)
|
(select name, party_name as lead from `tabQuotation` where quotation_to = 'Lead' and party_name = %(lead)s)
|
||||||
union
|
union
|
||||||
(select name, lead from `tabIssue` where lead = %(lead)s and status!='Closed')
|
(select name, lead from `tabIssue` where lead = %(lead)s and status!='Closed')
|
||||||
union
|
union
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class JobCard(Document):
|
|||||||
self.total_completed_qty = 0.0
|
self.total_completed_qty = 0.0
|
||||||
self.total_time_in_mins = 0.0
|
self.total_time_in_mins = 0.0
|
||||||
|
|
||||||
|
if self.get('time_logs'):
|
||||||
for d in self.get('time_logs'):
|
for d in self.get('time_logs'):
|
||||||
if get_datetime(d.from_time) > get_datetime(d.to_time):
|
if get_datetime(d.from_time) > get_datetime(d.to_time):
|
||||||
frappe.throw(_("Row {0}: From time must be less than to time").format(d.idx))
|
frappe.throw(_("Row {0}: From time must be less than to time").format(d.idx))
|
||||||
@@ -112,7 +113,9 @@ class JobCard(Document):
|
|||||||
for_quantity += doc.total_completed_qty
|
for_quantity += doc.total_completed_qty
|
||||||
time_in_mins += doc.total_time_in_mins
|
time_in_mins += doc.total_time_in_mins
|
||||||
for time_log in doc.time_logs:
|
for time_log in doc.time_logs:
|
||||||
|
if time_log.from_time:
|
||||||
from_time_list.append(time_log.from_time)
|
from_time_list.append(time_log.from_time)
|
||||||
|
if time_log.to_time:
|
||||||
to_time_list.append(time_log.to_time)
|
to_time_list.append(time_log.to_time)
|
||||||
|
|
||||||
if for_quantity:
|
if for_quantity:
|
||||||
|
|||||||
@@ -4261,7 +4261,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"modified": "2019-05-09 18:47:30.475833",
|
"modified": "2019-05-24 16:10:14.128517",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
|
|||||||
Reference in New Issue
Block a user