Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Ensure Client contents allow to hold Patient types #159

Merged
merged 4 commits into from
Dec 17, 2019

Conversation

ramonski
Copy link
Contributor

Description of the issue/feature this PR addresses

This PR ensures that Patients can be moved below their assigned Client after creation.

Current behavior before PR

If an upgrade step from senaite.core ran the typeinfo upgrade step, the allowed types was set back to the defaults, which does not allow Patient types.

This resulted in this error:

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module Products.CMFFormController.FSControllerPageTemplate, line 91, in __call__
  Module Products.CMFFormController.BaseControllerPageTemplate, line 29, in _call
  Module Products.CMFFormController.ControllerBase, line 232, in getNext
  Module Products.CMFFormController.Actions.TraverseTo, line 38, in __call__
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module Products.CMFFormController.FSControllerPythonScript, line 105, in __call__
  Module Products.CMFFormController.Script, line 145, in __call__
  Module Products.CMFCore.FSPythonScript, line 127, in __call__
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 344, in _exec
  Module script, line 1, in content_edit
   - <FSControllerPythonScript at /senaite/patients/patient-12/content_edit>
   - Line 1
  Module Products.CMFCore.FSPythonScript, line 127, in __call__
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 344, in _exec
  Module script, line 12, in content_edit_impl
   - <FSPythonScript at /senaite/patients/patient-12/content_edit_impl>
   - Line 12
  Module Products.Archetypes.BaseObject, line 645, in processForm
  Module zope.event, line 31, in notify
  Module zope.component.event, line 24, in dispatch
  Module zope.component._api, line 136, in subscribers
  Module zope.component.registry, line 321, in subscribers
  Module zope.interface.adapter, line 585, in subscribers
  Module zope.component.event, line 32, in objectEventNotify
  Module zope.component._api, line 136, in subscribers
  Module zope.component.registry, line 321, in subscribers
  Module zope.interface.adapter, line 585, in subscribers
  Module bika.health.subscribers.patient, line 43, in ObjectModifiedEventHandler
  Module OFS.CopySupport, line 332, in manage_pasteObjects
  Module OFS.CopySupport, line 208, in _pasteObjects
  Module Products.CMFCore.PortalFolder, line 421, in _verifyObjectPaste
ValueError: Disallowed subobject type: Patient

Desired behavior after PR is merged

The FTI of Client is checked in the event handler to ensure that Patient can be added

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@xispa xispa merged commit 5b94ff8 into master Dec 17, 2019
@xispa xispa deleted the fix-patient-to-client-move-subscriber branch December 17, 2019 22:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants