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

PR-1942 Feature/Instrument certification interval + Traceback after adding calibration certificate #459

Merged
merged 21 commits into from
Dec 9, 2017

Conversation

xispa
Copy link
Member

@xispa xispa commented Dec 9, 2017

Description of the issue/feature this PR addresses

Ports PR-1942 Feature/instrument certification interval, supersedes #451 and fixes #442 Traceback in Instruments list after adding a calibration certificate

Current behavior before PR

The following traceback is rised in instruments list after adding a calibration certificate to one of them:

Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module bika.lims.browser.bika_listing, line 936, in call
Module Products.Five.browser.pagetemplatefile, line 125, in call
Module Products.Five.browser.pagetemplatefile, line 59, in call
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module five.pt.engine, line 98, in call
Module z3c.pt.pagetemplate, line 163, in render
Module chameleon.zpt.template, line 276, in render
Module chameleon.template, line 191, in render
Module chameleon.template, line 171, in render
Module a4d4e8c1e59c4a4e78270b349f009dc7.py, line 519, in render
Module bab1671251b6685272775265b52480e7.py, line 1420, in render_master
Module bab1671251b6685272775265b52480e7.py, line 578, in render_content
Module a4d4e8c1e59c4a4e78270b349f009dc7.py, line 417, in __fill_content_core
Module five.pt.expressions, line 161, in call
Module bika.lims.browser.bika_listing, line 1376, in contents_table
Module bika.lims.browser.bika_listing, line 1536, in init
Module bika.lims.controlpanel.bika_instruments, line 121, in folderitems
TypeError: 'datetime.timedelta' object is not iterable

Desired behavior after PR is merged

The list of instruments is displayed without any error.

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

ramonski and others added 21 commits December 9, 2017 20:49
implemented method to InstrumentCalibration.
Added Doctest.
Use this method in Instruments

Conflicts:
	bika/lims/content/instrument.py
	bika/lims/content/instrumentcalibration.py
	bika/lims/tests/test_textual_doctests.py
instruments use this method now as well

Conflicts:
	bika/lims/content/instrumentcertification.py
Conflicts:
	bika/lims/content/instrumentcertification.py
wrapped strings into messagefactory.
Return immediately weeks and dates from the certificate.

Conflicts:
	bika/lims/controlpanel/bika_instruments.py
Conflicts:
	bika/lims/content/instrument.py
	bika/lims/content/instrumentcalibration.py
Conflicts:
	bika/lims/content/instrument.py
Conflicts:
	bika/lims/content/instrument.py
Conflicts:
	bika/lims/content/instrumentcalibration.py
	bika/lims/content/instrumentcertification.py
Instrument Certificaitons can now have an expiration interval,
which automatically calculates the ValidTo field value.

Added doctest to test the new behavior.

Conflicts:
	bika/lims/content/instrumentcertification.py
Also added missing interface IInstrumentValidation

Conflicts:
	bika/lims/content/instrumentvalidation.py
Test for implemented interface in doctest

Conflicts:
	bika/lims/content/instrumentcalibration.py
	bika/lims/interfaces/__init__.py
Conflicts:
	bika/lims/content/instrumentvalidation.py
Conflicts:
	bika/lims/content/instrument.py
Conflicts:
	bika/lims/tests/test_textual_doctests.py
wipe out the original value of the 'ValidTo' field to ensure the calculated
valued don't get overwritten later in the edit process.

Conflicts:
	bika/lims/content/instrumentcertification.py
Copy link
Contributor

@ramonski ramonski left a comment

Choose a reason for hiding this comment

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

Thanks a lot for taking the time merging that!

@ramonski ramonski merged commit a210ca3 into senaite:master Dec 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Traceback after adding calibration certificate
2 participants