Esempio n. 1
0
    def __init__(self, *args, **kwargs):
        super(OrderItemForm, self).__init__(*args, **kwargs)

        if self.instance:
            product = self.instance.product
            if product.can_order_from_gsx():
                CODES = symptom_codes(product.component_code)
                self.fields['comptia_code'] = forms.ChoiceField(choices=CODES)
                self.fields['comptia_modifier'] = forms.ChoiceField(
                    choices=gsxws.MODIFIERS,
                    initial="B"
                )
Esempio n. 2
0
    def __init__(self, *args, **kwargs):
        super(OrderItemForm, self).__init__(*args, **kwargs)

        if self.instance:
            product = self.instance.product
            if product.can_order_from_gsx():
                CODES = symptom_codes(product.component_code)
                self.fields['comptia_code'] = forms.ChoiceField(
                    choices=CODES, label=_('Symptom code'))
                self.fields['comptia_modifier'] = forms.ChoiceField(
                    choices=gsxws.MODIFIERS,
                    initial="B",
                    label=_('Symptom modifier'))
Esempio n. 3
0
 def comptia_choices(self):
     if self.product is not None:
         from servo.models.parts import symptom_codes
         return symptom_codes(self.product.component_code)
Esempio n. 4
0
 def comptia_choices(self):
     if self.product is not None:
         from servo.models.parts import symptom_codes
         return symptom_codes(self.product.component_code)