Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Bika LIMS 3.2 #188

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions bika/health/content/bikasetup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from Products.Archetypes.Widget import BooleanWidget
from archetypes.schemaextender.interfaces import ISchemaExtender,\
IOrderableSchemaExtender
from bika.lims.config import PUBLICATION_PREFS
from bika.lims.fields import *
from bika.health import bikaMessageFactory as _
from bika.lims.interfaces import IBikaSetup
Expand Down Expand Up @@ -69,7 +68,7 @@ class BikaSetupSchemaExtender(object):
"Patient's 'Publication preferences' tab."))
),
ExtLinesField('PatientPublicationPreferences',
vocabulary= PUBLICATION_PREFS,
vocabulary='bika.lims.vocabularies.CustomPubPrefVocabularyFactory',
schemata = 'Results Reports',
widget = MultiSelectionWidget(
label = _("Default publication preference for Patients"),
Expand Down
3 changes: 1 addition & 2 deletions bika/health/content/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from bika.health.widgets import *
from plone.indexer.decorator import indexer
from bika.health import bikaMessageFactory as _
from bika.lims.config import PUBLICATION_PREFS
from zope.component import adapts
from archetypes.schemaextender.interfaces import IOrderableSchemaExtender

Expand Down Expand Up @@ -41,7 +40,7 @@ class ClientSchemaExtender(object):
"preferences' tab."))
),
ExtLinesField('PatientPublicationPreferences',
vocabulary=PUBLICATION_PREFS,
vocabulary='bika.lims.vocabularies.CustomPubPrefVocabularyFactory',
schemata='Results Reports',
widget=MultiSelectionWidget(
label=_("Default publication preference for Patients"),
Expand Down
2 changes: 1 addition & 1 deletion bika/health/content/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
"to the Patient automatically."))
),
LinesField('PublicationPreferences',
vocabulary=PUBLICATION_PREFS,
vocabulary='bika.lims.vocabularies.CustomPubPrefVocabularyFactory',
schemata='Publication preference',
widget=MultiSelectionWidget(
label=_("Publication preference"),
Expand Down
9 changes: 9 additions & 0 deletions bika/health/upgrade/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@
handler="bika.health.upgrade.to318.upgrade"
sortkey="1"
profile="bika.health:default"/>

<genericsetup:upgradeStep
title="Bika Health 3.2.0"
description="Update to Bika Health 3.2 compatible with Bika LIMS 3.2"
source="318"
destination="320"
handler="bika.health.upgrade.to320.upgrade"
sortkey="1"
profile="bika.health:default"/>
</configure>
42 changes: 42 additions & 0 deletions bika/health/upgrade/to320.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This file is part of Bika Health LIS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.

from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName
from bika.health import logger
from Products.CMFCore import permissions


def upgrade(tool):
"""Upgrade step required for Bika Health 3.2.0
"""
portal = aq_parent(aq_inner(tool))

qi = portal.portal_quickinstaller
ufrom = qi.upgradeInfo('bika.health')['installedVersion']
logger.info("Upgrading Bika Health: %s -> %s" % (ufrom, '3.1.8'))

"""Updated profile steps
list of the generic setup import step names: portal.portal_setup.getSortedImportSteps() <---
if you want more metadata use this: portal.portal_setup.getImportStepMetadata('jsregistry') <---
important info about upgrade steps in
http://stackoverflow.com/questions/7821498/is-there-a-good-reference-list-for-the-names-of-the-genericsetup-import-steps
"""
setup = portal.portal_setup
# setup.runImportStepFromProfile('profile-bika.health:default', 'typeinfo')
# setup.runImportStepFromProfile('profile-bika.health:default', 'jsregistry')
# setup.runImportStepFromProfile('profile-bika.health:default', 'cssregistry')
# setup.runImportStepFromProfile('profile-bika.health:default', 'workflow-csv')
# setup.runImportStepFromProfile('profile-bika.health:default', 'factorytool')
# setup.runImportStepFromProfile('profile-bika.health:default', 'controlpanel')
# setup.runImportStepFromProfile('profile-bika.health:default', 'catalog')
# setup.runImportStepFromProfile('profile-bika.health:default', 'propertiestool')
# setup.runImportStepFromProfile('profile-bika.health:default', 'skins')
"""Update workflow permissions
"""
# wf = getToolByName(portal, 'portal_workflow')
# wf.updateRoleMappings()
return True
5 changes: 3 additions & 2 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
3.1.9 (unreleased)
3.2 (unreleased)
------------------
HEALTH-503: Validation of Date of birth
Updated to work with BikaLIMS 3.2
HEALTH-503: Validation of Date of birth
HEALTH-413: Dashboard not showing
HEALTH-402: In Analysis Request Add form, contact doesn't get selected

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import os

version = '3.1.8'
version = '3.2'

setup(name='bika.health',
version=version,
Expand Down Expand Up @@ -33,7 +33,7 @@
zip_safe=False,
install_requires=[
'setuptools',
'bika.lims<3.2',
'bika.lims==3.2.1',
'archetypes.schemaextender',
'collective.wtf',
],
Expand Down