-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from acsone/imp-project-template
Project template improvements
- Loading branch information
Showing
40 changed files
with
262 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,9 @@ | ||
import os | ||
import shutil | ||
|
||
ODOO_PYTHON2 = ("8.0", "9.0", "10.0") | ||
ODOO_KEEP_INIT_PY = ODOO_PYTHON2 | ||
ODOO_LEGACY_NS = ("8.0", "9.0") | ||
|
||
|
||
def pre_render_project(configurator): | ||
variables = configurator.variables | ||
odoo_series = variables["odoo.series"] | ||
|
||
if odoo_series in ODOO_PYTHON2: | ||
python_version = "python" | ||
else: | ||
python_version = "python3" | ||
|
||
configurator.variables["python_version"] = python_version | ||
configurator.variables["odoo.major"] = int(odoo_series.split(".")[0]) | ||
|
||
|
||
def post_render_project(configurator): | ||
variables = configurator.variables | ||
root = configurator.target_directory | ||
root = os.path.join(root, variables["project.name"]) | ||
odoo_series = variables["odoo.series"] | ||
if odoo_series in ODOO_LEGACY_NS: | ||
shutil.rmtree(os.path.join(root, "odoo")) | ||
else: | ||
shutil.rmtree(os.path.join(root, "odoo_addons")) | ||
|
||
if odoo_series not in ODOO_KEEP_INIT_PY: | ||
# Delete init file | ||
filename = "__init__.py" | ||
os.remove(os.path.join(root, "odoo", filename)) | ||
os.remove(os.path.join(root, "odoo", "addons", filename)) | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
[run] | ||
omit= | ||
venv* | ||
src* | ||
source = | ||
./odoo/addons | ||
dynamic_context = test_function | ||
branch = True | ||
parallel = True | ||
|
||
[report] | ||
omit = | ||
*/scenarios/* | ||
*/lib/* | ||
*/__manifest__.py | ||
|
||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
pragma: no cover | ||
raise NotImplementedError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/src | ||
/release | ||
/release*/ | ||
/.project | ||
/.settings | ||
/.pydevproject | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.