Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving version v.23.08.03 #36

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7bcd720
Improving version v.23.08.03
Aug 14, 2023
609e140
Improving version v.23.08.03
Hussam-Suleiman Aug 14, 2023
2290fdc
Improving version v.23.08.03
Hussam-Suleiman Aug 14, 2023
43a008f
Improving version v.23.08.03
Hussam-Suleiman Aug 14, 2023
ff34af9
Improving version v.23.08.03
Hussam-Suleiman Aug 16, 2023
b37668a
Merge https://github.com/sunflowerit/waftlib/pull/38.
Hussam-Suleiman Sep 28, 2023
7ee8d83
Rename files.
Hussam-Suleiman Sep 28, 2023
3b82577
Rename files.
Hussam-Suleiman Sep 28, 2023
2c57d24
Rename files.
Hussam-Suleiman Sep 28, 2023
85378e6
Upgrade 'waft-update-depths'.
Hussam-Suleiman Sep 28, 2023
e5f3e88
Upgrade 'waft-update-depths'.
Hussam-Suleiman Sep 28, 2023
941c349
Upgrade 'waft-update-depths'.
Hussam-Suleiman Sep 28, 2023
23d3d44
Upgrade 'waft-update-depths'.
Hussam-Suleiman Sep 29, 2023
490006b
Upgrade 'waft-update-depths'.
Hussam-Suleiman Sep 30, 2023
4852121
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 7, 2023
34b73e3
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 7, 2023
e8a9cba
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 8, 2023
b96daad
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 10, 2023
248c82f
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 10, 2023
46371e2
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 11, 2023
e328e8e
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 11, 2023
3fa68a9
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 12, 2023
554b4a3
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 12, 2023
812edf2
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 16, 2023
550df00
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 17, 2023
c37b2c0
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 17, 2023
9f4f1b2
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 18, 2023
a3f2f5d
Improving version 'v.23.08.03'.
Hussam-Suleiman Oct 18, 2023
ca84930
Improving version 'v.23.08.03'.
Hussam-Suleiman Nov 17, 2023
895adb7
Improving version 'v.23.08.03'.
Hussam-Suleiman Nov 29, 2023
cfc55bd
Improving version 'v.23.08.03'.
Hussam-Suleiman Nov 29, 2023
d2a6971
Improving version 'v.23.08.03'.
Hussam-Suleiman Nov 29, 2023
a3a65b7
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 2, 2023
50c1e06
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 10, 2023
5071012
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 11, 2023
36d6d9b
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 27, 2023
f9409e8
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 28, 2023
9059a58
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 28, 2023
81e5841
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 30, 2023
e11a59d
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 30, 2023
223f20f
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 31, 2023
ac7f739
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 31, 2023
9f6a534
Improving version 'v.23.08.03'.
Hussam-Suleiman Dec 31, 2023
5b0c62d
Improving version 'v.23.08.03'.
Hussam-Suleiman Jan 1, 2024
a099367
Improving version 'v.23.08.03'.
Hussam-Suleiman Jan 2, 2024
c108d19
Improving version 'v.23.08.03'.
Hussam-Suleiman Jan 2, 2024
1d6fd71
Improving version 'v.23.08.03'.
Hussam-Suleiman Jan 2, 2024
74c3131
Update variables names.
Hussam-Suleiman Mar 23, 2024
b90f250
Rename 'I18N_OVERWRITE' to 'ODOO_I18N_OVERWRITE'.
Hussam-Suleiman Jul 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.vscode
**.pyc
*.pyc
*.pyo
.vscode
88 changes: 88 additions & 0 deletions .python-files/addons-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/usr/bin/env python
# Version: v.23.08.03
# -*- coding: utf-8 -*-

import __future__
import argparse
import ast
import sys
try:
from venvodoolib import *
except IOError:
print("( ERROR ) : Run 'addons-install' python script in '.venv' virtual environment.")
exit(1)

# Define CLI options
parser = ArgumentParser(description="Install addons in current environment")
parser.add_argument("action", choices=("init", "update", "list"), help="What to do with the matched addons.",)
parser.add_argument("-c", "--core", action="store_true", help="Use all Odoo core addons")
parser.add_argument("-d", "--dependencies", action="store_true", help="Use only dependencies of selected addons",)
parser.add_argument("-e", "--extra", action="store_true", help="Use all extra addons")
parser.add_argument("-f", "--fullpath", action="store_true", help="Print addon's full path, only useful with list mode",)
parser.add_argument("-i", "--installable", action="store_true", help="Include only installable addons")
parser.add_argument("-l", "--leftout", action="append", default=[], help="Addons to exclude always.")
parser.add_argument("-s", "--separator", type=str, default=",", help="String that separates addons only useful with list mode",)
parser.add_argument("-t", "--test", action="store_true", help="Run unit tests for these addons, usually combined with update",)
parser.add_argument("-w", "--with", action="append", dest="with_", default=[], help="Addons to include always.",)
parser.add_argument("-x", "--explicit", action="store_true", help="Fail if any addon is explicitly declared but not found",)

# Generate the matching addons set
command_arguments = parser.parse_args()
dependencies = {"base"}
addons_with = set(command_arguments.with_)
addons_left_out = set(command_arguments.leftout)
addons_set = set()

if addons_with & addons_left_out:
sys.exit("Cannot include and exclude the same addon!")
if command_arguments.dependencies and command_arguments.fullpath:
sys.exit("Unsupported combination of --dependencies and --fullpath")
try:
for addon_name, addons_repo_item_path in addons_config(strict_running=command_arguments.explicit):
if addon_name in addons_left_out:
continue
core_ok = command_arguments.core and addons_repo_item_path == "odoo/addons"
extra_ok = command_arguments.extra and addons_repo_item_path not in {"odoo/addons"}
manual_ok = addon_name in addons_with
if core_ok or extra_ok or manual_ok:
addon_full_path = os.path.join(REPOSITORIES_DIRECTORY, addons_repo_item_path, addon_name)
manifest_code = {}
for manifest_name in ("__manifest__.py", "__openerp__.py"):
try:
manifest_path = os.path.join(addon_full_path, manifest_name)
with open(manifest_path, "r") as code:
manifest_code = ast.literal_eval(code.read())
break
except IOError:
continue
if command_arguments.installable and not manifest_code.get("installable", True):
continue
dependencies.update(manifest_code.get("depends", []))
if command_arguments.fullpath and command_arguments.action == "list":
addons_set.add(addon_full_path)
else:
addons_set.add(addon_name)
except AddonsConfigError as error:
sys.exit(error.message)

# Use dependencies instead, if requested
if command_arguments.dependencies:
addons_set = dependencies - addons_set
addons_set -= addons_left_out

# Do the required action
if not addons_set:
print("No addons found.", file=sys.stderr)
sys.exit("Error: Nothing to do.")
addons_sorted_set = command_arguments.separator.join(sorted(addons_set))

if command_arguments.action == "list":
print(addons_sorted_set)
else:
command = ["odoo", "--stop-after-init", "--{}".format(command_arguments.action), addons_sorted_set]
if command_arguments.test:
command += ["--test-enable", "--workers", "0"]
if os.environ.get("PGDATABASE"):
command += ["--db-filter", u"^{}$".format(os.environ.get("PGDATABASE"))]
logger.info("Executing %s", " ".join(command))
check_call(command)
21 changes: 13 additions & 8 deletions bin/translate-modules.py → .python-files/modules-translate
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Version: v.22.05.30
#!/usr/bin/env python
# Version: v.23.08.03
# -*- coding: utf-8 -*-
import os
import sys

import getopt
import polib
import shutil
import sys
import tempfile

try:
from venvodoolib import *
except IOError:
print("( ERROR ) : Run 'modules-translate' python script in '.venv' virtual environment.")
exit(1)

HELP_TEXT = """
This script will generate new .po files for certain modules, and certain
Expand All @@ -20,7 +25,7 @@
--database NAME
-d NAME Specifies the name of the database that the Odoo instance is
running on. This is optional, but if used, will override what's set
in .env-shared or .env-secret .
in config/env-shared or .env-secret .
--help
-h Show this help message.
--languages LANGS
Expand Down Expand Up @@ -202,7 +207,7 @@ def main():

if 'module-folder' in args and len(args['module-folder']) > 0:
addon_folder = args['module-folder']
addons = os.listdir(os.path.join(SRC_DIR, addon_folder))
addons = os.listdir(os.path.join(REPOSITORIES_DIRECTORY, addon_folder))
elif 'module' in args and len(args['module']) > 0:
addon_name = args['module']
addons = [addon_name]
Expand Down Expand Up @@ -230,11 +235,11 @@ def main():
# Initialize
# FIXME: Only works if odoo is actually placed in this directory
print("Loading exising Odoo translations...", file=sys.stderr)
compendium = load_compendium(os.path.join(ODOO_DIR), langs)
compendium = load_compendium(os.path.join(ODOO_MAIN_CODE_DIRECTORY), langs)

temp_file = tempfile.mkstemp(prefix='trans', suffix='.po')[1]
for module_name in addons:
module_path = os.path.join(ADDONS_DIR, module_name)
module_path = os.path.join(EVENTUAL_ADDONS_DIRECTORY, module_name)
upgrade_module_translations(module_name, module_path)


Expand Down
Loading