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)
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) if not 'cfop' in kw: self.cfop = sysparam.get_object(store, 'DEFAULT_RECEIVING_CFOP')
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')
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.purchase = kw.pop("purchase", None) self.supplier = kw.pop("supplier", None) if not "cfop" in kw: self.cfop = sysparam.get_object(store, "DEFAULT_RECEIVING_CFOP")
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.purchase = kw.pop('purchase', None) self.supplier = kw.pop('supplier', None) if not 'cfop' in kw: self.cfop = sysparam(store).DEFAULT_RECEIVING_CFOP
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)
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)
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)
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)
def _purchase_clone(): self.purchase_clone = Domain.clone(self.purchase) return self.purchase_clone
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)
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)