From f6dc60e3c4e0adbf6155a6ff02a7551ea88ef6e4 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:00:58 +0100 Subject: [PATCH] feat: RFQ print preview (cherry picked from commit 27f05145ae700e1177bb2c2541e6d49f73cdbf7e) --- .../request_for_quotation/request_for_quotation.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py index 6b39982bb816..8226aa32c0e1 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py @@ -80,6 +80,15 @@ def on_submit(self): supplier.quote_status = "Pending" self.send_to_supplier() + def before_print(self, settings=None): + """Use the first suppliers data to render the print preview.""" + if self.vendor or not self.suppliers: + # If a specific supplier is already set, via Tools > Download PDF, + # we don't want to override it. + return + + self.update_supplier_part_no(self.suppliers[0].supplier) + def on_cancel(self): self.db_set("status", "Cancelled")