예제 #1
0
파일: repair.py 프로젝트: fpsw/Servo
    def add_gsx_part(self, part):
        """
        Adds a part that has been added manually in GSX web UI
        """
        # part has been added to the order, but not the GSX repair
        try:
            oi = self.order.products.get(code=part.partNumber)
        except ServiceOrderItem.DoesNotExist:
            new_part = ServicePart(part_number=part.partNumber)
            try:
                p = Product.objects.get(code=part.partNumber)
            except Product.DoesNotExist:
                p = Product.from_gsx(new_part.lookup())
                p.save()

            oi = self.order.add_product(p, 1, self.created_by)

        oi.comptia_code = part.comptiaCode or ""
        oi.comptia_modifier = part.comptiaModifier or ""
        oi.save()

        sp = ServicePart.from_soi(self, oi)
        sp.set_part_details(part)

        sp.order(self.created_by)
        sp.save()
예제 #2
0
파일: repair.py 프로젝트: luetgendorf/Servo
    def add_gsx_part(self, part):
        """
        Adds a part that has been added manually in GSX web UI
        """
        # part has been added to the order, but not the GSX repair
        try:
            oi = self.order.products.get(code=part.partNumber)
        except ServiceOrderItem.DoesNotExist:
            new_part = ServicePart(part_number=part.partNumber)
            try:
                p = Product.objects.get(code=part.partNumber)
            except Product.DoesNotExist:
                p = Product.from_gsx(new_part.lookup())
                p.save()

            oi = self.order.add_product(p, 1, self.created_by)

        oi.comptia_code = part.comptiaCode or ''
        oi.comptia_modifier = part.comptiaModifier or ''
        oi.save()

        sp = ServicePart.from_soi(self, oi)
        sp.set_part_details(part)

        sp.order(self.created_by)
        sp.save()
예제 #3
0
파일: repair.py 프로젝트: luetgendorf/Servo
 def set_parts(self, parts):
     """
     Resets this Repair's part listing
     """
     ServicePart.objects.filter(repair=self).delete()
     for p in parts:
         part = ServicePart.from_soi(self, p)
         part.save()
예제 #4
0
파일: repair.py 프로젝트: fpsw/Servo
 def set_parts(self, parts):
     """
     Resets this Repair's part listing
     """
     ServicePart.objects.filter(repair=self).delete()
     for p in parts:
         part = ServicePart.from_soi(self, p)
         part.save()
예제 #5
0
파일: repair.py 프로젝트: luetgendorf/Servo
    def add_part(self, order_item, user):
        """
        Adds this Order Item as a part to this GSX repair
        """
        self.connect_gsx(user)
        gsx_rep = self.get_gsx_repair()

        part = ServicePart.from_soi(self, order_item)
        order_line = part.get_repair_order_line()

        gsx_rep.update({'orderLines': [order_line]})
        part.order(user)

        return part
예제 #6
0
파일: repair.py 프로젝트: fpsw/Servo
    def add_part(self, order_item, user):
        """
        Adds this Order Item as a part to this GSX repair
        """
        self.connect_gsx(user)
        gsx_rep = self.get_gsx_repair()

        part = ServicePart.from_soi(self, order_item)
        order_line = part.get_repair_order_line()

        gsx_rep.update({"orderLines": [order_line]})
        part.order(user)

        return part
예제 #7
0
파일: repair.py 프로젝트: filipp/Servo
 def set_parts(self, parts):
     ServicePart.objects.filter(repair=self).delete()
     for p in parts:
         part = ServicePart.from_soi(self, p)
         part.save()