From 25b6047ff608360f08fb68911a6dfc4b053dac81 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 18 Feb 2022 12:41:36 -0600 Subject: [PATCH] Update config defaults for all corepos views --- tailbone_corepos/views/corepos/batches.py | 13 +++++++++++-- tailbone_corepos/views/corepos/coupons.py | 11 +++++++++-- tailbone_corepos/views/corepos/customers.py | 13 +++++++++++-- tailbone_corepos/views/corepos/departments.py | 11 +++++++++-- tailbone_corepos/views/corepos/employees.py | 11 +++++++++-- tailbone_corepos/views/corepos/groups.py | 9 ++++++++- tailbone_corepos/views/corepos/likecodes.py | 11 +++++++++-- tailbone_corepos/views/corepos/members.py | 13 +++++++++++-- tailbone_corepos/views/corepos/origins.py | 19 ++++++++++++++++--- tailbone_corepos/views/corepos/parameters.py | 11 +++++++++-- tailbone_corepos/views/corepos/products.py | 15 +++++++++++++-- .../views/corepos/purchaseorders.py | 11 +++++++++-- tailbone_corepos/views/corepos/scaleitems.py | 11 +++++++++-- tailbone_corepos/views/corepos/stores.py | 11 +++++++++-- .../views/corepos/subdepartments.py | 11 +++++++++-- .../views/corepos/superdepartments.py | 11 +++++++++-- .../views/corepos/tablesyncrules.py | 11 +++++++++-- tailbone_corepos/views/corepos/taxrates.py | 11 +++++++++-- .../views/corepos/transactions.py | 11 +++++++++-- tailbone_corepos/views/corepos/users.py | 11 +++++++++-- tailbone_corepos/views/corepos/vendoritems.py | 11 +++++++++-- tailbone_corepos/views/corepos/vendors.py | 11 +++++++++-- 22 files changed, 214 insertions(+), 44 deletions(-) diff --git a/tailbone_corepos/views/corepos/batches.py b/tailbone_corepos/views/corepos/batches.py index 2708199..80135b7 100644 --- a/tailbone_corepos/views/corepos/batches.py +++ b/tailbone_corepos/views/corepos/batches.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -152,6 +152,15 @@ class BatchView(CoreOfficeMasterView): g.set_sort_defaults('id') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + BatchTypeView = kwargs.get('BatchTypeView', base['BatchTypeView']) BatchTypeView.defaults(config) + + BatchView = kwargs.get('BatchView', base['BatchView']) BatchView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/coupons.py b/tailbone_corepos/views/corepos/coupons.py index 96e4b29..f680af9 100644 --- a/tailbone_corepos/views/corepos/coupons.py +++ b/tailbone_corepos/views/corepos/coupons.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -115,5 +115,12 @@ class HouseCouponView(CoreOfficeMasterView): f.set_type('end_date', 'date_jquery') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + HouseCouponView = kwargs.get('HouseCouponView', base['HouseCouponView']) HouseCouponView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/customers.py b/tailbone_corepos/views/corepos/customers.py index fc787f8..3febc35 100644 --- a/tailbone_corepos/views/corepos/customers.py +++ b/tailbone_corepos/views/corepos/customers.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -230,6 +230,15 @@ class SuspensionView(CoreOfficeMasterView): return render_member_info(self.request, custdata, field) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + CustomerView = kwargs.get('CustomerView', base['CustomerView']) CustomerView.defaults(config) + + SuspensionView = kwargs.get('SuspensionView', base['SuspensionView']) SuspensionView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/departments.py b/tailbone_corepos/views/corepos/departments.py index 006f908..ed6c8aa 100644 --- a/tailbone_corepos/views/corepos/departments.py +++ b/tailbone_corepos/views/corepos/departments.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -88,5 +88,12 @@ class DepartmentView(CoreOfficeMasterView): office_url, department.number) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + DepartmentView = kwargs.get('DepartmentView', base['DepartmentView']) DepartmentView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/employees.py b/tailbone_corepos/views/corepos/employees.py index 99ac9ec..a8d1c27 100644 --- a/tailbone_corepos/views/corepos/employees.py +++ b/tailbone_corepos/views/corepos/employees.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -80,5 +80,12 @@ class EmployeeView(CoreOfficeMasterView): office_url, employee.number) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + EmployeeView = kwargs.get('EmployeeView', base['EmployeeView']) EmployeeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/groups.py b/tailbone_corepos/views/corepos/groups.py index 2578190..1609c9a 100644 --- a/tailbone_corepos/views/corepos/groups.py +++ b/tailbone_corepos/views/corepos/groups.py @@ -149,5 +149,12 @@ class UserGroupView(CoreOfficeMasterView): return kwargs -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + UserGroupView = kwargs.get('UserGroupView', base['UserGroupView']) UserGroupView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/likecodes.py b/tailbone_corepos/views/corepos/likecodes.py index 2249179..8157701 100644 --- a/tailbone_corepos/views/corepos/likecodes.py +++ b/tailbone_corepos/views/corepos/likecodes.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -124,5 +124,12 @@ class LikeCodeView(CoreOfficeMasterView): g.set_link('description') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + LikeCodeView = kwargs.get('LikeCodeView', base['LikeCodeView']) LikeCodeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/members.py b/tailbone_corepos/views/corepos/members.py index 947e6c9..b526273 100644 --- a/tailbone_corepos/views/corepos/members.py +++ b/tailbone_corepos/views/corepos/members.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -180,6 +180,15 @@ class MemberView(CoreOfficeMasterView): office_url=office_url) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + MemberTypeView = kwargs.get('MemberTypeView', base['MemberTypeView']) MemberTypeView.defaults(config) + + MemberView = kwargs.get('MemberView', base['MemberView']) MemberView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/origins.py b/tailbone_corepos/views/corepos/origins.py index ad1d573..cc1e46d 100644 --- a/tailbone_corepos/views/corepos/origins.py +++ b/tailbone_corepos/views/corepos/origins.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -204,8 +204,21 @@ class OriginView(CoreOfficeMasterView): return text -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + OriginCountryView = kwargs.get('OriginCountryView', base['OriginCountryView']) OriginCountryView.defaults(config) - OriginStateProvinceView.defaults(config) + + OridingStateProvinceView = kwargs.get('OridingStateProvinceView', base['OridingStateProvinceView']) + OridingStateProvinceView.defaults(config) + + OriginRegionView = kwargs.get('OriginRegionView', base['OriginRegionView']) OriginRegionView.defaults(config) + + OriginView = kwargs.get('OriginView', base['OriginView']) OriginView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/parameters.py b/tailbone_corepos/views/corepos/parameters.py index f88bf2f..b1d3718 100644 --- a/tailbone_corepos/views/corepos/parameters.py +++ b/tailbone_corepos/views/corepos/parameters.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -53,5 +53,12 @@ class ParameterView(CoreOfficeMasterView): g.set_link('param_value') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + ParameterView = kwargs.get('ParameterView', base['ParameterView']) ParameterView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/products.py b/tailbone_corepos/views/corepos/products.py index 518f15b..370e3d1 100644 --- a/tailbone_corepos/views/corepos/products.py +++ b/tailbone_corepos/views/corepos/products.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -393,7 +393,18 @@ class ProductFlagView(CoreOfficeMasterView): return 'warning' -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + ProductView = kwargs.get('ProductView', base['ProductView']) ProductView.defaults(config) + + ProductUserView = kwargs.get('ProductUserView', base['ProductUserView']) ProductUserView.defaults(config) + + ProductFlagView = kwargs.get('ProductFlagView', base['ProductFlagView']) ProductFlagView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/purchaseorders.py b/tailbone_corepos/views/corepos/purchaseorders.py index 119d5a7..5f3e61a 100644 --- a/tailbone_corepos/views/corepos/purchaseorders.py +++ b/tailbone_corepos/views/corepos/purchaseorders.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -159,5 +159,12 @@ class PurchaseOrderView(CoreOfficeMasterView): g.set_type('received_total_cost', 'currency') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + PurchaseOrderView = kwargs.get('PurchaseOrderView', base['PurchaseOrderView']) PurchaseOrderView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/scaleitems.py b/tailbone_corepos/views/corepos/scaleitems.py index 80087b4..fc133c9 100644 --- a/tailbone_corepos/views/corepos/scaleitems.py +++ b/tailbone_corepos/views/corepos/scaleitems.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -70,5 +70,12 @@ class ScaleItemView(CoreOfficeMasterView): f.set_renderer('product', self.render_corepos_product) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + ScaleItemView = kwargs.get('ScaleItemView', base['ScaleItemView']) ScaleItemView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/stores.py b/tailbone_corepos/views/corepos/stores.py index ad85749..1556f4b 100644 --- a/tailbone_corepos/views/corepos/stores.py +++ b/tailbone_corepos/views/corepos/stores.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -84,5 +84,12 @@ class StoreView(CoreOfficeMasterView): g.set_link('description') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + StoreView = kwargs.get('StoreView', base['StoreView']) StoreView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/subdepartments.py b/tailbone_corepos/views/corepos/subdepartments.py index 99a2a95..c9ccf34 100644 --- a/tailbone_corepos/views/corepos/subdepartments.py +++ b/tailbone_corepos/views/corepos/subdepartments.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -59,5 +59,12 @@ class SubdepartmentView(CoreOfficeMasterView): g.set_link('name') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + SubdepartmentView = kwargs.get('SubdepartmentView', base['SubdepartmentView']) SubdepartmentView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/superdepartments.py b/tailbone_corepos/views/corepos/superdepartments.py index 3f78217..2336cc6 100644 --- a/tailbone_corepos/views/corepos/superdepartments.py +++ b/tailbone_corepos/views/corepos/superdepartments.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -135,5 +135,12 @@ class SuperDepartmentView(base.DepartmentView): g.set_sort_defaults('number') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + SuperDepartmentView = kwargs.get('SuperDepartmentView', base['SuperDepartmentView']) SuperDepartmentView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/tablesyncrules.py b/tailbone_corepos/views/corepos/tablesyncrules.py index 426c9b0..b44b635 100644 --- a/tailbone_corepos/views/corepos/tablesyncrules.py +++ b/tailbone_corepos/views/corepos/tablesyncrules.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -39,5 +39,12 @@ class TableSyncRuleView(CoreOfficeMasterView): route_prefix = 'corepos.table_sync_rules' -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TableSyncRuleView = kwargs.get('TableSyncRuleView', base['TableSyncRuleView']) TableSyncRuleView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/taxrates.py b/tailbone_corepos/views/corepos/taxrates.py index 345f00c..0f0ae07 100644 --- a/tailbone_corepos/views/corepos/taxrates.py +++ b/tailbone_corepos/views/corepos/taxrates.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -57,5 +57,12 @@ class TaxRateView(CoreOfficeMasterView): g.set_link('description') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TaxRateView = kwargs.get('TaxRateView', base['TaxRateView']) TaxRateView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/transactions.py b/tailbone_corepos/views/corepos/transactions.py index 7188d63..ca5679b 100644 --- a/tailbone_corepos/views/corepos/transactions.py +++ b/tailbone_corepos/views/corepos/transactions.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -127,5 +127,12 @@ class TransactionDetailView(CoreOfficeMasterView): cls._defaults(config) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TransactionDetailView = kwargs.get('TransactionDetailView', base['TransactionDetailView']) TransactionDetailView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/users.py b/tailbone_corepos/views/corepos/users.py index 3558d7d..dbc5083 100644 --- a/tailbone_corepos/views/corepos/users.py +++ b/tailbone_corepos/views/corepos/users.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -82,5 +82,12 @@ class UserView(CoreOfficeMasterView): f.remove('email') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + UserView = kwargs.get('UserView', base['UserView']) UserView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/vendoritems.py b/tailbone_corepos/views/corepos/vendoritems.py index 887297b..47fe443 100644 --- a/tailbone_corepos/views/corepos/vendoritems.py +++ b/tailbone_corepos/views/corepos/vendoritems.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -113,5 +113,12 @@ class VendorItemView(CoreOfficeMasterView): f.set_readonly('modified') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + VendorItemView = kwargs.get('VendorItemView', base['VendorItemView']) VendorItemView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_corepos/views/corepos/vendors.py b/tailbone_corepos/views/corepos/vendors.py index c97f2fb..7f9ce72 100644 --- a/tailbone_corepos/views/corepos/vendors.py +++ b/tailbone_corepos/views/corepos/vendors.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -91,5 +91,12 @@ class VendorView(CoreOfficeMasterView): office_url, vendor.id) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + VendorView = kwargs.get('VendorView', base['VendorView']) VendorView.defaults(config) + + +def includeme(config): + defaults(config)