From 699900cbc5246a9d9ee78f8f5b4537de89f9c6af Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 14 Aug 2019 20:48:27 -0500 Subject: [PATCH] Cleanup attribute names for CORE Product model --- tailbone_corepos/views/corepos/products.py | 29 +++++++--------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/tailbone_corepos/views/corepos/products.py b/tailbone_corepos/views/corepos/products.py index 28f8a23..d028205 100644 --- a/tailbone_corepos/views/corepos/products.py +++ b/tailbone_corepos/views/corepos/products.py @@ -43,23 +43,12 @@ class ProductView(CoreOfficeMasterView): labels = { 'id': "ID", 'upc': "UPC", - 'pricemethod': "Price Method", - 'groupprice': "Group Price", - 'specialpricemethod': "Special Price Method", - 'specialgroupprice': "Special Group Price", - 'specialquantity': "Special Quantity", - 'dept_no': "Dept. No.", + 'department_number': "Dept. No.", 'foodstamp': "Food Stamp", - 'scaleprice': "Scale Price", - 'mixmatchcode': "Mix Match Code", - 'tareweight': "Tare Weight", - 'discounttype': "Discount Type", - 'unitofmeasure': "Unit of Measure", - 'qttyEnforced': "Qty. Enforced", - 'idEnforced': "ID Enforced", - 'inUse': "In Use", - 'numflag': "Flags", - 'subdept': "Subdept. No.", + 'unit_of_measure': "Unit of Measure", + 'quantity_enforced': "Qty. Enforced", + 'id_enforced': "ID Enforced", + 'subdepartment_number': "Subdept. No.", 'default_vendor_id': "Default Vendor ID", 'current_origin_id': "Current Origin ID", } @@ -103,21 +92,21 @@ class ProductView(CoreOfficeMasterView): f.set_renderer('vendor', self.render_corepos_vendor) - f.set_renderer('numflag', self.render_flags) + f.set_renderer('flags', self.render_flags) f.set_type('start_date', 'datetime_local') f.set_type('end_date', 'datetime_local') f.set_type('modified', 'datetime_local') f.set_type('normal_price', 'currency') - f.set_type('groupprice', 'currency') + f.set_type('group_price', 'currency') f.set_type('special_price', 'currency') - f.set_type('specialgroupprice', 'currency') + f.set_type('special_group_price', 'currency') f.set_type('cost', 'currency') f.set_type('deposit', 'currency') def render_flags(self, product, field): - flags = product.numflag + flags = product.flags if not flags: return ""