예제 #1
0
파일: repair.py 프로젝트: luetgendorf/Servo
 def create_purchase_order(self):
     # Create local purchase order
     po = PurchaseOrder(supplier="Apple", created_by=self.created_by)
     po.location = self.created_by.get_location()
     po.reference = self.reference
     po.sales_order = self.order
     po.save()
     return po
예제 #2
0
파일: repair.py 프로젝트: fpsw/Servo
 def create_purchase_order(self):
     # Create local purchase order
     po = PurchaseOrder(supplier="Apple", created_by=self.created_by)
     po.location = self.created_by.get_location()
     po.reference = self.reference
     po.sales_order = self.order
     po.save()
     return po
예제 #3
0
파일: parts.py 프로젝트: luetgendorf/Servo
    def order(self, user, po=None):
        """
        Purchase this Service Part
        """
        if po is None:
            po = PurchaseOrder()
            po.location = user.get_location()
            po.sales_order = self.repair.order
            po.reference = self.repair.reference
            po.confirmation = self.repair.confirmation
            po.created_by = user
            po.supplier = "Apple"
            po.save()

        self.purchase_order = po
        poi = PurchaseOrderItem(purchase_order=po)
        poi.code = self.part_number
        poi.title = self.part_title
        poi.order_item = self.order_item
        poi.product = self.order_item.product
        poi.price = self.order_item.get_purchase_price()

        poi.save()

        if po.submitted_at is None:
            po.submit(user)

        self.save()