ERP5Catalog: Trivial improvement on _searchAndActivate.
ERP5Catalog: Allow _searchAndActivate to use more from query result.

_searchAndActivate typically calls callMethodOnObjectList with paths as
parameter. The result is that each listed document is loaded, which may
not be required or desired.
select_method_id avoids this loading by calling method_id once per
packet_size with a list of values extracted from catalog result as (first)
argument.
ERP5Security: Ignore login leading- and trailing-whitespaces.

Real-world users may copy-paste logins without realising they also copy
whitespaces.
Revert "ERP5Security: Ignore login leading- and trailing-whitespaces."

This reverts commit bf00355189764aa6ad7e7efcf9fde355dbadc383.
This commit will be re-applied along with necessary unit test changes.
erp5_web_renderjs_ui: move tab gadget back inside form gadget
erp5_web_renderjs_ui: set CSP back to default
BT: preventing of garbage appearance in objects during reinstall

(cherry picked from commit ad309c80d25ce1147eb0ff4c1ae7dc786246aad2)
BT: read metadata (bt/* files) through BusinessTemplateArchive
BT: make genbt5list safer for reuse in another process

- stop using chdir
- make logging to stdout/stderr optional
- generateInformation: return a StringIO instead of writing to a temporary file
BT: let BusinessTemplateFolder walk inside directory tree recursively
TemplateTool: Do not change the resolved depends list when installing bt5s with depends.

Considering erp5_configurator_ung depending on erp5_configurator which in turn
depends on erp5_workflow, if erp5_workflow and erp5_configurator_ung are
specifically added to the list of bt5 installed with depends, then erp5_workflow
ended up being installed *after* erp5_configurator.

(cherry picked from commit 0101c3a017499e77b1934c72cdafd4ab43cfaf71)
Add test to simulate the issue with the method TemplateTool.installBusinessTemplateListFromRepository

Using the method try to install Business Templates that are already
installed, the Business Templates is uploaded on ERP5 but not used. It
creates a lot of garbage because in the end you have many bt5s not
installed.

(cherry picked from commit 28e0f0a2217c8bae26707453eb269ef73039a2f3)
BT: don't export 'revision' anymore

Because on DVCS with branches, history is not always linear, we must stop
using increasing integer for revisions because they cause too many conflicts
and a higher revision number does not necessarily means the a BT newer.
They're now a cryptographic hash of all the contents of the Business Template,
and they're computed automatically:
- by genbt5list
- at download
- at building (by default)
- at export
Remove all bt/revision files
Use default __hash__ method for ERP5 objects

If an object has no uid yet and has no acquisition context to the portal,
getUid() fails.

Default is derived from id(aq_base(ob)) which is even more efficient.

The method on XMLObject was also redundant because it inherited the same one
from Base.

(cherry picked from commit 347804af6ed8e114c6195cca128afea946240043)
BT: when downloading from VCS, add a history comment with revision information
Merge branch to remove 'bt/revision' files
erp5_mysql_innodb_catalog: Make movement deletion transactional in catalog.

Inventory API has minimal catalog table usage (join on uid  only), which
makes on-deletion catalog changes insufficient to make movements
disappear transactionally from Inventory API results.
As it may be expected that a set of movements deleted during a single
transaction are atomically removed from Inventory API results, also
change stock table.
fixup! erp5_mysql_innodb_catalog: Make movement deletion transactional in catalog.
genbt5list: prevent conflicts when several process calls genbt5list in parallel