Skip to content

Commit 52fc65b

Browse files
committed
Squashed commit of the following:
commit 2605e4c Author: Ramon Bartl <[email protected]> Date: Thu Feb 10 09:00:57 2022 +0100 Added SENAITE maintenance scripts (senaite#1933) * Added senaite scripts runtime and first script * Added upgrade script * Added reindex script * Changelog updated * Always upgrade the latest versions * Fixed import commit 27353ad Author: Jordi Puiggené <[email protected]> Date: Wed Feb 9 20:57:58 2022 +0100 Fix cannot attach documents to individual analyses in Worksheet context (senaite#1932) * Fix cannot set attachments to specific analyses in Worksheet * Remove unnecessary code * Changelog commit 269f1b1 Author: Ramon Bartl <[email protected]> Date: Mon Feb 7 12:49:21 2022 +0100 Ensure valid timezone in DX datetime field setter (senaite#1930) * Ensure valid timezone in field setter * Changelog updated * Convert GMT timezones to Etc/GMT pytz timezones * Whitespace only * Date API takes care of DateTime conversion * Better Timezone conversion * Added a note regarding the Etc/GMT Timezone * Leverate datetime API for field conversions * Check for None type * Make Etc/GMT the default fallback commit 8092b0d Author: Jordi Puiggené <[email protected]> Date: Mon Jan 31 10:53:57 2022 +0100 Analysis attachment is copied on retest (senaite#1927) * Skip "Attachment" field on analysis' field values copy * Changelog Co-authored-by: Ramon Bartl <[email protected]> commit 01df928 Author: Ramon Bartl <[email protected]> Date: Mon Jan 31 10:44:56 2022 +0100 Added `on_change` hook for methods in analyses listings (senaite#1928) * Added on_change handler for Methods * Changelog updated * Enable _on_change_method on worksheet's results entry view Co-authored-by: Jordi Puiggené <[email protected]> commit 88d3053 Author: Ramon Bartl <[email protected]> Date: Thu Jan 27 08:38:22 2022 +0100 Updated Translations from Transifex (senaite#1926) * updated translations * fixed i18n errors commit 7200333 Author: Ramon Bartl <[email protected]> Date: Wed Jan 26 11:23:11 2022 +0100 Fix sample transition in listings (senaite#1925) * Don't set sample date if already set * Convert field getter names back to field name * Imports only * Fixed datetime conversion in sample listing when sample wf is active * Fixed workflow adapter for sample transition in listings * Changelog updated * Allow to set min/max values for datetime field commit b0506d8 Author: Ramon Bartl <[email protected]> Date: Tue Jan 25 17:08:51 2022 +0100 Fix viewlet rendering error on login screen (senaite#1924) * Hide socialtags viewlets * Update CHANGES.rst * Update CHANGES.rst Co-authored-by: Jordi Puiggené <[email protected]> commit a030d92 Author: Ramon Bartl <[email protected]> Date: Tue Jan 25 17:04:35 2022 +0100 Use native date input fields in reports (senaite#1923) * Use native date input fields in reports * Changelog updated Co-authored-by: Jordi Puiggené <[email protected]> commit 61fb6f3 Author: Ramon Bartl <[email protected]> Date: Mon Jan 24 12:14:58 2022 +0100 Fix indexed attributes not set when adding a new index with catalog API (senaite#1920) * Fixed catalog API indexed attributes not set when adding a new index * Changelog updated commit 0e81ba7 Author: Ramon Bartl <[email protected]> Date: Fri Jan 21 17:14:03 2022 +0100 Always call object info adapter with a record (senaite#1919) commit 28a3169 Author: Ramon Bartl <[email protected]> Date: Fri Jan 21 17:11:15 2022 +0100 Fix stale combobox items displayed when search query changed (senaite#1918) * Force combobox close when search query changed * Remove portal_factory check in combobox JS * Handle portal_factory urls * Generated coffee script * Changelog updated commit 314f80b Author: Ramon Bartl <[email protected]> Date: Fri Jan 21 12:01:18 2022 +0100 Fix wrong context in reference widget lookups (senaite#1917) * Use absolute context url for reference widget lookups * Changelog updated commit 8a1f37c Author: Ramon Bartl <[email protected]> Date: Fri Jan 21 10:32:46 2022 +0100 Provide the request record to object info adapters in the sample add form (senaite#1916) * Provide the request record to object info adapters * Changelog * Removed argument for base method commit 6cb368f Author: Ramon Bartl <[email protected]> Date: Thu Jan 20 15:17:04 2022 +0100 Ported PR senaite#1865 for dexterity contents (senaite#1913) * Ported PR senaite#1865 for dexterity contents * Changelog updated Co-authored-by: Jordi Puiggené <[email protected]> commit f15e188 Author: Ramon Bartl <[email protected]> Date: Thu Jan 20 15:14:13 2022 +0100 Support list queries in dx reference widget (senaite#1915) * Build production JS * Support lists for catalog queries in DX reference widget * Changelog updated Co-authored-by: Jordi Puiggené <[email protected]> commit cb77fc3 Author: Ramon Bartl <[email protected]> Date: Thu Jan 20 15:11:34 2022 +0100 Provide context, widget and fieldname for callable base queries in AT reference widgets (senaite#1914) * Call base query callable with context, widget and fieldname * Changelog updated * Return the dereferenced base query commit b077f7e Author: Ramon Bartl <[email protected]> Date: Wed Jan 19 13:47:46 2022 +0100 Fixed typo in sample view (senaite#1912) * Fixed typo * Changelog updated commit 6c5fa8a Author: Ramon Bartl <[email protected]> Date: Mon Jan 17 12:07:47 2022 +0100 Avoid parse errors for ZCTextIndex (senaite#1910) Traceback (innermost last): Module ZServer.ZPublisher.Publish, line 144, in publish Module ZPublisher.mapply, line 85, in mapply Module ZServer.ZPublisher.Publish, line 44, in call_object Module senaite.app.listing.view, line 216, in __call__ Module senaite.app.listing.ajax, line 109, in handle_subpath Module senaite.core.decorators, line 20, in decorator Module senaite.app.listing.decorators, line 63, in wrapper Module senaite.app.listing.decorators, line 50, in wrapper Module senaite.app.listing.decorators, line 100, in wrapper Module senaite.app.listing.ajax, line 432, in ajax_folderitems Module senaite.app.listing.decorators, line 88, in wrapper Module senaite.app.listing.ajax, line 313, in get_folderitems Module senaite.app.listing.view, line 901, in folderitems Module senaite.app.listing.view, line 715, in _fetch_brains Module senaite.app.listing.view, line 781, in search Module senaite.app.listing.view, line 708, in text_index_search Module Products.CMFPlone.CatalogTool, line 463, in searchResults Module Products.ZCatalog.ZCatalog, line 625, in searchResults Module Products.ZCatalog.Catalog, line 1091, in searchResults Module Products.ZCatalog.Catalog, line 634, in search Module Products.ZCatalog.Catalog, line 564, in _search_index Module Products.ZCTextIndex.ZCTextIndex, line 209, in query_index Module Products.ZCTextIndex.QueryParser, line 153, in parseQuery Module Products.ZCTextIndex.QueryParser, line 193, in _parseOrExpr Module Products.ZCTextIndex.QueryParser, line 211, in _parseAndExpr Module Products.ZCTextIndex.QueryParser, line 233, in _parseNotExpr Module Products.ZCTextIndex.QueryParser, line 241, in _parseTerm Module Products.ZCTextIndex.QueryParser, line 260, in _parseAtom Module Products.ZCTextIndex.QueryParser, line 188, in _get Module Products.ZCTextIndex.QueryParser, line 174, in _require ParseError: Token <Token:ATOM> required, u'OR' found commit 6173111 Author: Ramon Bartl <[email protected]> Date: Sun Jan 16 12:41:22 2022 +0100 Allow to navigate and select with arrow keys in dexterity reference widget (senaite#1909) * Fixed results highlighting * Allow to navigate and select results with arrow keys * Changelog updated * Allow to navigate pages with left/right keys * Search on keydown and clear on backspace Co-authored-by: Jordi Puiggené <[email protected]> commit 1f22fec Author: Ramon Bartl <[email protected]> Date: Sun Jan 16 12:39:28 2022 +0100 Added searchable text querystring converter to catalog API (senaite#1908) * Added searchable text querystring converter to catalog API * Changelog updated Co-authored-by: Jordi Puiggené <[email protected]> commit cd037c6 Author: Ramon Bartl <[email protected]> Date: Sun Jan 16 12:20:31 2022 +0100 Fix datetime field/widget shows current date and time if empty (senaite#1907) * Fix datetime widget shows current date if empty This also happened for older `datetime.date` objects in the DB * Changelog updated * Support date strings in date API * Raise API Error instead commit 14eff7b Author: Ramon Bartl <[email protected]> Date: Sat Jan 15 20:14:12 2022 +0100 Revert "Check for a date value in widget" This reverts commit 97b18cb. commit be3d500 Author: Ramon Bartl <[email protected]> Date: Sat Jan 15 10:07:34 2022 +0100 Revert "Support date strings in date API" This reverts commit 708a051. commit b10395b Author: Ramon Bartl <[email protected]> Date: Sat Jan 15 10:07:11 2022 +0100 Revert "Revert "Fix empty field in sample add form when using edit accessor (senaite#1905)"" This reverts commit 9f654ad. commit 9f654ad Author: Ramon Bartl <[email protected]> Date: Sat Jan 15 10:04:27 2022 +0100 Revert "Fix empty field in sample add form when using edit accessor (senaite#1905)" This reverts commit b1f8126. commit 97b18cb Author: Ramon Bartl <[email protected]> Date: Sat Jan 15 09:56:55 2022 +0100 Check for a date value in widget commit 708a051 Author: Ramon Bartl <[email protected]> Date: Sat Jan 15 09:56:13 2022 +0100 Support date strings in date API commit b1f8126 Author: Ramon Bartl <[email protected]> Date: Thu Jan 13 13:27:17 2022 +0100 Fix empty field in sample add form when using edit accessor (senaite#1905) * Fix empty field in sample add form when using edit accessor * Changelog updated * Fixed buildout version commit c96fa99 Author: Jordi Puiggené <[email protected]> Date: Wed Jan 5 11:21:06 2022 +0100 Update release notes commit b5681b4 Author: Jordi Puiggené <[email protected]> Date: Wed Jan 5 11:14:55 2022 +0100 Version bump v2.2.0 commit 862acfd Merge: 84f1089 80a16ab Author: Jordi Puiggené <[email protected]> Date: Wed Jan 5 11:04:25 2022 +0100 Release 2.1.0 (220105) commit 80a16ab Author: Jordi Puiggené <[email protected]> Date: Wed Jan 5 11:03:18 2022 +0100 Update translations commit c848b04 Author: Jordi Puiggené <[email protected]> Date: Wed Jan 5 10:51:55 2022 +0100 Added translators commit abff9e6 Author: Jordi Puiggené <[email protected]> Date: Wed Jan 5 10:17:54 2022 +0100 Fix NestingError commit 8fbea94 Author: Jordi Puiggené <[email protected]> Date: Wed Jan 5 10:05:15 2022 +0100 Update contributors commit 5ddb91e Author: Jordi Puiggené <[email protected]> Date: Wed Jan 5 09:45:51 2022 +0100 Version change 2.0.1 --> 2.1.0 commit 84f1089 Author: Ramon Bartl <[email protected]> Date: Tue Jan 4 19:18:04 2022 +0100 Added date and time field/widget for Dexterity contents (senaite#1903) * Implemented datetime field * Custom setter for datetime field * Implemented datetime widget * Handle timezones * Added datetime API * Always localize the date on field level * Datetime widget refactored to use the date API * Extended API * Check if timezone is callable This can be the case when the `default_timezone` is set through a directive on the widget, e.g.: from plone.app.event.base import default_timezone * Changelog updated * Updated scrutinizer config * Added API function to generate a POSIX timestamp * Added from_timestamp API function * Added ISO format API * Handle Python date objects * Dropped get_min/get_max methods * Test fixed for TZ * Fixed datetimewidget display value * Test fixture * Fixed test commit 2d6cc35 Author: Ramon Bartl <[email protected]> Date: Mon Jan 3 16:57:19 2022 +0100 Allow date fields to be unset (senaite#1904) commit 985b8f1 Author: toropok <[email protected]> Date: Mon Jan 3 21:22:32 2022 +0700 Fix DurationValidator when field value is empty (senaite#1890) * Update DurationValidator * Update CHANGES.rst commit 8779528 Author: Jordi Puiggené <[email protected]> Date: Thu Dec 23 15:38:41 2021 +0100 Ensure `get_tool` returns a tool when a name is set as the default param (senaite#1902) * Ensure get_tool's default returns a tool * Added doctest commit 13498f3 Author: Ramon Bartl <[email protected]> Date: Mon Dec 20 15:15:30 2021 +0100 Fix snapshot listing fails on orphan catalog entries (senaite#1900) * Fix snapshot listing fails on orphan catalog entries * Changelog updated commit c219b22 Author: Ramon Bartl <[email protected]> Date: Mon Dec 20 15:14:05 2021 +0100 Improved style for datetimewidget w/o hard coded width (senaite#1901) This fixes a side effect in the results table view commit 0755ba7 Author: Ramon Bartl <[email protected]> Date: Wed Dec 15 12:09:15 2021 +0100 Fix archetype tool catalog mappings (senaite#1898) * Fix archetype tool catalog mappings * Comment added commit 4eb6c68 Author: Ramon Bartl <[email protected]> Date: Tue Dec 14 09:45:22 2021 +0100 Support date and number fields copy in sample add form (senaite#1897) * Copy date/time/hidden fields * Changelog commit 6256c38 Author: Ramon Bartl <[email protected]> Date: Mon Dec 13 10:35:15 2021 +0100 Custom date and time widget (senaite#1896) * Always show time if long_format is requested * Imports sorted * Changed datetimewidget properties in instrumentcertification * Fixed TZ offset issue in "valid to" instrument certification field * Updated datetimewidget to display date and time separate * Hide time input if show_only is false * Added JS docstrings * Changelog updated * Avoid time cropping in FireFox * Make form controls 260px wide * Conditional widths commit 15dd407 Author: Ramon Bartl <[email protected]> Date: Thu Dec 9 16:49:13 2021 +0100 Disable native form validation in header table (senaite#1895) * No native form validation in header table * Changelog updated commit 91b4bc0 Author: Ramon Bartl <[email protected]> Date: Wed Dec 8 17:40:44 2021 +0100 Removed unused field PasswordLifeTime (senaite#1893) * Removed blind field PasswordLifeTime * Changelog updated commit 6cbbfb4 Author: Ramon Bartl <[email protected]> Date: Wed Dec 8 12:21:26 2021 +0100 Drop jQuery Datepicker for HTML5 native date fields (senaite#1892) * Removed jQuery timepicker JS * removed jquery timepicker from webpack config * rebuild production js * removed datetime js from site * Use HTML date or datetime-local input field * Added copy functionality in add form for date fields * Return ISO8601 format * Changelog updated * Removed * Use manual formatted date format for min/max * datetime-local field requires local date format w/o timezone * Use correct datetime field * Removed malicious DateTime field in bika namespace * Comment only
1 parent 54e638c commit 52fc65b

File tree

263 files changed

+46716
-35695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+46716
-35695
lines changed

.scrutinizer.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,18 @@ filter:
2121

2222
build:
2323
environment:
24-
python: 2.7.9
24+
python: 2.7.18
2525

2626
dependencies:
2727
before:
28-
- pip install -v pip==19.3.1
29-
- pip install -v setuptools==44.1.1
30-
- pip install -v zc.buildout==2.13.3
3128
- pip install virtualenv
3229
- pip install -r requirements.txt
33-
- /home/scrutinizer/.pyenv/versions/2.7.9/bin/buildout -v
34-
- mv -v /home/scrutinizer/build/develop-eggs/* /home/scrutinizer/.pyenv/versions/2.7.9/lib/python2.7/site-packages/
35-
- mv -v /home/scrutinizer/build/eggs/*.egg /home/scrutinizer/.pyenv/versions/2.7.9/lib/python2.7/site-packages/
30+
- /home/scrutinizer/.pyenv/versions/2.7.18/bin/buildout -v
31+
- mv -v /home/scrutinizer/build/develop-eggs/* /home/scrutinizer/.pyenv/versions/2.7.18/lib/python2.7/site-packages/
32+
- mv -v /home/scrutinizer/build/eggs/*.egg /home/scrutinizer/.pyenv/versions/2.7.18/lib/python2.7/site-packages/
3633

3734
nodes:
3835
analysis:
3936
tests:
4037
override:
41-
- py-scrutinizer-run
38+
- py-scrutinizer-run

CHANGES.rst

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,43 @@
11
Changelog
22
=========
33

4-
2.0.1 (unreleased)
4+
2.2.0 (unreleased)
55
------------------
66

7+
- #1933 Added SENAITE maintenance scripts
8+
- #1932 Fix cannot attach documents to individual analyses in Worksheet context
9+
- #1930 Ensure valid timezone in DX datetime field setter
10+
- #1927 Fix Analysis attachment is copied on retest
11+
- #1928 Added `on_change` hook for methods in analyses listings
12+
- #1925 Fix sample transition in listings
13+
- #1924 Fix Login screen shows message error while rendering plone.htmlhead.socialtags
14+
- #1923 Use native date input fields in reports
15+
- #1920 Fix indexed attributes not set when adding a new index with catalog API
16+
- #1918 Fix stale combobox items displayed when search query changed
17+
- #1917 Fix wrong context in reference widget lookups
18+
- #1916 Provide the request record to object info adapters in the sample add form
19+
- #1913 Ported PR #1865 for dexterity contents
20+
- #1915 Support list queries in dx reference widget
21+
- #1914 Provide context, widget and fieldname for callable base queries in AT reference widgets
22+
- #1912 Fixed typo in sample view
23+
- #1909 Allow to navigate and select with arrow keys in dexterity reference widget
24+
- #1908 Added searchable text querystring converter to catalog API
25+
- #1907 Fix datetime field/widget shows current date and time if empty
26+
- #1905 Fix empty field in sample add form when using edit accessor
27+
28+
29+
2.1.0 (2022-01-05)
30+
------------------
31+
32+
- #1903 Added date and time field/widget for Dexterity contents
33+
- #1901 Ensure `get_tool` returns a tool when a name is set as the default param
34+
- #1900 Fix snapshot listing fails on orphan catalog entries
35+
- #1897 Support date and number fields copy in sample add form
36+
- #1896 Custom date and time widget
37+
- #1895 Disable native form validation in header table
38+
- #1893 Removed unused field PasswordLifeTime
39+
- #1892 Drop jQuery Datepicker for HTML5 native date fields
40+
- #1890 Fix DurationValidator when field value is empty
741
- #1886 Use the current timestamp instead of the client name for report archive download
842
- #1883 Fix possible XSS in remarks field
943
- #1882 Fix catalog query in analysis category modified handler

CONTRIBUTORS.rst

+17-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ contributions descending.
88

99
- Campbell McKellar-Basset, [email protected]
1010
- Jordi Puiggené, [email protected]
11-
- Pau Soliva, [email protected]
1211
- Ramon Bartl, [email protected]
12+
- Pau Soliva, [email protected]
1313
- Nihad Mammadli, [email protected]
1414
- Anneline Sweetname, [email protected]
1515
- Juan Gallostra, [email protected]
@@ -27,6 +27,7 @@ contributions descending.
2727
- witekdev, [email protected]
2828
- Anderson Smith, [email protected]
2929
- Javis Sullivan, [email protected]
30+
3031
- Pieter van der Merwe, [email protected]
3132
- Jean Jordaan, [email protected]
3233
- MoffatMore, [email protected]
@@ -68,6 +69,8 @@ Translators
6869
- limsgr, [email protected], Greek (el)
6970
- Mike Metcalfe, [email protected], English (United States) (en_US)
7071
- PabloBF, [email protected], Esperanto (eo)
72+
- ELvira Aylon, [email protected], Spanish (es)
73+
- Leonardo J. Caballero G., [email protected], Spanish (es)
7174
- Leonardo Rojas, [email protected], Spanish (es)
7275
- Carlos Javier García Quintana, [email protected], Spanish (es)
7376
- Alfonso de la Guarda Reyes, [email protected], Spanish (es)
@@ -79,16 +82,20 @@ Translators
7982
- SSchott, [email protected], Spanish (es)
8083
- Michael Quintana, [email protected], Spanish (es)
8184
- Campbell McKellar-Basset, [email protected], Spanish (es)
85+
- Leonardo J. Caballero G., [email protected], Spanish (Latin America) (es_419)
8286
- Marco Rodriguez, [email protected], Spanish (Latin America) (es_419)
8387
- Didinson Muñoz, [email protected], Spanish (Latin America) (es_419)
88+
- Leonardo J. Caballero G., [email protected], Spanish (Argentina) (es_AR)
8489
- Fernando Sánchez, [email protected], Spanish (Peru) (es_PE)
8590
- Jordi Puiggené, [email protected], Spanish (Peru) (es_PE)
8691
- Alfonso de la Guarda Reyes, [email protected], Spanish (Peru) (es_PE)
8792
- Carlos Javier García Quintana, [email protected], Spanish (Peru) (es_PE)
8893
- Campbell McKellar-Basset, [email protected], Spanish (Peru) (es_PE)
94+
- roozbeh karimi, [email protected], Persian (fa)
8995
- alireza mashayekhi, [email protected], Persian (fa)
9096
- arma, [email protected], Persian (fa)
9197
- Mohammad Javad Danesh, [email protected], Persian (fa)
98+
- Ludwig Muster, [email protected], French (fr)
9299
- CestPasFaux, [email protected], French (fr)
93100
- Bonamour, [email protected], French (fr)
94101
- MALESSAN, [email protected], French (fr)
@@ -98,6 +105,7 @@ Translators
98105
- Didier Desplanque, [email protected], French (fr)
99106
- Ahmed BEN BRAHIM, [email protected], French (fr)
100107
- DELAMARRE, [email protected], French (fr)
108+
- Wei Chung Sim, [email protected], Malay (ms)
101109
- Jayadeep Karnati, [email protected], Hindi (hi)
102110
- Alphons Senki, [email protected], Hungarian (hu)
103111
- Fitra Purna, [email protected], Indonesian (id)
@@ -127,6 +135,8 @@ Translators
127135
- cruzrenato1, [email protected], Portuguese (Brazil) (pt_BR)
128136
- baktron, [email protected], Portuguese (Brazil) (pt_BR)
129137
- corneliu.e, [email protected], Romanian (Romania) (ro_RO)
138+
- Алексей Сериков, [email protected], Russian (ru)
139+
- Artem Kladov, [email protected], Russian (ru)
130140
- Oleksandr Fedorov, [email protected], Russian (ru)
131141
- Pavel Shuper, [email protected], Russian (ru)
132142
- Михаил Стручалин, [email protected], Russian (ru)
@@ -139,7 +149,12 @@ Translators
139149
- Dima Domin, [email protected], Ukrainian (Ukraine) (uk_UA)
140150
- Misha Bychkov, [email protected], Ukrainian (Ukraine) (uk_UA)
141151
- Pavel Shuper, [email protected], Ukrainian (Ukraine) (uk_UA)
152+
- Muzzammil Hussain, [email protected], Urdu (ur)
153+
- Kevin Xu, [email protected], Chinese (zh)
142154
- Rui Tang, [email protected], Chinese (zh)
155+
- xuhaida76, [email protected], Chinese (China) (zh_CN)
156+
- Raymond Yu, [email protected], Chinese (China) (zh_CN)
157+
- 道, [email protected], Chinese (China) (zh_CN)
143158
- lin chen, [email protected], Chinese (China) (zh_CN)
144159
- Rui Tang, [email protected], Chinese (China) (zh_CN)
145160
- jincheng_li, [email protected], Chinese (China) (zh_CN)
@@ -153,3 +168,4 @@ Translators
153168
- Rui Tang, [email protected], Chinese (Taiwan) (zh_TW)
154169
- Matthew Tsui, [email protected], Chinese (Taiwan) (zh_TW)
155170
- Liz Sung, [email protected], Chinese (Taiwan) (zh_TW)
171+
- Wei Chung Sim, [email protected], Chinese (Taiwan) (zh_TW)

RELEASE_NOTES.rst

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
Release notes
22
=============
33

4+
Update from 2.0.0 to 2.1.0
5+
--------------------------
6+
7+
!!! This update requires at least Plone 5.2.5 and Python 2.x. !!!
8+
9+
Please update your `buildout.cfg` configuration file to this version and re-run
10+
the `buildout` script.
11+
12+
You can use the Plone unified installer to install Plone 5.x first:
13+
https://github.com/plone/Installers-UnifiedInstaller
14+
15+
Please make sure to pin `senaite.lims` to version `2.1.0` to get the correct
16+
versions of all dependent SENAITE packages.
17+
18+
419
Update from 1.3.x to 2.0.0
520
--------------------------
621

@@ -18,7 +33,6 @@ versions of all dependent SENAITE packages.
1833
Run first the Plone upgrade before you continue to update SENAITE to version 2.x.
1934

2035

21-
2236
Update from 1.3.0 to 1.3.1
2337
--------------------------
2438

buildout.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[buildout]
22
index = https://pypi.org/simple/
3-
extends = https://dist.plone.org/release/5.2.5/versions.cfg
3+
extends = https://dist.plone.org/release/5.2.6/versions.cfg
44
find-links =
5-
https://dist.plone.org/release/5.2.5/
5+
https://dist.plone.org/release/5.2.6/
66
https://dist.plone.org/thirdparty/
77

88
parts =

setup.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from setuptools import setup
2222
from setuptools import find_packages
2323

24-
version = "2.0.1"
24+
version = "2.2.0"
2525

2626
setup(
2727
name="senaite.core",
@@ -69,7 +69,7 @@
6969
"Products.DataGridField",
7070
"Products.TextIndexNG3",
7171
"Products.contentmigration",
72-
# XXX: Remove after 2.0.1
72+
# XXX: Remove after 2.1.0
7373
"zopyx.txng3.ext==3.4.0",
7474
# tinycss2 >= 1.0.0 does not support Python 2.x anymore
7575
"tinycss2<1.0.0",
@@ -106,5 +106,10 @@
106106
# -*- Entry points: -*-
107107
[z3c.autoinclude.plugin]
108108
target = plone
109+
110+
[console_scripts]
111+
reindex = senaite.core.scripts:reindex
112+
upgrade-sites = senaite.core.scripts:upgrade_sites
113+
zope-passwd = senaite.core.scripts:zope_passwd
109114
""",
110115
)

src/bika/lims/adapters/addsample.py

+6
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,9 @@ def get_object_info(self):
5050
See IAddSampleObjectInfo for further details
5151
"""
5252
raise NotImplementedError("get_object_info not implemented")
53+
54+
def get_object_info_with_record(self, record):
55+
"""Same as get_object_record, but contains the current request record
56+
"""
57+
# default to the base object info
58+
return self.get_object_info()

src/bika/lims/api/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ def get_tool(name, context=None, default=_marker):
191191
return ploneapi.portal.get_tool(name)
192192
except InvalidParameterError:
193193
if default is not _marker:
194+
if isinstance(default, six.string_types):
195+
return get_tool(default)
194196
return default
195197
fail("No tool named '%s' found." % name)
196198

src/bika/lims/api/snapshot.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ def get_version(obj):
118118
:returns: Current version of the object or -1
119119
"""
120120
count = get_snapshot_count(obj)
121-
if count == 0:
122-
return -1
123121
return count - 1
124122

125123

@@ -441,6 +439,8 @@ def _get_title_or_id_from_uid(uid):
441439
try:
442440
obj = api.get_object_by_uid(uid)
443441
except api.APIError:
442+
obj = None
443+
if not obj:
444444
return "<Deleted {}>".format(uid)
445445
title_or_id = api.get_title(obj) or api.get_id(obj)
446446
return title_or_id

src/bika/lims/browser/__init__.py

+1-67
Original file line numberDiff line numberDiff line change
@@ -19,81 +19,18 @@
1919
# Some rights reserved, see README and LICENSE.
2020

2121
import traceback
22-
from datetime import datetime
23-
from time import strptime
24-
25-
import six
2622

2723
from AccessControl import ClassSecurityInfo
2824
from bika.lims import api
2925
from bika.lims import logger
3026
from DateTime.DateTime import DateTime
31-
from DateTime.DateTime import safelocaltime
32-
from Products.ATContentTypes.utils import dt2DT
3327
from Products.CMFCore.utils import getToolByName
3428
from Products.CMFPlone.i18nl10n import ulocalized_time as _ut
3529
from Products.Five.browser import BrowserView as BaseBrowserView
3630
from zope.cachedescriptors.property import Lazy as lazy_property
3731
from zope.i18n import translate
3832

3933

40-
def get_date(context, value):
41-
"""Tries to return a DateTime.DateTime object
42-
"""
43-
if not value:
44-
return None
45-
if isinstance(value, DateTime):
46-
return value
47-
if isinstance(value, datetime):
48-
return dt2DT(value)
49-
if not isinstance(value, six.string_types):
50-
return None
51-
52-
def try_parse(date_string, format):
53-
if not format:
54-
return None
55-
try:
56-
struct_time = strptime(date_string, format)
57-
return datetime(*struct_time[:6])
58-
except ValueError:
59-
pass
60-
return None
61-
62-
def get_locale_format(key):
63-
request = api.get_request()
64-
format = translate(
65-
key, domain="senaite.core", mapping={}, context=request)
66-
# The variables at locales .po files (e.g. "date_format_short") take
67-
# into consideration the translation service tool and therefore, their
68-
# format is like "${d}/${m}/${Y}". We need to "convert" this format
69-
# to %-like.
70-
return format.replace(r"${", '%').replace('}', '')
71-
72-
# Try with prioritized formats
73-
formats = [
74-
get_locale_format("date_format_long"),
75-
get_locale_format("date_format_short"),
76-
"%Y-%m-%d %H:%M",
77-
"%Y-%m-%d",
78-
"%Y-%m-%d %H:%M:%S",
79-
]
80-
for pri_format in formats:
81-
val = try_parse(value, pri_format)
82-
if not val:
83-
continue
84-
val = dt2DT(val)
85-
if val.timezoneNaive():
86-
# Use local timezone for tz naive strings
87-
# see http://dev.plone.org/plone/ticket/10141
88-
zone = val.localZone(safelocaltime(val.timeTime()))
89-
parts = val.parts()[:-1] + (zone,)
90-
val = DateTime(*parts)
91-
return val
92-
93-
logger.warn("Unable to convert {} to datetime".format(value))
94-
return None
95-
96-
9734
def ulocalized_time(time, long_format=None, time_only=None, context=None,
9835
request=None):
9936
"""
@@ -115,13 +52,10 @@ def ulocalized_time(time, long_format=None, time_only=None, context=None,
11552
"""
11653
# if time is a string, we'll try pass it through strptime with the various
11754
# formats defined.
118-
time = get_date(context, time)
55+
time = api.to_date(time)
11956
if not time or not isinstance(time, DateTime):
12057
return ''
12158

122-
# no printing times if they were not specified in inputs
123-
if time.second() + time.minute() + time.hour() == 0:
124-
long_format = False
12559
try:
12660
time_str = _ut(time, long_format, time_only, context, 'senaite.core', request)
12761
except ValueError:

0 commit comments

Comments
 (0)