Move erp5_budget to portal_components
Move document classes and tests from products to portal_components.
In order to have git recognized this as a move, I used that procedure:
for each document, for example with Budget.py
:
- in portal_components, add a new Document Component with id
document.erp5.Budget
and referenceBudget
. Leave text content empty for now. - in portal_templates, from Document Classes tab of erp5_budget business template, add
document.erp5.Budget
- click on the Git tab, this will populate the working copy.
- from the command line, use
git mv
to move Budget.py from products to bt, something like:
git rm bt5/erp5_budget/DocumentTemplateItem/portal_components/document.erp5.Budget.py # remove the empty "placeholder" file
git mv product/ERP5/Budget.py bt5/erp5_budget/DocumentTemplateItem/portal_components/document.erp5.Budget.py # actual move
- ( at this point it is easier to make a commit that we'll squash together later)
- Fix import paths, for example
Products.ERP5.Document.Budget
becomeserp5.component.document.Budget
for tests:
- find out the test dependancies. In this case, it was all business templates defined in getBusinessTemplateList method of the test class and
erp5_full_text_myisam_catalog
that is a virtual dependancy and that we always have to specify. - list the test dependencies in Tests Dependencies from the business template View tab.
- move the test using same git mv trick. This time adding a Test Component named
test.erp5.testBudget
.
Running test as live test does not seem to work when running from the instance, but the test passes when running on test nodes ( test results are OK, the 2 failures are same on master)
I did just a little development on the migrated products, so there might be severe usability problems, but as far as I saw it seems working for me. Also, for the records, note that I have locally disabled pylint and use a hack to just use pyflakes.
At the same time, I am pushing a trivial commit 488f557c of a simple mistakes that integrated python code checker revealed.