From e7871380a9454521926fb4386ec41fb61d5e210a Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 9 Nov 2021 15:49:42 -0600 Subject: [PATCH] Add "true margin" to products XLSX export --- tailbone/views/products.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tailbone/views/products.py b/tailbone/views/products.py index b1feecc3..b2cb835e 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -663,6 +663,7 @@ class ProductView(MasterView): fields.append('vendor_name') fields.append('vendor_item_code') fields.append('unit_cost') + fields.append('true_margin') return fields @@ -724,6 +725,11 @@ class ProductView(MasterView): if 'unit_cost' in fields: row['unit_cost'] = product.cost.unit_cost if product.cost else None + if 'true_margin' in fields: + row['true_margin'] = None + if product.volatile and product.volatile.true_margin: + row['true_margin'] = product.volatile.true_margin + return row def get_instance(self):