From 492546d0f601353b4cce9c2dad870751d033544d Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 2 Mar 2021 09:26:36 -0600 Subject: [PATCH] Add hover text for subdepartment name, in pricing batch row grid --- tailbone/views/batch/pricing.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tailbone/views/batch/pricing.py b/tailbone/views/batch/pricing.py index 6a8c56f2..57a97a62 100644 --- a/tailbone/views/batch/pricing.py +++ b/tailbone/views/batch/pricing.py @@ -199,6 +199,8 @@ class PricingBatchView(BatchMasterView): g.set_filter('vendor_id', model.Vendor.id) g.set_renderer('vendor_id', self.render_vendor_id) + g.set_renderer('subdepartment_number', self.render_subdepartment_number) + g.set_type('old_price', 'currency') g.set_type('new_price', 'currency') g.set_type('price_diff', 'currency') @@ -213,6 +215,13 @@ class PricingBatchView(BatchMasterView): return "" return vendor_id + def render_subdepartment_number(self, row, field): + if row.subdepartment_number: + if row.subdepartment_name: + return HTML.tag('span', title=row.subdepartment_name, + c=six.text_type(row.subdepartment_number)) + return row.subdepartment_number + def render_true_margin(self, row, field): margin = row.true_margin if margin: