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


Python base.Domain類代碼示例

本文整理匯總了Python中stoqlib.domain.base.Domain的典型用法代碼示例。如果您正苦於以下問題:Python Domain類的具體用法?Python Domain怎麽用?Python Domain使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: __init__

    def __init__(self, store=None,
                 category=None,
                 cost=None,
                 commission=None,
                 description=None,
                 price=None):
        """Creates a new sellable
        :param store: a store
        :param category: category of this sellable
        :param cost: the cost, defaults to 0
        :param commission: commission for this sellable
        :param description: readable description of the sellable
        :param price: the price, defaults to 0
        """

        Domain.__init__(self, store=store)

        if category:
            if commission is None:
                commission = category.get_commission()
            if price is None and cost is not None:
                markup = category.get_markup()
                price = self._get_price_by_markup(markup, cost=cost)

        self.category = category
        self.commission = commission or currency(0)
        self.cost = cost or currency(0)
        self.description = description
        self.price = price or currency(0)
開發者ID:amaurihamasu,項目名稱:stoq,代碼行數:29,代碼來源:sellable.py

示例2: __init__

 def __init__(self, store=None, **kw):
     Domain.__init__(self, store=store, **kw)
     # These miss default parameters and needs to be set before
     # cfop, which triggers an implicit flush.
     self.branch = kw.pop('branch', None)
     self.supplier = kw.pop('supplier', None)
     if not 'cfop' in kw:
         self.cfop = sysparam.get_object(store, 'DEFAULT_RECEIVING_CFOP')
開發者ID:Guillon88,項目名稱:stoq,代碼行數:8,代碼來源:receiving.py

示例3: __init__

    def __init__(self, store=None, **kw):
        if not 'sellable' in kw:
            raise TypeError('You must provide a sellable argument')
        if not 'order' in kw:
            raise TypeError('You must provide a order argument')

        # FIXME: Avoding shadowing sellable.cost
        kw['base_cost'] = kw['sellable'].cost

        if not 'cost' in kw:
            kw['cost'] = kw['sellable'].cost

        Domain.__init__(self, store=store, **kw)
開發者ID:Guillon88,項目名稱:stoq,代碼行數:13,代碼來源:purchase.py

示例4: __init__

 def __init__(self, store=None, sellable=None, **kw):
     if sellable is None:
         raise TypeError('You must provide a sellable argument')
     Domain.__init__(self, store=store, sellable=sellable, **kw)
開發者ID:dionimf,項目名稱:stoq,代碼行數:4,代碼來源:stockdecrease.py

示例5: _purchase_clone

 def _purchase_clone():
     self.purchase_clone = Domain.clone(self.purchase)
     return self.purchase_clone
開發者ID:romaia,項目名稱:stoq,代碼行數:3,代碼來源:test_purchasequotewizard.py

示例6: __init__

 def __init__(self, store=None, **kw):
     if not "kw" in kw:
         if not "sellable" in kw:
             raise TypeError("You must provide a sellable argument")
     Domain.__init__(self, store=store, **kw)
開發者ID:rg3915,項目名稱:stoq,代碼行數:5,代碼來源:stockdecrease.py

示例7: __init__

 def __init__(self, store=None, **kw):
     if not 'value' in kw:
         raise TypeError('You must provide a value argument')
     if not 'base_value' in kw or not kw['base_value']:
         kw['base_value'] = kw['value']
     Domain.__init__(self, store=store, **kw)
開發者ID:romaia,項目名稱:stoq,代碼行數:6,代碼來源:payment.py


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