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

Remarks in analyses (manage results) are not displayed #109

Merged
merged 2 commits into from
Jun 7, 2017

Conversation

nihadness
Copy link
Contributor

Brains 'content_type' attributes return 'Plone Site'. Use 'meta_type' instead.

@xispa xispa changed the title bug/ Remarks are not displayed Remarks in analyses (manage results) are not displayed Jun 6, 2017
@@ -421,7 +421,7 @@ Table cells for each column from in review_state's column list.
<!-- Row Remarks field (for Analyses) -->
<tal:remarks_condition
tal:define="remarksenabled python:view.context.bika_setup.getEnableAnalysisRemarks();
isanalysis python:'obj' in item and item['obj'].portal_type == 'Analysis';
isanalysis python:'obj' in item and item['obj'].meta_type == 'Analysis';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about using meta_type instead of portal_type.

In any case, it will not work if the analysis is a DuplicateAnalysis. Might be better to check against AbstractRoutineAnalysis (https://github.com/naralabs/bika.lims/blob/wip/bika/lims/content/abstractroutineanalysis.py#L105).

Since AbstractRoutineAnalysis implements IAnalysis, the best approach IMO would be something like:

isanalysis python:'obj' in item and IAnalysis.providedBy(item['obj'])

Note that because ReferenceAnalysis inherits from AbstractAnalysis (instead of AbstractRoutineAnalysis), so remarks for ReferenceAnalysis objects will never be displayed. @rockfruit I suggest AbstractAnalysis to implement IAnalysis (AbstractRoutineAnalysis implements IRoutineAnalysis), specially because there are some adapters (such as ResultsOutOfRange) for IAnalysis that must work for ReferenceAnalysis too.

@xispa xispa merged commit f983d03 into wip Jun 7, 2017
@xispa xispa deleted the bug/Remarks-not-displayed branch August 24, 2017 08:13
Ruhanga pushed a commit to Ruhanga/senaite.core that referenced this pull request Mar 14, 2022
)

This was because of senaite#920

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.CMFPlone.FactoryTool, line 478, in __call__
  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 32, in _call
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 237, in _exec
  Module Products.CMFCore.FSPageTemplate, line 177, in pt_render
  Module Products.PageTemplates.PageTemplate, line 87, in pt_render
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module five.pt.engine, line 98, in __call__
  Module z3c.pt.pagetemplate, line 158, in render
  Module chameleon.zpt.template, line 297, in render
  Module chameleon.template, line 191, in render
  Module chameleon.template, line 171, in render
  Module 338b44bf2274717b61b2323795a9c98f.py, line 1101, in render
  Module 338b44bf2274717b61b2323795a9c98f.py, line 911, in render_master
  Module 69e91da7ad509eec74265fa5c1df1777.py, line 1465, in render_master
  Module 69e91da7ad509eec74265fa5c1df1777.py, line 645, in render_content
  Module 338b44bf2274717b61b2323795a9c98f.py, line 901, in __fill_main
  Module 338b44bf2274717b61b2323795a9c98f.py, line 153, in render_main
  Module 5f0aa4601784b64af4844c8766340a88.py, line 414, in render_body
  Module Products.Archetypes.BaseObject, line 276, in widget
  Module Products.Archetypes.Renderer, line 26, in render
  Module Products.Archetypes.generator.widget, line 147, in __call__
AttributeError: Macro bika_widgets/remarks does not exist for <Patient at patient.2018-09-17.1793646232>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants