[FIX] installation keep repo when add project
This commit is contained in:
parent
498a5f5b94
commit
c88c580fb4
2 changed files with 25 additions and 4 deletions
|
|
@ -1,5 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<manifest>
|
||||
<remote name="ERPLibre" fetch="https://github.com/ERPLibre/" />
|
||||
<remote name="OCA" fetch="https://github.com/OCA/" />
|
||||
<remote name="itpp-labs" fetch="https://github.com/itpp-labs/" />
|
||||
|
||||
<project
|
||||
name="maintainer-tools.git"
|
||||
path="script/OCA_maintainer-tools"
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ DEFAULT_PATH_MANIFEST_PRIVATE_CONF = os.path.join(
|
|||
DEFAULT_PATH_INSTALLED_ODOO_VERSION = os.path.join(
|
||||
".repo", "installed_odoo_version.txt"
|
||||
)
|
||||
MOBILE_PATH = os.path.join("mobile", "erplibre_home_mobile")
|
||||
ODOO_VERSION_PATH = ".odoo-version"
|
||||
|
||||
|
||||
def get_config():
|
||||
|
|
@ -67,6 +69,11 @@ def get_config():
|
|||
action="store_true",
|
||||
help="Add mobile project manifest",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--with_new_manifest",
|
||||
action="store_true",
|
||||
help="Will overwrite local manifest",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
return args
|
||||
|
||||
|
|
@ -75,6 +82,18 @@ def main():
|
|||
config = get_config()
|
||||
git_tool = GitTool()
|
||||
|
||||
odoo_version = None
|
||||
if os.path.isfile(ODOO_VERSION_PATH):
|
||||
with open(ODOO_VERSION_PATH, "r") as f:
|
||||
odoo_version = f.readline()
|
||||
|
||||
# Add local manifest
|
||||
if not config.with_new_manifest:
|
||||
if odoo_version:
|
||||
config.with_OCA = True
|
||||
if os.path.isdir(MOBILE_PATH):
|
||||
config.with_mobile = True
|
||||
|
||||
input_paths = config.input
|
||||
if not input_paths:
|
||||
input_paths = []
|
||||
|
|
@ -83,8 +102,6 @@ def main():
|
|||
input_paths, DEFAULT_PATH_MANIFEST_ODOO_CONF
|
||||
)
|
||||
if os.path.exists(".odoo-version"):
|
||||
with open(".odoo-version", "r") as f:
|
||||
odoo_version = f.readline()
|
||||
if odoo_version:
|
||||
path_manifest_odoo_version = os.path.join(
|
||||
"manifest", f"git_manifest_odoo{odoo_version}.xml"
|
||||
|
|
@ -123,11 +140,11 @@ def main():
|
|||
if os.path.exists(path_manifest_odoo_version):
|
||||
input_paths.append(path_manifest_odoo_version)
|
||||
|
||||
elif config.with_mobile:
|
||||
if config.with_mobile:
|
||||
append_file_path_manifest(
|
||||
input_paths, DEFAULT_PATH_MANIFEST_MOBILE_CONF
|
||||
)
|
||||
else:
|
||||
if not config.with_mobile or not config.with_OCA:
|
||||
append_file_path_manifest(input_paths, DEFAULT_PATH_MANIFEST_CONF)
|
||||
append_file_path_manifest(
|
||||
input_paths, DEFAULT_PATH_MANIFEST_PRIVATE_CONF
|
||||
|
|
|
|||
Loading…
Reference in a new issue