feat(RFQ): special properties in print preview (backport #38725) (#38726)

feat: RFQ print preview

(cherry picked from commit 27f05145ae)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2023-12-14 00:10:58 +05:30
committed by GitHub
parent 0d49dd3648
commit 229075048b

View File

@@ -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")