當前位置: 首頁>>代碼示例>>Python>>正文


Python Sale.client方法代碼示例

本文整理匯總了Python中stoqlib.domain.sale.Sale.client方法的典型用法代碼示例。如果您正苦於以下問題:Python Sale.client方法的具體用法?Python Sale.client怎麽用?Python Sale.client使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在stoqlib.domain.sale.Sale的用法示例。


在下文中一共展示了Sale.client方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _create_sale

# 需要導入模塊: from stoqlib.domain.sale import Sale [as 別名]
# 或者: from stoqlib.domain.sale.Sale import client [as 別名]
    def _create_sale(self, store):
        user = api.get_current_user(store)
        branch = api.get_current_branch(store)
        salesperson = user.person.salesperson
        cfop_id = api.sysparam.get_object_id('DEFAULT_SALES_CFOP')
        nature = api.sysparam.get_string('DEFAULT_OPERATION_NATURE')
        group = PaymentGroup(store=store)
        sale = Sale(
            store=store,
            branch=branch,
            salesperson=salesperson,
            group=group,
            cfop_id=cfop_id,
            coupon_id=None,
            operation_nature=nature)

        if self._delivery:
            sale.client = store.fetch(self._delivery.client)
            sale.storeporter = store.fetch(self._delivery.transporter)
            delivery = Delivery(
                store=store,
                address=store.fetch(self._delivery.address),
                transporter=store.fetch(self._delivery.transporter),
            )
        else:
            delivery = None
            sale.client = self._suggested_client

        for fake_sale_item in self.sale_items:
            sale_item = sale.add_sellable(
                store.fetch(fake_sale_item.sellable),
                price=fake_sale_item.price,
                quantity=fake_sale_item.quantity,
                quantity_decreased=fake_sale_item.quantity_decreased,
                batch=store.fetch(fake_sale_item.batch))
            sale_item.notes = fake_sale_item.notes
            sale_item.estimated_fix_date = fake_sale_item.estimated_fix_date

            if delivery and fake_sale_item.deliver:
                delivery.add_item(sale_item)
            elif delivery and fake_sale_item == self._delivery_item:
                delivery.service_item = sale_item

        return sale
開發者ID:pkaislan,項目名稱:stoq,代碼行數:46,代碼來源:pos.py


注:本文中的stoqlib.domain.sale.Sale.client方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。