当前位置: 首页>>代码示例>>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;未经允许,请勿转载。