From 229075048bd17d945da6ef2b8af71f500db7e8ea Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 00:10:58 +0530 Subject: [PATCH] feat(RFQ): special properties in print preview (backport #38725) (#38726) feat: RFQ print preview (cherry picked from commit 27f05145ae700e1177bb2c2541e6d49f73cdbf7e) Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com> --- .../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 6b39982bb81..8226aa32c0e 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 @@ class RequestforQuotation(BuyingController): 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")