senaite.core icon indicating copy to clipboard operation
senaite.core copied to clipboard

Migrate clients folder to Dexterity

Open xispa opened this issue 4 years ago • 2 comments

Description of the issue/feature this PR addresses

This Pull Request migrates ClientFolder (AT) to Clients (DX). Note that children objects are moved into the new folder, regardless of their type (AT or DX).

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

xispa avatar Jan 21 '21 18:01 xispa

@xispa from what I understand, this is (one of the things) currently blocking the path to Python 3. is there anything I can do to help with that?

winniehell avatar Jul 29 '22 09:07 winniehell

@xispa from what I understand, this is (one of the things) currently blocking the path to Python 3. is there anything I can do to help with that?

Hi @winniehell, thanks for your offer to support!

Indeed, this is one of the bigger things that need to be done to go towards Python 3, also see https://github.com/senaite/senaite.core/blob/2.x/P8_UPGRADE_GUIDE.md

Why is it a bigger one? Because inside clients live all the samples, analyses, publication reports, contacts ... These have to be all moved and reindexed when we migrate, which might take really ages for big databases with 50k samples and about 500k analyses.

So how to go forward? Basically we have to migrate all contents that are based on Archetypes and remove code that is not compatible with Python 3 (by using six). We decided to migrate first the most simple contents from the setup, like we did already with e.g. the sample containers, or the instrument locations (see https://github.com/senaite/senaite.core/tree/2.x/src/senaite/core/content).

In the current version, we created already a new SENAITE Setup container (https://github.com/senaite/senaite.core/blob/2.x/src/senaite/core/content/senaitesetup.py) that will hold in the future all of the contents from bika_setup as soon as they are migrated.

What could you do? We already have a migration machinery that seem to work pretty well, see here for an example: https://github.com/senaite/senaite.core/blob/2.x/src/senaite/core/upgrade/v02_02_000.py#L92

You could go ahead to migrate e.g. Sample Matrix (https://github.com/senaite/senaite.core/blob/2.x/src/bika/lims/content/samplematrix.py) or Sub Group (https://github.com/senaite/senaite.core/blob/2.x/src/bika/lims/content/subgroup.py) in a similar way as we did with the Sample containers.

Maybe you can check the PR to see what code was all required: https://github.com/senaite/senaite.core/pull/1911

Thanks and best regards Ramon

ramonski avatar Jul 29 '22 13:07 ramonski