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

Python person.Branch类代码示例

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

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



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

示例1: test_getactive_branches

 def test_getactive_branches(self):
     person = self.create_person()
     Company(person=person, store=self.store)
     count = Branch.get_active_branches(self.store).count()
     manager = self.create_employee()
     branch = Branch(person=person, store=self.store,
                     manager=manager, is_active=True)
     assert branch.get_active_branches(self.store).count() == count + 1
开发者ID:rosalin,项目名称:stoq,代码行数:8,代码来源:test_person.py


示例2: create_filters

 def create_filters(self):
     self.search.set_query(self._query)
     self.set_text_field_columns(["description", "code", "barcode", "category_description", "manufacturer"])
     branches = Branch.get_active_branches(self.store)
     self.branch_filter = ComboSearchFilter(_("Show by:"), api.for_combo(branches, empty=_("All branches")))
     self.branch_filter.select(api.get_current_branch(self.store))
     self.add_filter(self.branch_filter, position=SearchFilterPosition.TOP)
开发者ID:coletivoEITA,项目名称:stoq,代码行数:7,代码来源:stock.py


示例3: test_cancel_order_nfce_plugin_active

    def test_cancel_order_nfce_plugin_active(self, get_plugin_manager,
                                             run_dialog):
        dest_branch = Branch.get_active_remote_branches(self.store)[0]
        source_branch = api.get_current_branch(self.store)

        order = self.create_transfer_order(source_branch=source_branch,
                                           dest_branch=dest_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 28474
        order.open_date = localdatetime(2012, 2, 2)
        order.send()

        dialog = TransferOrderDetailsDialog(self.store, order)
        self.assertSensitive(dialog, ['cancel_button'])
        get_plugin_manager.is_active.return_value = True
        run_dialog.return_value = Note()
        with mock.patch.object(self.store, 'commit'):
            self.click(dialog.cancel_button)
            msg_text = u"This will cancel the transfer. Are you sure?"
            run_dialog.assert_called_once_with(
                NoteEditor, dialog, order.store, model=None,
                message_text=msg_text, label_text=u"Reason", mandatory=True,
                ok_button_label=u"Cancel transfer",
                cancel_button_label=u"Don't cancel",
                min_length=15)
        self.assertEqual(order.status, TransferOrder.STATUS_CANCELLED)
        self.assertEqual(order.receival_date, None)
开发者ID:hackedbellini,项目名称:stoq,代码行数:27,代码来源:test_transferorder_dialog.py


示例4: _setup_widgets

    def _setup_widgets(self):
        branches = Branch.get_active_remote_branches(self.store)
        self.destination_branch.prefill(api.for_person_combo(branches))
        self.source_branch.set_text(self.branch.get_description())

        employees = self.store.find(Employee)
        self.source_responsible.prefill(api.for_person_combo(employees))
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:7,代码来源:stocktransferwizard.py


示例5: _setup_widgets

    def _setup_widgets(self):
        quote_group = str(self.wizard.quote_group.identifier)
        self.quote_group.set_text(quote_group)

        branches = Branch.get_active_branches(self.store)
        self.branch_combo.prefill(api.for_person_combo(branches))
        self.notes.set_accepts_tab(False)
开发者ID:leandrorchaves,项目名称:stoq,代码行数:7,代码来源:purchasequotewizard.py


示例6: test_receive_order

    def test_receive_order(self, print_report, yesno):
        yesno.retval = True

        source_branch = Branch.get_active_remote_branches(self.store)[0]
        dest_branch = api.get_current_branch(self.store)

        # Created and sent the order.
        order = self.create_transfer_order(source_branch=source_branch,
                                           dest_branch=dest_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 28474
        order.open_date = localdatetime(2012, 2, 2)
        order.send()

        dialog = TransferOrderDetailsDialog(self.store, order)
        self.click(dialog.print_button)
        print_report.assert_called_once_with(dialog.report_class, dialog.model)
        self.assertSensitive(dialog, ['receive_button'])
        with mock.patch.object(self.store, 'commit'):
            self.click(dialog.receive_button)

        yesno.assert_called_once_with(u'Receive the order?', Gtk.ResponseType.YES,
                                      u'Receive', u"Don't receive")

        self.assertEqual(order.status, order.STATUS_RECEIVED)
        self.assertEqual(order.cancel_date, None)
开发者ID:hackedbellini,项目名称:stoq,代码行数:26,代码来源:test_transferorder_dialog.py


示例7: populate

    def populate(self, person):
        from stoqlib.domain.person import (Client, Supplier, Transporter,
                                           SalesPerson, Branch)
        store = get_store_for_field(self)
        person_type = self.person_type
        if person_type == Supplier:
            objects = Supplier.get_active_suppliers(store)
            self.add_button.set_tooltip_text(_("Add a new supplier"))
            self.edit_button.set_tooltip_text(_("Edit the selected supplier"))
        elif person_type == Client:
            objects = Client.get_active_clients(store)
            self.add_button.set_tooltip_text(_("Add a new client"))
            self.edit_button.set_tooltip_text(_("Edit the selected client"))
        elif person_type == Transporter:
            objects = Transporter.get_active_transporters(store)
            self.add_button.set_tooltip_text(_("Add a new transporter"))
            self.edit_button.set_tooltip_text(_("Edit the selected transporter"))
        elif person_type == SalesPerson:
            objects = SalesPerson.get_active_salespersons(store)
            self.add_button.set_tooltip_text(_("Add a new sales person"))
            self.edit_button.set_tooltip_text(_("Edit the selected sales person"))
        elif person_type == Branch:
            objects = Branch.get_active_branches(store)
            self.add_button.set_tooltip_text(_("Add a new branch"))
            self.edit_button.set_tooltip_text(_("Edit the selected branch"))
        else:
            raise AssertionError(self.person_type)

        self.widget.prefill(api.for_person_combo(objects))

        if person:
            assert isinstance(person, person_type)
            self.widget.select(person)
开发者ID:romaia,项目名称:stoq,代码行数:33,代码来源:fields.py


示例8: _create_domain

    def _create_domain(self):
        self.clean_domain([TransferOrderItem, TransferOrder])

        source_branch = Branch.get_active_remote_branches(self.store)[0]
        dest_branch = api.get_current_branch(self.store)

        # Created order, did not send it yet.
        order = self.create_transfer_order(source_branch=source_branch,
                                           dest_branch=dest_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 75168
        order.open_date = localdatetime(2012, 1, 1)

        # Created and sent the order.
        order = self.create_transfer_order(source_branch=source_branch,
                                           dest_branch=dest_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 56832
        order.open_date = localdatetime(2012, 2, 2)
        order.send()

        # Order arrived at the destination.
        order = self.create_transfer_order(source_branch=source_branch,
                                           dest_branch=dest_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 20486
        order.open_date = localdatetime(2012, 3, 3)
        order.send()
        order.receive(self.create_employee())
        order.receival_date = localdatetime(2012, 3, 4)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:30,代码来源:test_transfersearch.py


示例9: _create_model

 def _create_model(self, store):
     user = api.get_current_user(store)
     source_responsible = store.find(Employee, person=user.person).one()
     return TransferOrder(
         source_branch=api.get_current_branch(store),
         source_responsible=source_responsible,
         destination_branch=Branch.get_active_remote_branches(store)[0],
         store=store)
开发者ID:amaurihamasu,项目名称:stoq,代码行数:8,代码来源:stocktransferwizard.py


示例10: create_filters

 def create_filters(self):
     self.search.set_query(self._query)
     self.set_text_field_columns(['description'])
     branches = Branch.get_active_branches(self.store)
     self.branch_filter = ComboSearchFilter(
         _('Show by:'), api.for_combo(branches, empty=_("All branches")))
     self.branch_filter.select(api.get_current_branch(self.store))
     self.add_filter(self.branch_filter, position=SearchFilterPosition.TOP)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:8,代码来源:stock.py


示例11: _get_branch_values

 def _get_branch_values(self):
     if api.sysparam.get_bool('SYNCHRONIZED_MODE'):
         current = api.get_current_branch(self.store)
         items = [(current.get_description(), current.id)]
     else:
         items = [(b.get_description(), b.id) for b
                  in Branch.get_active_branches(self.store)]
         items.insert(0, (_('Any'), None))
     return items
开发者ID:pkaislan,项目名称:stoq,代码行数:9,代码来源:salesearch.py


示例12: setup_proxies

    def setup_proxies(self):
        if api.sysparam.get_bool('SYNCHRONIZED_MODE'):
            current = api.get_current_branch(self.store)
            branches = [(current.get_description(), current)]
        else:
            branches = api.for_combo(Branch.get_active_branches(self.store))

        self.branch.prefill(branches)
        self.add_proxy(self.model, self.proxy_widgets)
开发者ID:Guillon88,项目名称:stoq,代码行数:9,代码来源:initialstockdialog.py


示例13: _setup_widgets

    def _setup_widgets(self):
        quote_group = str(self.wizard.quote_group.identifier)
        self.quote_group.set_text(quote_group)

        branches = Branch.get_active_branches(self.store)
        self.branch_combo.prefill(api.for_person_combo(branches))
        sync_mode = api.sysparam.get_bool('SYNCHRONIZED_MODE')
        self.branch_combo.set_sensitive(not sync_mode)

        self.notes.set_accepts_tab(False)
开发者ID:pkaislan,项目名称:stoq,代码行数:10,代码来源:purchasequotewizard.py


示例14: _prefill_branches

    def _prefill_branches(self):
        branches = Branch.get_active_remote_branches(self.store)
        current_branch = api.get_current_branch(self.store)

        # Branches not allowed to execute foreign work orders can only send
        # orders for those who can
        if not current_branch.can_execute_foreign_work_orders:
            branches = branches.find(can_execute_foreign_work_orders=True)

        self.destination_branch.prefill(api.for_person_combo(branches))
开发者ID:Guillon88,项目名称:stoq,代码行数:10,代码来源:workordereditor.py


示例15: _create_domain

    def _create_domain(self):
        self.clean_domain([TransferOrderItem, TransferOrder])
        responsible = self.create_employee()

        other_branch = Branch.get_active_remote_branches(self.store)[0]
        current_branch = api.get_current_branch(self.store)

        # One transfer that we did not receive yet
        order = self.create_transfer_order(source_branch=other_branch,
                                           dest_branch=current_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 75168
        order.open_date = localdatetime(2012, 1, 1)
        order.send()

        # One that we have already received
        order = self.create_transfer_order(source_branch=other_branch,
                                           dest_branch=current_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 56832
        order.open_date = localdatetime(2012, 2, 2)
        order.send()
        order.receive(responsible)
        order.receival_date = localdatetime(2012, 2, 2)

        # One that we have sent but is not received yet
        order = self.create_transfer_order(source_branch=current_branch,
                                           dest_branch=other_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 20486
        order.open_date = localdatetime(2012, 3, 3)
        order.send()

        # One that we have sent and is recived
        order = self.create_transfer_order(source_branch=current_branch,
                                           dest_branch=other_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 20489
        order.open_date = localdatetime(2012, 3, 4)
        order.send()

        order.receive(responsible)
        order.receival_date = localdatetime(2012, 3, 5)

        # And another one that is cancelled
        order = self.create_transfer_order(source_branch=current_branch,
                                           dest_branch=other_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 20491
        order.open_date = localdatetime(2012, 4, 5)
        order.send()

        order.cancel(responsible, 'Cancelled due something',
                     cancel_date=localdatetime(2012, 4, 6))
开发者ID:hackedbellini,项目名称:stoq,代码行数:54,代码来源:test_transfersearch.py


示例16: _create_domain

    def _create_domain(self):
        self.clean_domain([TransferOrderItem, TransferOrder])

        other_branch = Branch.get_active_remote_branches(self.store)[0]
        current_branch = api.get_current_branch(self.store)

        # One transfer that we did not receive yet
        order = self.create_transfer_order(source_branch=other_branch, dest_branch=current_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 75168
        order.open_date = localdatetime(2012, 1, 1)
        order.send()
开发者ID:stoq,项目名称:stoq,代码行数:12,代码来源:test_transfersearch.py


示例17: test_cancel_order_on_dest_branch

    def test_cancel_order_on_dest_branch(self):
        source_branch = Branch.get_active_remote_branches(self.store)[0]
        dest_branch = api.get_current_branch(self.store)

        order = self.create_transfer_order(source_branch=source_branch,
                                           dest_branch=dest_branch)
        self.create_transfer_order_item(order=order)
        order.identifier = 28474
        order.open_date = localdatetime(2012, 2, 2)
        order.send()

        dialog = TransferOrderDetailsDialog(self.store, order)
        # Destination branch should not cancel the transfer
        self.assertFalse(dialog.cancel_button.get_visible())
开发者ID:hackedbellini,项目名称:stoq,代码行数:14,代码来源:test_transferorder_dialog.py


示例18: _setup_widgets

    def _setup_widgets(self):
        branches = Branch.get_active_remote_branches(self.store)
        self.destination_branch.prefill(api.for_person_combo(branches))
        self.source_branch.set_text(self.branch.get_description())

        employees = self.store.find(Employee)
        self.source_responsible.prefill(api.for_person_combo(employees))

        self.invoice_number.set_property('mandatory', self._nfe_is_active)

        # Set an initial invoice number to TransferOrder and Invoice
        if not self.model.invoice_number:
            new_invoice_number = Invoice.get_next_invoice_number(self.store)
            self.model.invoice_number = new_invoice_number
开发者ID:amaurihamasu,项目名称:stoq,代码行数:14,代码来源:stocktransferwizard.py


示例19: create_branch_filter

    def create_branch_filter(self, label=None):
        from stoqlib.domain.person import Branch

        branches = Branch.get_active_branches(self.store)
        items = [(b.get_description(), b.id) for b in branches]
        items.insert(0, (_("Any"), None))

        if not label:
            label = _("Branch:")
        branch_filter = ComboSearchFilter(label, items)
        current = api.get_current_branch(self.store)
        if current:
            branch_filter.select(current.id)

        return branch_filter
开发者ID:rg3915,项目名称:stoq,代码行数:15,代码来源:searchdialog.py


示例20: create_branch_filter

    def create_branch_filter(self, label=None):
        from stoqlib.domain.person import Branch
        branches = Branch.get_active_branches(self.store)
        items = [(b.person.name, b.id) for b in branches]
        # if not items:
        #    raise ValueError('You should have at least one branch at '
        #                      'this point')
        items.insert(0, (_("Any"), None))

        if not label:
            label = _('Branch:')
        branch_filter = ComboSearchFilter(label, items)
        current = api.get_current_branch(self.store)
        if current:
            branch_filter.select(current.id)

        return branch_filter
开发者ID:leandrorchaves,项目名称:stoq,代码行数:17,代码来源:searchdialog.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python person.Client类代码示例发布时间:2022-05-27
下一篇:
Python payment.Payment类代码示例发布时间: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