Changeset 28238c6 in tailbone
- Timestamp:
- 07/23/2022 10:09:47 PM (6 months ago)
- Branches:
- master
- Children:
- e656f76
- Parents:
- e77ca93
- git-author:
- Lance Edgar <lance@…> (07/23/2022 10:06:18 PM)
- git-committer:
- Lance Edgar <lance@…> (07/23/2022 10:09:47 PM)
- Location:
- tailbone
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tailbone/views/customers.py
re77ca93 r28238c6 51 51 touchable = True 52 52 supports_autocomplete = True 53 configurable = True 53 54 54 55 # whether to show "view full profile" helper for customer view … … 93 94 ] 94 95 96 def get_expose_active_in_pos(self): 97 if not hasattr(self, '_expose_active_in_pos'): 98 self._expose_active_in_pos = self.rattail_config.getbool( 99 'rattail', 'customers.active_in_pos', 100 default=False) 101 return self._expose_active_in_pos 102 95 103 def configure_grid(self, g): 96 104 super(CustomerView, self).configure_grid(g) … … 133 141 134 142 # active_in_pos 135 g.filters['active_in_pos'].default_active = True 136 g.filters['active_in_pos'].default_verb = 'is_true' 143 if self.get_expose_active_in_pos(): 144 g.filters['active_in_pos'].default_active = True 145 g.filters['active_in_pos'].default_verb = 'is_true' 137 146 138 147 g.set_link('id') … … 143 152 144 153 def grid_extra_class(self, customer, i): 145 if not customer.active_in_pos: 146 return 'warning' 154 if self.get_expose_active_in_pos(): 155 if not customer.active_in_pos: 156 return 'warning' 147 157 148 158 def get_instance(self): … … 246 256 customer = f.model_instance 247 257 permission_prefix = self.get_permission_prefix() 258 259 if not self.get_expose_active_in_pos(): 260 f.remove('active_in_pos', 261 'active_in_pos_sticky') 248 262 249 263 # members … … 431 445 return self.redirect(self.request.get_referrer()) 432 446 447 def configure_get_simple_settings(self): 448 return [ 449 450 # POS 451 {'section': 'rattail', 452 'option': 'customers.active_in_pos', 453 'type': bool}, 454 455 ] 456 433 457 @classmethod 434 458 def defaults(cls, config):
Note: See TracChangeset
for help on using the changeset viewer.