import frappe

def set_title(doc, method):
    """Set title from company name and pickup date."""
    if doc.company_name and doc.pickup_date:
        doc.title = f"{doc.company_name} - {doc.pickup_date}"
    elif doc.company_name:
        doc.title = doc.company_name
