コード例 #1
0
 def incr_actions(self):
     """action types that increment/decrement stock"""
     actions = [action_config for action_config in self.config.actions if action_config.action_type in ('receipts', 'consumption')]
     if not any(a.action_type == 'consumption' for a in actions):
         # add implicitly calculated consumption -- TODO find a way to refer to this more explicitly once we track different kinds of consumption (losses, etc.)
         actions.append(CommtrackActionConfig(action_type='consumption', caption='Consumption'))
     if is_psi_domain(self.domain):
         ordering = ['sales', 'receipts', 'consumption']
         actions.sort(key=lambda a: (0, ordering.index(a.action_name)) if a.action_name in ordering else (1, a.action_name))
     return actions
コード例 #2
0
ファイル: standard.py プロジェクト: amonkeykong81/commcare-hq
 def incr_actions(self):
     """action types that increment/decrement stock"""
     actions = [
         action_config for action_config in self.config.actions
         if action_config.action_type in ('receipts', 'consumption')
     ]
     if not any(a.action_type == 'consumption' for a in actions):
         # add implicitly calculated consumption -- TODO find a way to refer to this more explicitly once we track different kinds of consumption (losses, etc.)
         actions.append(
             CommtrackActionConfig(action_type='consumption',
                                   caption='Consumption'))
     if is_psi_domain(self.domain):
         ordering = ['sales', 'receipts', 'consumption']
         actions.sort(key=lambda a: (0, ordering.index(a.action_name))
                      if a.action_name in ordering else (1, a.action_name))
     return actions
コード例 #3
0
ファイル: util.py プロジェクト: NoahCarnahan/commcare-hq
 def _village_classes(domain):
     # todo: meh.
     if is_psi_domain(domain):
         return [
             _('Town'),
             _('A'),
             _('B'),
             _('C'),
             _('D'),
             _('E'),
         ]
     else:
         return [
             _('Village'),
             _('City'),
             _('Town'),
             _('Hamlet'),
         ]
コード例 #4
0
ファイル: util.py プロジェクト: amonkeykong81/commcare-hq
 def _village_classes(domain):
     # todo: meh.
     if is_psi_domain(domain):
         return [
             _('Town'),
             _('A'),
             _('B'),
             _('C'),
             _('D'),
             _('E'),
         ]
     else:
         return [
             _('Village'),
             _('City'),
             _('Town'),
             _('Hamlet'),
         ]
コード例 #5
0
ファイル: standard.py プロジェクト: rigambhir/commcare-hq
def _enabled_hack(domain):
    return not is_psi_domain(domain)
コード例 #6
0
ファイル: util.py プロジェクト: kkrampa/commcare-hq
 def _village_classes(domain):
     # todo: meh.
     if is_psi_domain(domain):
         return [_("Town"), _("A"), _("B"), _("C"), _("D"), _("E")]
     else:
         return [_("Village"), _("City"), _("Town"), _("Hamlet")]
コード例 #7
0
ファイル: standard.py プロジェクト: amonkeykong81/commcare-hq
def _enabled_hack(domain):
    return not is_psi_domain(domain)