This commit is contained in:
gsinghpal
2026-02-27 14:32:32 -05:00
parent b649246e81
commit b925766966
80 changed files with 7831 additions and 1041 deletions

View File

@@ -1408,10 +1408,10 @@ class SaleOrder(models.Model):
pdf_content, _ = inv_report._render_qweb_pdf(
inv_report.report_name, [invoice.id]
)
inv_filename = (
f"{self.name} - {type_label} - "
f"{invoice.name or 'Draft'}.pdf"
)
name_parts = (self.partner_id.name or 'Client').strip().split()
first = name_parts[0] if name_parts else 'Client'
last = name_parts[-1] if len(name_parts) > 1 else ''
inv_filename = f"{first}_{last}_{type_label}_{invoice.name or 'Draft'}.pdf"
inv_attach = self.env['ir.attachment'].create({
'name': inv_filename,
'type': 'binary',