mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 11:39:18 +00:00
Co-authored-by: David <52141166+sdavidbastos@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import json
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.contacts.doctype.address.address import get_company_address
|
from frappe.contacts.doctype.address.address import get_company_address
|
||||||
|
from frappe.contacts.doctype.contact.contact import get_default_contact
|
||||||
from frappe.desk.notifications import clear_doctype_notifications
|
from frappe.desk.notifications import clear_doctype_notifications
|
||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
from frappe.model.utils import get_fetch_values
|
from frappe.model.utils import get_fetch_values
|
||||||
@@ -1169,18 +1170,24 @@ def make_shipment(source_name, target_doc=None):
|
|||||||
# As we are using session user details in the pickup_contact then pickup_contact_person will be session user
|
# As we are using session user details in the pickup_contact then pickup_contact_person will be session user
|
||||||
target.pickup_contact_person = frappe.session.user
|
target.pickup_contact_person = frappe.session.user
|
||||||
|
|
||||||
if source.contact_person:
|
contact_person = source.contact_person or get_default_contact("Customer", source.customer)
|
||||||
|
if contact_person:
|
||||||
contact = frappe.db.get_value(
|
contact = frappe.db.get_value(
|
||||||
"Contact", source.contact_person, ["email_id", "phone", "mobile_no"], as_dict=1
|
"Contact", contact_person, ["email_id", "phone", "mobile_no"], as_dict=1
|
||||||
)
|
)
|
||||||
delivery_contact_display = f"{source.contact_display}"
|
|
||||||
if contact:
|
delivery_contact_display = source.contact_display or contact_person or ""
|
||||||
|
if contact and not source.contact_display:
|
||||||
if contact.email_id:
|
if contact.email_id:
|
||||||
delivery_contact_display += "<br>" + contact.email_id
|
delivery_contact_display += "<br>" + contact.email_id
|
||||||
if contact.phone:
|
if contact.phone:
|
||||||
delivery_contact_display += "<br>" + contact.phone
|
delivery_contact_display += "<br>" + contact.phone
|
||||||
if contact.mobile_no and not contact.phone:
|
if contact.mobile_no and not contact.phone:
|
||||||
delivery_contact_display += "<br>" + contact.mobile_no
|
delivery_contact_display += "<br>" + contact.mobile_no
|
||||||
|
|
||||||
|
target.delivery_contact_name = contact_person
|
||||||
|
if contact and contact.email_id and not target.delivery_contact_email:
|
||||||
|
target.delivery_contact_email = contact.email_id
|
||||||
target.delivery_contact = delivery_contact_display
|
target.delivery_contact = delivery_contact_display
|
||||||
|
|
||||||
if source.shipping_address_name:
|
if source.shipping_address_name:
|
||||||
|
|||||||
Reference in New Issue
Block a user