• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python abstractwizard.SellableItemStep类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中stoqlib.gui.wizards.abstractwizard.SellableItemStep的典型用法代码示例。如果您正苦于以下问题:Python SellableItemStep类的具体用法?Python SellableItemStep怎么用?Python SellableItemStep使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SellableItemStep类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setup_slaves

 def setup_slaves(self):
     SellableItemStep.setup_slaves(self)
     self.hide_add_button()
     self.cost.set_editable(True)
     self.quantity.connect('validate', self._on_quantity__validate)
     self.slave.klist.connect('selection-changed',
                              self._on_klist_selection_changed)
开发者ID:Guillon88,项目名称:stoq,代码行数:7,代码来源:purchasewizard.py


示例2: setup_slaves

    def setup_slaves(self):
        SellableItemStep.setup_slaves(self)
        self.hide_add_button()
        self.cost_label.set_label(_('Price:'))
        self.cost.set_editable(True)

        delivery = self._find_delivery()
        if delivery is not None:
            self._delivery_item = delivery.service_item
            self._delivery = CreateDeliveryModel(
                price=self._delivery_item.price, notes=self._delivery_item.notes,
                transporter=delivery.transporter, address=delivery.address,
                estimated_fix_date=self._delivery_item.estimated_fix_date)
        else:
            self._delivery = None
            self._delivery_item = None

        if isinstance(self.model, Sale):
            self.delivery_btn = self.slave.add_extra_button(label=_("Add delivery"))
            self.delivery_btn.set_sensitive(bool(len(self.slave.klist)))
        else:
            self.delivery_btn = None

        self.discount_btn = self.slave.add_extra_button(label=_("Apply discount"))
        self.discount_btn.set_sensitive(bool(len(self.slave.klist)))
        self.slave.klist.connect('has-rows', self._on_klist__has_rows)
        self.slave.klist.connect('selection-changed',
                                 self._on_klist__selection_changed)
开发者ID:,项目名称:,代码行数:28,代码来源:


示例3: update_total

    def update_total(self):
        SellableItemStep.update_total(self)
        quantities = {}
        missing = {}
        lead_time = 0
        for i in self.slave.klist:
            sellable = i.sellable
            if sellable.service or not sellable.product.manage_stock:
                continue

            quantities.setdefault(sellable, 0)
            quantities[sellable] += i.quantity
            if quantities[sellable] > i._stock_quantity:
                _lead_time = sellable.product.get_max_lead_time(
                    quantities[sellable], self.model.branch)
                max_lead_time = max(lead_time, _lead_time)
                missing[sellable] = Settable(
                    description=sellable.get_description(),
                    stock=i._stock_quantity,
                    ordered=quantities[sellable],
                    lead_time=_lead_time,
                )
        self.missing = missing

        if missing:
            msg = _('Not enough stock. '
                    'Estimated time to obtain missing items: %d days.') % max_lead_time
            self.slave.set_message(
                '<b>%s</b>' % (api.escape(msg)), self._show_missing_details)
        else:
            self.slave.clear_message()
开发者ID:,项目名称:,代码行数:31,代码来源:


示例4: sellable_selected

 def sellable_selected(self, sellable, batch=None):
     SellableItemStep.sellable_selected(self, sellable, batch=batch)
     if sellable:
         price = sellable.get_price_for_category(
             self.model.client_category)
         self.cost.set_text("%s" % price)
         self.proxy.update('cost')
开发者ID:,项目名称:,代码行数:7,代码来源:


示例5: setup_slaves

    def setup_slaves(self):
        SellableItemStep.setup_slaves(self)
        self.hide_add_button()

        if not self.wizard.create_payments:
            self.cost_label.hide()
            self.cost.hide()
        self.quantity.connect('validate', self._on_quantity__validate)
开发者ID:romaia,项目名称:stoq,代码行数:8,代码来源:stockdecreasewizard.py


示例6: sellable_selected

 def sellable_selected(self, sellable, batch=None):
     # We may receive a batch if the user typed a batch number instead of a
     # product code, but we pass batch=None here since the user must select
     # the batch when confirming a sale.
     SellableItemStep.sellable_selected(self, sellable, batch=None)
     if sellable:
         price = sellable.get_price_for_category(
             self.model.client_category)
         self.cost.update(price)
开发者ID:Joaldino,项目名称:stoq,代码行数:9,代码来源:salequotewizard.py


示例7: sellable_selected

    def sellable_selected(self, sellable):
        SellableItemStep.sellable_selected(self, sellable)

        if sellable is None:
            return

        storable = sellable.product_storable
        # FIXME: We should not have to override this method. This should
        # be done automatically on SellableItemStep
        self.stock_quantity.set_label(
            "%s" % storable.get_balance_for_branch(branch=self.model.branch))
开发者ID:leandrorchaves,项目名称:stoq,代码行数:11,代码来源:stocktransferwizard.py


示例8: setup_slaves

    def setup_slaves(self):
        SellableItemStep.setup_slaves(self)
        self._delivery = None
        self._delivery_item = None

        self.delivery_button = self.slave.add_extra_button(label=_("Add Delivery"))
        self.delivery_button.set_sensitive(bool(len(self.slave.klist)))

        self.slave.klist.connect('has_rows', self._on_klist__has_rows)
        self.delivery_button.connect('clicked',
                                     self._on_delivery_button__clicked)
开发者ID:hackedbellini,项目名称:stoq,代码行数:11,代码来源:stockdecreasewizard.py


示例9: sellable_selected

    def sellable_selected(self, sellable):
        SellableItemStep.sellable_selected(self, sellable)

        if sellable is None:
            return

        storable = sellable.product_storable
        stock_item = storable.get_stock_item(self.branch)
        self.stock_quantity.set_label("%s" % stock_item.quantity or 0)

        quantity = self._get_stock_balance(sellable)
        has_quantity = quantity > 0
        self.quantity.set_sensitive(has_quantity)
        self.add_sellable_button.set_sensitive(has_quantity)
        if has_quantity:
            self.quantity.set_range(1, quantity)
开发者ID:romaia,项目名称:stoq,代码行数:16,代码来源:stocktransferwizard.py


示例10: add_sellable

    def add_sellable(self, sellable):
        price = sellable.get_price_for_category(self.model.client_category)
        new_price = self.cost.read()

        # Percentage of discount
        discount = 100 - new_price * 100 / price

        if discount > 0 and self.manager:
            Event.log_sale_item_discount(
                store=self.store,
                sale_number=self.model.identifier,
                user_name=self.manager.username,
                discount_value=discount,
                product=sellable.description,
                original_price=price,
                new_price=new_price)

        SellableItemStep.add_sellable(self, sellable)
开发者ID:Joaldino,项目名称:stoq,代码行数:18,代码来源:salequotewizard.py


示例11: setup_slaves

 def setup_slaves(self):
     SellableItemStep.setup_slaves(self)
     self.hide_add_button()
     self.cost_label.hide()
     self.cost.hide()
开发者ID:marianaanselmo,项目名称:stoq,代码行数:5,代码来源:productionwizard.py


示例12: sellable_selected

 def sellable_selected(self, sellable, batch=None):
     SellableItemStep.sellable_selected(self, sellable, batch=batch)
     if sellable:
         self.cost.update(sellable.price)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:4,代码来源:salereturnwizard.py


示例13: validate

 def validate(self, value):
     SellableItemStep.validate(self, value)
     can_purchase = self.model.purchase_total > 0
     self.wizard.refresh_next(value and can_purchase)
开发者ID:Guillon88,项目名称:stoq,代码行数:4,代码来源:purchasewizard.py


示例14: setup_slaves

 def setup_slaves(self):
     SellableItemStep.setup_slaves(self)
     self.hide_add_button()
     self.cost_label.set_label('Price:')
     self.cost.set_editable(True)
开发者ID:rosalin,项目名称:stoq,代码行数:5,代码来源:salequotewizard.py


示例15: setup_slaves

    def setup_slaves(self):
        SellableItemStep.setup_slaves(self)
        self.hide_add_button()

        self.cost.set_editable(True)
        self.quantity.connect('validate', self._on_quantity__validate)
开发者ID:pkaislan,项目名称:stoq,代码行数:6,代码来源:purchasewizard.py


示例16: sellable_selected

 def sellable_selected(self, sellable):
     SellableItemStep.sellable_selected(self, sellable)
     if sellable:
         self.cost.update(sellable.price)
开发者ID:marianaanselmo,项目名称:stoq,代码行数:4,代码来源:salereturnwizard.py


示例17: validate

 def validate(self, value):
     SellableItemStep.validate(self, value)
     can_decrease = self.model.get_items().count()
     self.wizard.refresh_next(value and can_decrease)
开发者ID:romaia,项目名称:stoq,代码行数:4,代码来源:stockdecreasewizard.py


示例18: __init__

 def __init__(self, wizard, previous, store, model):
     manager = get_plugin_manager()
     nfe_is_active = manager.is_active('nfe')
     if nfe_is_active:
         self.cost_editable = True
     SellableItemStep.__init__(self, wizard, previous, store, model)
开发者ID:amaurihamasu,项目名称:stoq,代码行数:6,代码来源:stocktransferwizard.py


示例19: __init__

 def __init__(self, wizard, previous, store, model):
     self.branch = api.get_current_branch(store)
     SellableItemStep.__init__(self, wizard, previous, store, model)
开发者ID:marianaanselmo,项目名称:stoq,代码行数:3,代码来源:stocktransferwizard.py


示例20: setup_slaves

 def setup_slaves(self):
     SellableItemStep.setup_slaves(self)
开发者ID:leandrorchaves,项目名称:stoq,代码行数:2,代码来源:stocktransferwizard.py



注:本文中的stoqlib.gui.wizards.abstractwizard.SellableItemStep类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python personwizard.run_person_role_dialog函数代码示例发布时间:2022-05-27
下一篇:
Python printing.print_report函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap