diff --git a/tailbone/views/batch/vendorinvoice.py b/tailbone/views/batch/vendorinvoice.py index 9cfd5dc9..6b8bdef7 100644 --- a/tailbone/views/batch/vendorinvoice.py +++ b/tailbone/views/batch/vendorinvoice.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -28,7 +28,7 @@ from __future__ import unicode_literals, absolute_import import six -from rattail.db import model, api +from rattail.db import model from rattail.vendors.invoices import iter_invoice_parsers, require_invoice_parser # import formalchemy @@ -172,8 +172,10 @@ class VendorInvoiceView(FileBatchMasterView): return kwargs def init_batch(self, batch): + app = self.get_rattail_app() + vendor_handler = app.get_vendor_handler() parser = require_invoice_parser(self.rattail_config, batch.parser_key) - vendor = api.get_vendor(self.Session(), parser.vendor_key) + vendor = vendor_handler.get_vendor(self.Session(), parser.vendor_key) if not vendor: self.request.session.flash("No vendor setting found in database for key: {}".format(parser.vendor_key)) return False diff --git a/tailbone/views/purchasing/batch.py b/tailbone/views/purchasing/batch.py index bca52b24..ee460192 100644 --- a/tailbone/views/purchasing/batch.py +++ b/tailbone/views/purchasing/batch.py @@ -476,11 +476,6 @@ class PurchasingBatchView(BatchMasterView): return [(v.uuid, "({}) {}".format(v.id, v.name)) for v in vendors] - def get_vendor_values(self): - vendors = self.get_vendors() - return [(v.uuid, "({}) {}".format(v.id, v.name)) - for v in vendors] - def get_buyers(self): return self.Session.query(model.Employee)\ .join(model.Person)\