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

Update permission imports #47

Merged
merged 5 commits into from
Oct 18, 2024
Merged
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
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
2.6.0 (unreleased)
------------------

- #47 Update permission imports
- #46 Compatibility with core#2584 (SampleType to DX)
- #44 Compatibility with core#2567 (AnalysisCategory to DX)
- #42 Compatibility with core#2471 (Department to DX)
Expand Down
2 changes: 1 addition & 1 deletion src/senaite/storage/setuphandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

from Acquisition import aq_base
from bika.lims import api
from bika.lims import permissions
from plone import api as ploneapi
from Products.CMFCore.permissions import ModifyPortalContent
from Products.CMFPlone.utils import _createObjectByType
from Products.DCWorkflow.Guard import Guard
from senaite.core import permissions
from senaite.core.catalog import SAMPLE_CATALOG
from senaite.core.setuphandlers import setup_catalog_mappings
from senaite.core.setuphandlers import setup_core_catalogs
Expand Down
15 changes: 8 additions & 7 deletions src/senaite/storage/tests/doctests/PrimarySample.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Variables:

>>> portal = self.portal
>>> request = self.request
>>> setup = api.get_setup()
>>> setup = api.get_senaite_setup()
>>> bika_setup = api.get_bika_setup()
>>> storage = portal.senaite_storage

Assign default roles for the user to test with:
Expand All @@ -60,12 +61,12 @@ Create some baseline objects for the test:
>>> client = api.create(portal.clients, "Client", Name="Happy Hills", ClientID="HH", MemberDiscountApplies=True)
>>> contact = api.create(client, "Contact", Firstname="Rita", Lastname="Mohale")
>>> sampletype = api.create(setup.sampletypes, "SampleType", title="Water", Prefix="W")
>>> labcontact = api.create(setup.bika_labcontacts, "LabContact", Firstname="Lab", Lastname="Manager")
>>> department = api.create(portal.setup.departments, "Department", title="Chemistry", Manager=labcontact)
>>> category = api.create(portal.setup.analysiscategories, "AnalysisCategory", title="Metals", Department=department)
>>> Cu = api.create(setup.bika_analysisservices, "AnalysisService", title="Copper", Keyword="Cu", Price="15", Category=category.UID(), Accredited=True)
>>> Fe = api.create(setup.bika_analysisservices, "AnalysisService", title="Iron", Keyword="Fe", Price="10", Category=category.UID())
>>> Au = api.create(setup.bika_analysisservices, "AnalysisService", title="Gold", Keyword="Au", Price="20", Category=category.UID())
>>> labcontact = api.create(bika_setup.bika_labcontacts, "LabContact", Firstname="Lab", Lastname="Manager")
>>> department = api.create(setup.departments, "Department", title="Chemistry", Manager=labcontact)
>>> category = api.create(setup.analysiscategories, "AnalysisCategory", title="Metals", Department=department)
>>> Cu = api.create(bika_setup.bika_analysisservices, "AnalysisService", title="Copper", Keyword="Cu", Price="15", Category=category.UID(), Accredited=True)
>>> Fe = api.create(bika_setup.bika_analysisservices, "AnalysisService", title="Iron", Keyword="Fe", Price="10", Category=category.UID())
>>> Au = api.create(bika_setup.bika_analysisservices, "AnalysisService", title="Gold", Keyword="Au", Price="20", Category=category.UID())

Auto-transition primary sample
..............................
Expand Down
Loading