refactor: improve command list formatting and update utility submodule
Some checks are pending
Setup Native Action / native (3.12.7) (push) Waiting to run
Setup Native Action / docker (3.12.7) (push) Waiting to run

This commit is contained in:
KaySar12 2025-06-05 09:41:05 +07:00
parent 128d046333
commit 731b059cc3
4 changed files with 28 additions and 315 deletions

@ -1 +1 @@
Subproject commit e63b12c8e8601fc29ccc3463175d6009c22949b9
Subproject commit f64c12f62d25aae7e4389e193c56cd898b624928

View File

@ -1,300 +0,0 @@
branches:
hoang_dev:
modules:
- data_merge_helpdesk
- hr_appraisal_survey
- helpdesk_repair
- account_inter_company_rules
- project_sale_subscription
- account_intrastat
- hr_appraisal_skills
- website_helpdesk_forum
- website_helpdesk_slides_forum
- advanced_web_domain_widget
- account_bank_statement_extract
- planning_holidays
- marketing_automation_sms
- website_studio
- marketing_automation_whatsapp
- simplify_access_management
- micro_saas
- account_disallowed_expenses_fleet
- test_web_studio
- account_sepa_direct_debit
- mail_enterprise
- account_avatax_geolocalize
- project_holidays
- multi_level_approval_configuration
- account_base_import
- website_appointment
- account_bank_statement_import_ofx
- account_accountant_fleet
- hr_budget
- project_mrp_workorder_account
- marketing_automation_website_sale
- helpdesk_fsm_report
- website_event_track_gantt
- account_budget
- website_sale_subscription
- website_knowledge
- account_avatax_stock
- marketing_automation_crm
- spreadsheet_dashboard_helpdesk
- helpdesk_fsm
- website_product_barcodelookup
- mass_mailing_sale_subscription
- account_loans
- project_timesheet_forecast
- account_iso20022
- website_helpdesk_slides
- hr_appraisal_promotion
- account_saft_import
- account_accountant_check_printing
- contact_generate_code
- website_generator
- website_helpdesk_livechat
- web_gantt
- account_external_tax
- helpdesk_holidays
- planning
- account_online_synchronization
- account_bank_statement_import_csv
- helpdesk_timesheet
- account_bank_statement_import_camt
- account_followup
- company_list_view
- test_timer
- account_online_payment
- account_batch_payment
- project_helpdesk
- account_invoice_extract
- web_map
- web_enterprise
- project_enterprise
- account_avatax_sale
- website_delivery_sendcloud
- project_account_asset
- dynamic_docx_pdf_reports_omax
- website_appointment_account_payment
- helpdesk_sale_loyalty
- website_documents
- project_enterprise_hr_skills
- web_studio
- account_asset_fleet
- hr_holidays_gantt
- website_event_social
- web_mobile
- accountant
- approvals_purchase_stock
- website_helpdesk_sale_loyalty
- account_3way_match
- helpdesk_sale_timesheet
- website_helpdesk_knowledge
- helpdesk_mail_plugin
- planning_hr_skills
- website_event_track_social
- hr_appraisal_contract
- website_crm_iap_reveal_enterprise
- helpdesk
- project_enterprise_hr_contract
- website_generator_sale
- marketing_automation
- approvals
- pip_installer
- helpdesk_stock_account
- account_saft
- bhs_password_policy
- hr_employee_promotion
- website_sale_ups
- web_cohort
- account_reports_cash_basis
- website_enterprise
- website_appointment_sale_project
- website_sale_shiprocket
- website_sale_external_tax
- planning_contract
- website_sale_fedex
- approvals_purchase
- multi_level_approval
- account_auto_transfer
- project_timesheet_forecast_sale
- helpdesk_sale
- timer
- website_appointment_crm
- hr_appraisal
- project_account_budget
- website_sale_dashboard
- account_invoice_extract_purchase
- hr_gantt
- web_grid
- account_accountant
- helpdesk_account
- project_forecast
- website_sale_renting
- account_accountant_batch_payment
- account_asset
- account_extract
- report_pdf_options
- helpdesk_stock
- project_hr_payroll_account
- website_helpdesk
- helpdesk_sms
- room
- helpdesk_fsm_sale
- account_winbooks_import
- website_appointment_sale
- account_reports
- crm_helpdesk
- hr_holidays_contract_gantt
- account_bank_statement_import_qif
- account_bank_statement_import
- website_sale_stock_renting
- timesheet_grid
- project_enterprise_hr
- account_disallowed_expenses
- account_avatax
origin/community/demo/ftacpa:
modules:
- data_merge_helpdesk
- hr_appraisal_survey
- helpdesk_repair
- account_inter_company_rules
- project_sale_subscription
- account_intrastat
- hr_appraisal_skills
- website_helpdesk_forum
- website_helpdesk_slides_forum
- advanced_web_domain_widget
- account_bank_statement_extract
- planning_holidays
- marketing_automation_sms
- website_studio
- marketing_automation_whatsapp
- simplify_access_management
- account_disallowed_expenses_fleet
- test_web_studio
- account_sepa_direct_debit
- mail_enterprise
- account_avatax_geolocalize
- project_holidays
- multi_level_approval_configuration
- account_base_import
- website_appointment
- account_bank_statement_import_ofx
- account_accountant_fleet
- hr_budget
- project_mrp_workorder_account
- marketing_automation_website_sale
- helpdesk_fsm_report
- website_event_track_gantt
- account_budget
- website_sale_subscription
- website_knowledge
- account_avatax_stock
- marketing_automation_crm
- spreadsheet_dashboard_helpdesk
- helpdesk_fsm
- website_product_barcodelookup
- mass_mailing_sale_subscription
- account_loans
- project_timesheet_forecast
- account_iso20022
- website_helpdesk_slides
- hr_appraisal_promotion
- account_saft_import
- account_accountant_check_printing
- contact_generate_code
- website_generator
- website_helpdesk_livechat
- web_gantt
- account_external_tax
- helpdesk_holidays
- planning
- account_online_synchronization
- account_bank_statement_import_csv
- helpdesk_timesheet
- account_bank_statement_import_camt
- account_followup
- company_list_view
- account_online_payment
- account_batch_payment
- project_helpdesk
- account_invoice_extract
- web_map
- web_enterprise
- project_enterprise
- account_avatax_sale
- website_delivery_sendcloud
- project_account_asset
- dynamic_docx_pdf_reports_omax
- website_appointment_account_payment
- helpdesk_sale_loyalty
- website_documents
- project_enterprise_hr_skills
- web_studio
- account_asset_fleet
- website_event_social
- web_mobile
- accountant
- approvals_purchase_stock
- website_helpdesk_sale_loyalty
- account_3way_match
- helpdesk_sale_timesheet
- website_helpdesk_knowledge
- helpdesk_mail_plugin
- planning_hr_skills
- website_event_track_social
- hr_appraisal_contract
- website_crm_iap_reveal_enterprise
- helpdesk
- project_enterprise_hr_contract
- website_generator_sale
- marketing_automation
- approvals
- helpdesk_stock_account
- account_saft
- bhs_password_policy
- hr_employee_promotion
- website_sale_ups
- web_cohort
- account_reports_cash_basis
- website_enterprise
- website_appointment_sale_project
- website_sale_shiprocket
- website_sale_external_tax
- planning_contract
- website_sale_fedex
- approvals_purchase
- multi_level_approval
- account_auto_transfer
- project_timesheet_forecast_sale
- helpdesk_sale
- website_appointment_crm
- hr_appraisal
- project_account_budget
- website_sale_dashboard
- account_invoice_extract_purchase
- web_grid
- account_accountant
- helpdesk_account
- project_forecast
- website_sale_renting
- account_accountant_batch_payment
- account_asset
- account_extract
- helpdesk_stock
- project_hr_payroll_account
- website_helpdesk
- helpdesk_sms
- room
- helpdesk_fsm_sale
- account_winbooks_import
- website_appointment_sale
- account_reports
- crm_helpdesk
- account_bank_statement_import_qif
- account_bank_statement_import
- website_sale_stock_renting
- project_enterprise_hr
- account_disallowed_expenses
- account_avatax

View File

@ -8,8 +8,11 @@ import odoo
from odoo.modules import get_modules, get_module_path, initialize_sys_path
commands = {}
class Command:
name = None
def __init_subclass__(cls):
cls.name = cls.name or cls.__name__.lower()
commands[cls.name] = cls
@ -23,25 +26,35 @@ Available commands:
Use '{odoo_bin} <command> --help' for individual command help."""
class Help(Command):
""" Display the list of available commands """
"""Display the list of available commands"""
def run(self, args):
padding = max([len(cmd) for cmd in commands]) + 2
command_list = "\n ".join([
" {}{}".format(name.ljust(padding), (command.__doc__ or "").strip())
for name, command in sorted(commands.items())
])
print(ODOO_HELP.format( # pylint: disable=bad-builtin
odoo_bin=Path(sys.argv[0]).name,
command_list=command_list
))
command_list = "\n ".join(
[
" {}{}".format(name.ljust(padding), (command.__doc__ or "").strip())
for name, command in sorted(commands.items())
]
)
print(
ODOO_HELP.format( # pylint: disable=bad-builtin
odoo_bin=Path(sys.argv[0]).name, command_list=command_list
)
)
def main():
args = sys.argv[1:]
# The only shared option is '--addons-path=' needed to discover additional
# commands from modules
if len(args) > 1 and args[0].startswith('--addons-path=') and not args[1].startswith("-"):
if (
len(args) > 1
and args[0].startswith("--addons-path=")
and not args[1].startswith("-")
):
# parse only the addons-path, do not setup the logger...
odoo.tools.config._parse_config([args[0]])
args = args[1:]
@ -55,8 +68,8 @@ def main():
logging.disable(logging.CRITICAL)
initialize_sys_path()
for module in get_modules():
if (Path(get_module_path(module)) / 'cli').is_dir():
__import__('odoo.addons.' + module)
if (Path(get_module_path(module)) / "cli").is_dir():
__import__("odoo.addons." + module)
logging.disable(logging.NOTSET)
command = args[0]
args = args[1:]
@ -65,4 +78,4 @@ def main():
o = commands[command]()
o.run(args)
else:
sys.exit('Unknown command %r' % (command,))
sys.exit("Unknown command %r" % (command,))

@ -1 +1 @@
Subproject commit c251e22c8705196aae92b4a6a6440e478dc2e98f
Subproject commit 170feeb73e8eb721020008487cc5153f29b9fdb5