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

Module bundles #211

Merged
merged 57 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
0a68c65
[REM] Deprecated install modules
tarteo Oct 23, 2024
bc5e7b3
[REM] base_onboarding, make it easier extendable
tarteo Oct 23, 2024
f2c530c
[REM] base_onboarding, make it easier extendable
tarteo Oct 23, 2024
c84b513
[REF] container_accessibility remove website dependency
tarteo Oct 23, 2024
588d274
[ADD] container_install (Essentials Installation)
tarteo Oct 23, 2024
15be64b
[ADD] website_install
tarteo Oct 23, 2024
0809e4e
[ADD] website_install
tarteo Oct 23, 2024
c062cd1
[ADD] hr_install
tarteo Oct 23, 2024
bdc4189
[REM] application key from install module manifests
tarteo Oct 23, 2024
ebd763b
[ADD] container_install add product_category_product_link
tarteo Oct 23, 2024
3d675d7
[ADD] membership_install
tarteo Oct 23, 2024
1ce8192
[ADD] account_install
tarteo Oct 23, 2024
f34441e
[WIP] install modules in onboarding wizard
tarteo Oct 23, 2024
0349b2f
[WIP] install modules in onboarding wizard
tarteo Oct 23, 2024
93bd075
[ADD] base_purge_dependency
tarteo Oct 24, 2024
3dff4b5
[ADD] base_purge_dependency
tarteo Oct 24, 2024
8f410a6
[ADD] base_purge_dependency
tarteo Oct 24, 2024
bc91c04
[ADD] stock_install
tarteo Oct 24, 2024
46a0bc5
[ADD] websit_sale_install
tarteo Oct 24, 2024
9999629
[ADD] crm_install, mass_mailing_install, project_install
tarteo Oct 24, 2024
1443773
[ADD] crm_install, mass_mailing_install, project_install
tarteo Oct 24, 2024
eb2efab
[IMP] Better summaries for install modules
tarteo Oct 24, 2024
757e70a
[FIX] Remove container_install from membership_install
tarteo Oct 24, 2024
60cf0bc
[ADD] event_install
tarteo Oct 24, 2024
bad5ac5
[ADD] website_event_install
tarteo Oct 24, 2024
70fa3bd
Reopen self after installation / uninstallation of install module
tarteo Oct 25, 2024
fe67b50
[ADD] Add apps menu for restricted users
tarteo Oct 25, 2024
af92081
[REF] purge modules > to bundles
tarteo Oct 25, 2024
8a42220
[ADD] sale_install
tarteo Oct 25, 2024
2974c60
[REF] Changed apply_modules.py script to look at installed bundles
tarteo Oct 25, 2024
f4dc4cf
[REF] Changed apply_modules.py script to look at installed bundles
tarteo Oct 25, 2024
e801c33
[IMP] Uninstall wizard for bundle modules
tarteo Nov 6, 2024
d470b0d
[IMP] Uninstall wizard for bundle modules
tarteo Nov 7, 2024
3a64bc6
[FIX] Backwards compatibility
tarteo Nov 7, 2024
c1ee493
[FIX] hr_accessibility manifest and add it to hr_install
tarteo Nov 7, 2024
6b048c8
[FIX] hr_accessibility manifest and add it to hr_install
tarteo Nov 7, 2024
9102a48
[FIX] Add sale_install to apps action
tarteo Nov 7, 2024
2059abc
[UPD] package.txt
tarteo Nov 7, 2024
4939e45
[UPD] package.txt
tarteo Nov 7, 2024
17ff10b
[ADD] helpdesk_install
tarteo Nov 13, 2024
4f494cc
Add project_scrum to project bundle
tarteo Nov 14, 2024
43f36fb
Merge branch '16.0' into 16.0-revised-install-modules
tarteo Nov 20, 2024
32d838f
[IMP] apply_modules.py: Check if base_module_bundle is instlaled
tarteo Nov 20, 2024
b53a1ba
[IMP] Add mail_debrand to container_install
tarteo Nov 20, 2024
d42d171
[IMP] Add mass_mailing_partner to mass_mailing_install
tarteo Nov 20, 2024
6f15d03
[IMP] Add project_merge, project_task_link, project_task_default_stag…
tarteo Nov 20, 2024
e8588ef
[IMP] Add refactored membership modules to membership_install
tarteo Nov 20, 2024
9adfd07
[ADD] website_membership_install and membership_development_install b…
tarteo Nov 20, 2024
33389ad
[REM] prepare_install_request_mail.py not needed anymore
tarteo Nov 20, 2024
3d72c1c
[FIX] Make membership_accessibility installable
tarteo Nov 21, 2024
86547fa
Merge branch '16.0' into 16.0-revised-install-modules
tarteo Nov 21, 2024
ccf325d
Merge branch '16.0' into 16.0-revised-install-modules
tarteo Nov 26, 2024
512994f
Remove container_install from container_basis_install
tarteo Nov 26, 2024
aa66fbd
Disable uninstallation
tarteo Nov 26, 2024
536e80d
[FIX] Add project_scrum to package
tarteo Nov 26, 2024
764dc68
[FIX] website_membership_install missing comma in depends
tarteo Nov 26, 2024
38155c4
[ADD] mass_mailing_custom_unsubscribe and mail_partner_opt_out to mas…
tarteo Nov 27, 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
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@
exclude: |
(?x)
# NOT INSTALLABLE ADDONS
^accountancy_install/|
^base_mail_security/|
^base_partner_security/|
^base_user_limit/|
^community_org_install/|
^container_hr_recruitment/|
^container_install_standard/|
^project_org_install/|
^services_org_install/|
^trade_org_install/|
^university_org_install/|
# END NOT INSTALLABLE ADDONS
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
Expand Down
File renamed without changes.
58 changes: 58 additions & 0 deletions account_install/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "Accounting",
"summary": "Invoices, Contracts & Payments",
"author": "Onestein",
"category": "Accounting",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"depends": [
"account",
"account_payment_mode",
"account_payment_order",
"account_payment_partner",
"account_fiscal_position_vat_check",
"account_invoice_constraint_chronology",
"account_invoice_line_default_account",
"account_journal_lock_date",
"account_lock_date_update",
"account_move_print",
"account_usability",
"base_vat_optional_vies",
"account_reconcile_oca",
"account_statement_base",
"account_payment_sale",
"product_margin",
"account_financial_report",
"product_category_product_link",
"account_statement_import_camt",
"account_statement_import_camt54",
"account_statement_import_file_reconcile_oca",
"account_period_auto_create",
"account_statement_import_online_ponto",
"account_statement_import_online_ponto_statement_creation_mode",
"account_statement_import_sheet_file",
"account_statement_import_sheet_file_sheet_mappings",
"account_move_line_attachment_preview",
"account_configuration",
"account_invoice_overdue_reminder",
"account_move_line_tax_editable",
"account_move_tier_validation",
"account_statement_import_online_paypal",
"contract",
"contract_payment_mode",
"currency_rate_update",
"l10n_nl_rgs",
"l10n_nl_rgs_usability",
"l10n_nl_rgs_mis_report",
"l10n_nl_rgs_account_financial_report",
"l10n_nl_rgs_asset",
"l10n_nl_bank",
"l10n_nl_xaf_auditfile_export",
"l10n_nl_tax_statement",
"l10n_nl_tax_statement_date_range",
"l10n_nl_tax_statement_icp",
"mollie_account_sync",
"payment_mollie_official",
],
"bundle": True,
}
Binary file added account_install/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 0 additions & 97 deletions accountancy_install/__manifest__.py

This file was deleted.

2 changes: 2 additions & 0 deletions base_module_bundle/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
10 changes: 10 additions & 0 deletions base_module_bundle/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Module Bundles",
"category": "Technical",
"version": "16.0.1.0.0",
"author": "Onestein",
"website": "https://onestein.nl",
"depends": ["base_setup"],
"data": [],
"license": "LGPL-3",
}
1 change: 1 addition & 0 deletions base_module_bundle/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import ir_module_module
44 changes: 44 additions & 0 deletions base_module_bundle/models/ir_module_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from odoo import conf, fields, models


class IrModuleModule(models.Model):
_inherit = "ir.module.module"

is_bundle = fields.Boolean(
help="A bundle purges dependencies on uninstallation of this module",
compute="_compute_is_bundle",
) # Can't be stored

def _compute_is_bundle(self):
for module in self:
module_info = self.get_module_info(module.name)
module.is_bundle = module_info.get("bundle", False)

def _get_modules_to_uninstall_for_bundle(self):
self.ensure_one()
other_installed_bundle_modules = self.search(
[("state", "=", "installed"), ("id", "!=", self.id)]
).filtered(lambda m: m.is_bundle)
modules_to_keep = self.search([("name", "in", conf.server_wide_modules)])
modules_to_keep += other_installed_bundle_modules.upstream_dependencies(
exclude_states=("uninstalled",)
)
modules_to_keep = set(modules_to_keep)
modules_to_remove = self.upstream_dependencies(exclude_states=("uninstalled",))
modules_to_remove = modules_to_remove.filtered(
lambda d: d not in modules_to_keep
)
return modules_to_remove

def button_uninstall(self):
"""
Uninstall upstream modules but only if they're not in another bundle modules dependency.
This will not be invoked if a dependency of a bundle is uninstalled, only when a bundle is directly uninstalled
"""
modules = self.search([("state", "=", "installed")])
bundle_modules = modules.filtered(lambda m: m.is_bundle)
for to_uninstall in self.filtered(lambda m: m in bundle_modules):
modules_to_remove = to_uninstall._get_modules_to_uninstall_for_bundle()
modules_to_remove.write({"state": "to remove"})

return super().button_uninstall()
1 change: 1 addition & 0 deletions base_module_bundle/wizards/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import base_module_uninstall
16 changes: 16 additions & 0 deletions base_module_bundle/wizards/base_module_uninstall.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from odoo import api, models


class ModuleUninstall(models.TransientModel):
_inherit = "base.module.uninstall"

def _get_modules(self):
modules = super()._get_modules()
if not self.module_id.is_bundle:
return modules
modules += self.module_id._get_modules_to_uninstall_for_bundle()
return modules

@api.depends("module_id.is_bundle")
def _compute_module_ids(self):
return super()._compute_module_ids()
4 changes: 2 additions & 2 deletions base_onboarding/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
{
"name": "Onboarding",
"author": "Onestein",
"website": "https://www.onestein.eu",
"website": "https://onestein.nl",
"category": "Extra Tools",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"depends": ["website", "multi_step_wizard", "web", "mail"],
"depends": ["multi_step_wizard", "web", "mail"],
"data": [
"security/res_groups.xml",
"security/ir.model.access.csv",
Expand Down
2 changes: 1 addition & 1 deletion base_onboarding/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from . import ir_module_module
from . import base_document_layout
from . import ir_module_module
32 changes: 10 additions & 22 deletions base_onboarding/models/ir_module_module.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
from odoo import api, models
from odoo import models


class IrModuleModule(models.Model):
_inherit = "ir.module.module"

@api.model
def _fields_view_get(
self, view_id=None, view_type="form", toolbar=False, submenu=False
):
if (
view_type == "kanban"
and self.env.context.get("active_model") == "base.onboarding.wizard"
):
view_id = self.env.ref("website.theme_view_kanban").id
return super()._fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu
)
def button_immediate_install(self):
res = super().button_immediate_install()
if self.env.context.get("onboarding_wizard", False):
return {"type": "ir.actions.act_url", "url": "/web", "target": "self"}
return res

def button_choose_theme(self):
res = super().button_choose_theme()
if self.env.context.get("active_model") == "base.onboarding.wizard":
wizard = self.env["base.onboarding.wizard"].search(
[("id", "=", self.env.context.get("active_id"))]
)
if wizard.state == "theme":
wizard.open_next()
res = wizard._reopen_self()
def button_immediate_uninstall(self):
res = super().button_immediate_uninstall()
if self.env.context.get("onboarding_wizard", False):
return {"type": "ir.actions.act_url", "url": "/web", "target": "self"}
return res
Loading
Loading