diff --git a/CHANGELOG.md b/CHANGELOG.md index 225501c..2632cd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,18 +5,6 @@ All notable changes to tailbone-corepos will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## v0.3.2 (2024-11-18) - -### Fix - -- add startup workaround for CORE model imports, to avoid error - -## v0.3.1 (2024-08-18) - -### Fix - -- refactory grid usage per wuttaweb - ## v0.3.0 (2024-08-06) ### Feat diff --git a/README.md b/README.md deleted file mode 100644 index 2af4798..0000000 --- a/README.md +++ /dev/null @@ -1,12 +0,0 @@ - -# tailbone-corepos - -Rattail is a retail software framework, released under the GNU General -Public License. - -This package contains software interfaces for the [CORE -POS](https://www.core-pos.com/) system, which is open source and -freely available. - -Please see Rattail's [home page](https://rattailproject.org/) for more -information. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..3a6860d --- /dev/null +++ b/README.rst @@ -0,0 +1,15 @@ + +tailbone-corepos +================ + +Rattail is a retail software framework, released under the GNU General Public +License. + +This package contains software interfaces for the `CORE POS`_ system, which is +open source and freely available. + +.. _`CORE POS`: https://www.core-pos.com/ + +Please see Rattail's `home page`_ for more information. + +.. _`home page`: https://rattailproject.org/ diff --git a/pyproject.toml b/pyproject.toml index 8ef8cf8..64f726a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,9 +6,9 @@ build-backend = "hatchling.build" [project] name = "tailbone-corepos" -version = "0.3.2" +version = "0.3.0" description = "Tailbone interfaces for CORE POS" -readme = "README.md" +readme = "README.rst" authors = [{name = "Lance Edgar", email = "lance@edbob.org"}] license = {text = "GNU GPL v3+"} classifiers = [ @@ -33,10 +33,10 @@ dependencies = [ [project.urls] -Homepage = "https://rattailproject.org" -Repository = "https://forgejo.wuttaproject.org/rattail/tailbone-corepos" -Issues = "https://forgejo.wuttaproject.org/rattail/tailbone-corepos/issues" -Changelog = "https://forgejo.wuttaproject.org/rattail/tailbone-corepos/src/branch/master/CHANGELOG.md" +Homepage = "https://redmine.rattailproject.org/projects/corepos-integration" +Repository = "https://kallithea.rattailproject.org/rattail-project/tailbone-corepos" +Issues = "https://redmine.rattailproject.org/projects/corepos-integration/issues" +Changelog = "https://kallithea.rattailproject.org/rattail-project/tailbone-corepos/files/master/CHANGELOG.md" [project.entry-points."tailbone.providers"] diff --git a/tailbone_corepos/provider.py b/tailbone_corepos/provider.py index 043b30e..c128a18 100644 --- a/tailbone_corepos/provider.py +++ b/tailbone_corepos/provider.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2024 Lance Edgar +# Copyright © 2010-2023 Lance Edgar # # This file is part of Rattail. # @@ -24,7 +24,6 @@ Tailbone Provider for CORE-POS Integration """ -import sqlalchemy as sa from sqlalchemy.orm import sessionmaker, scoped_session from zope.sqlalchemy import register @@ -72,37 +71,6 @@ class TailboneCorePosProvider(TailboneProvider): register(Session) ExtraCoreTransArchiveSessions[key] = Session - # must import all sqlalchemy models before things get rolling, - # otherwise can have errors about continuum TransactionMeta class - # not yet mapped, when relevant pages are first requested... - # cf. https://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/database/sqlalchemy.html#importing-all-sqlalchemy-models - # hat tip to https://stackoverflow.com/a/59241485 - if rattail_config.core_office_op_engine: - app = rattail_config.get_app() - corepos = app.get_corepos_handler() - - # nb. use fake db to avoid true cxn errors, since the only - # point of this is to load the models - engine = sa.create_engine('sqlite://') - - # office_op - core_model = corepos.get_model_office_op() - core_session = corepos.make_session_office_op(bind=engine) - try: - core_session.query(core_model.Store).first() - except sa.exc.OperationalError: - pass - core_session.close() - - # office_trans - core_model = corepos.get_model_office_trans() - core_session = corepos.make_session_office_trans(bind=engine) - try: - core_session.query(core_model.TransactionDetail).first() - except sa.exc.OperationalError: - pass - core_session.close() - def get_provided_views(self): return { diff --git a/tailbone_corepos/views/corepos/groups.py b/tailbone_corepos/views/corepos/groups.py index 84e87c8..3648dbb 100644 --- a/tailbone_corepos/views/corepos/groups.py +++ b/tailbone_corepos/views/corepos/groups.py @@ -125,8 +125,7 @@ class UserGroupView(CoreOfficeMasterView): permission_prefix = self.get_permission_prefix() factory = self.get_grid_factory() g = factory( - self.request, - key=f'{route_prefix}.users', + key='{}.users'.format(route_prefix), data=[], columns=[ 'username', diff --git a/tailbone_corepos/views/corepos/products.py b/tailbone_corepos/views/corepos/products.py index 823da2d..70697e2 100644 --- a/tailbone_corepos/views/corepos/products.py +++ b/tailbone_corepos/views/corepos/products.py @@ -248,8 +248,7 @@ class ProductView(CoreOfficeMasterView): factory = self.get_grid_factory() g = factory( - self.request, - key=f'{route_prefix}.vendor_items', + key='{}.vendor_items'.format(route_prefix), data=[], columns=[ 'vendor_name',