diff --git a/CHANGES.rst b/CHANGES.rst index f73345ef35..5a9e10d007 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,7 @@ Changelog **Added** +- #1517 Integrate senaite.core.spotlight - #1516 Consider analyses with result options or string in duplicate valid range - #1515 Moved Setup View into Core - #1506 Specification non-compliant viewlet in Sample diff --git a/bika/lims/profiles/default/actions.xml b/bika/lims/profiles/default/actions.xml index 343fe75bf8..d97df2ef56 100644 --- a/bika/lims/profiles/default/actions.xml +++ b/bika/lims/profiles/default/actions.xml @@ -158,6 +158,20 @@ True + + + Search + + string:${globals_view/navigationRootUrl}/spotlight + + + + + + + True + + Audit Log diff --git a/bika/lims/upgrade/v01_03_003.py b/bika/lims/upgrade/v01_03_003.py index 8e62a7b119..89e491fc97 100644 --- a/bika/lims/upgrade/v01_03_003.py +++ b/bika/lims/upgrade/v01_03_003.py @@ -299,6 +299,10 @@ def upgrade(tool): # https://github.com/senaite/senaite.core/pull/1506 update_samples_result_ranges(portal) + # Try to install the spotlight add-on + # https://github.com/senaite/senaite.core/pull/1517 + install_senaite_core_spotlight(portal) + logger.info("{0} upgraded to version {1}".format(product, version)) return True @@ -610,7 +614,7 @@ def update_samples_result_ranges(portal): if num and num % 1000 == 0: logger.info("{}/{} samples processed ...".format(num, total)) transaction.commit() - logger.info("Changes commited") + logger.info("Changes committed") sample = api.get_object(brain) # Check if the ResultsRange field from sample contains values already @@ -651,3 +655,18 @@ def update_analyses_results_range(sample): if analysis_rr: analysis = api.get_object(analysis) analysis.setResultsRange(analysis_rr) + + +def install_senaite_core_spotlight(portal): + """Install the senaite.core.spotlight addon + """ + qi = api.get_tool("portal_quickinstaller") + profile = "senaite.core.spotlight" + if profile not in qi.listInstallableProfiles(): + logger.error("Profile '{}' not found. Forgot to run buildout?" + .format(profile)) + return + if qi.isProductInstalled(profile): + logger.info("'{}' is installed".format(profile)) + return + qi.installProduct(profile) diff --git a/buildout.cfg b/buildout.cfg index ee218ccf59..a164fc0609 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -8,12 +8,12 @@ # [buildout] -extends = http://dist.plone.org/release/4.3.18/versions.cfg +extends = http://dist.plone.org/release/4.3.19/versions.cfg index = https://pypi.python.org/simple/ find-links = - http://dist.plone.org/release/4.3.18 + http://dist.plone.org/release/4.3.19 http://dist.plone.org/thirdparty parts = @@ -43,6 +43,7 @@ develop = . [sources] senaite.core.listing = git git://github.com/senaite/senaite.core.listing.git pushurl=git@github.com:senaite/senaite.core.listing.git branch=master +senaite.core.spotlight = git git://github.com/senaite/senaite.core.spotlight.git pushurl=git@github.com:senaite/senaite.core.spotlight.git branch=master senaite.core.supermodel = git git://github.com/senaite/senaite.core.supermodel.git pushurl=git@github.com:senaite/senaite.core.supermodel.git branch=master [instance] diff --git a/setup.py b/setup.py index e1a8b819d0..9a4adf0b89 100644 --- a/setup.py +++ b/setup.py @@ -76,6 +76,7 @@ 'zopyx.txng3.ext==3.4.0', "senaite.core.supermodel>=1.2.0", "senaite.core.listing>=1.1.0", + "senaite.core.spotlight", # Python 2.x is not supported by WeasyPrint v43 'WeasyPrint==0.42.3', # tinycss2 >= 1.0.0 does not support Python 2.x anymore