From eb0fc79bb3bb72bc7ebd58ac79026def48a4e86b Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 25 Sep 2024 20:22:52 +0200 Subject: [PATCH 1/6] [IMP] OCB README --- README.md | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index a4744ae253c94..92c9eb5515d6f 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,7 @@ -[![Build Status](https://runbot.odoo.com/runbot/badge/flat/1/master.svg)](https://runbot.odoo.com/runbot) -[![Tech Doc](https://img.shields.io/badge/master-docs-875A7B.svg?style=flat&colorA=8F8F8F)](https://www.odoo.com/documentation/master) -[![Help](https://img.shields.io/badge/master-help-875A7B.svg?style=flat&colorA=8F8F8F)](https://www.odoo.com/forum/help-1) -[![Nightly Builds](https://img.shields.io/badge/master-nightly-875A7B.svg?style=flat&colorA=8F8F8F)](https://nightly.odoo.com/) +Odoo Community Backports (OCB) +------------------------------ -Odoo ----- +Please see what is OCB, its purpose and a FAQ at the [Wiki](https://github.com/OCA/OCB/wiki). -Odoo is a suite of web based open source business apps. +For the original Odoo README, please go to https://github.com/odoo/odoo/blob/18.0/README.md -The main Odoo Apps include an Open Source CRM, -Website Builder, -eCommerce, -Warehouse Management, -Project Management, -Billing & Accounting, -Point of Sale, -Human Resources, -Marketing, -Manufacturing, -... - -Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get -a full-featured Open Source ERP when you install several Apps. - -Getting started with Odoo -------------------------- - -For a standard installation please follow the Setup instructions -from the documentation. - -To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials From b297f6f0b71321901a61be2427db321bd453aa96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Fri, 16 Aug 2019 23:10:14 +0200 Subject: [PATCH 2/6] [ADD] setup: support PEP 660 and setuptools >= 64 Allow building a wheel or an sdist through the pep517 interface, taking care of the required pre-processing to copy addons in odoo/addons. Force the setuptools compat mode for editable installs. This mode is the simplest, since it just installs a .pth files which extends PYTHONPATH with the Odoo root directory. --- MANIFEST.in | 2 ++ pyproject.toml | 4 +++ setup/pep517_odoo.py | 65 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 pyproject.toml create mode 100644 setup/pep517_odoo.py diff --git a/MANIFEST.in b/MANIFEST.in index d1d9628c55b4f..f9ff8c6a9d35a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,8 @@ include requirements.txt include LICENSE include README.md +include pyproject.toml +include setup/pep517_odoo.py graft odoo recursive-exclude * *.py[co] recursive-exclude .git * diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000..228f3019ecc9c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,4 @@ +[build-system] +requires = ["setuptools>=41"] +build-backend = "pep517_odoo" +backend-path = ["setup"] diff --git a/setup/pep517_odoo.py b/setup/pep517_odoo.py new file mode 100644 index 0000000000000..bd93c9e238d3b --- /dev/null +++ b/setup/pep517_odoo.py @@ -0,0 +1,65 @@ +"""Specialized PEP 517 build backend for Odoo. + +It is based on setuptools, and extends it to + +- symlink all addons into odoo/addons before building, so setuptools discovers them + automatically, and +- enforce the 'compat' editable mode, because the default mode for flat layout + is not compatible with the Odoo addon import system. +""" +import contextlib +from pathlib import Path + +from setuptools import build_meta +from setuptools.build_meta import * # noqa: F403 + + +@contextlib.contextmanager +def _symlink_addons(): + symlinks = [] + try: + target_addons_path = Path("addons") + addons_path = Path("odoo", "addons") + link_target = Path("..", "..", "addons") + if target_addons_path.is_dir(): + for target_addon_path in target_addons_path.iterdir(): + if not target_addon_path.is_dir(): + continue + addon_path = addons_path / target_addon_path.name + if not addon_path.is_symlink(): + addon_path.symlink_to( + link_target / target_addon_path.name, target_is_directory=True + ) + symlinks.append(addon_path) + yield + finally: + for symlink in symlinks: + symlink.unlink() + + +def build_sdist(*args, **kwargs): + with _symlink_addons(): + return build_meta.build_sdist(*args, **kwargs) + + +def build_wheel(*args, **kwargs): + with _symlink_addons(): + return build_meta.build_wheel(*args, **kwargs) + + +if hasattr(build_meta, "build_editable"): + + def build_editable( + wheel_directory, config_settings=None, metadata_directory=None, **kwargs + ): + if config_settings is None: + config_settings = {} + # Use setuptools's compat editable mode, because the default mode for + # flat layout projects is not compatible with pkgutil.extend_path, + # and the strict mode is too strict for the Odoo development workflow + # where new files are added frequently. This is currently being discussed + # by the setuptools maintainers. + config_settings["editable-mode"] = "compat" + return build_meta.build_editable( + wheel_directory, config_settings, metadata_directory, **kwargs + ) From 5dd4c51f8ae66da2256587a53a91be9749846538 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 9 Jul 2024 11:21:58 +0200 Subject: [PATCH 3/6] [IMP] *: disable auto-install Odoo chooses to auto-install some modules that are debatable, so here in OCB we can revert this decission and let the Odoo admin to decide about them: - account_qr_code_sepa: this is just some tooling with no UI, so only modules using this tooling should depend and install it. - base_install_request: Feature for asking to install a module that doesn't make too much sense to be auto-installed in on premise maintained installations for avoiding false expectations. - iap: Odoo in-app purchases services should be optional, and more having a lot of dependant modules also being auto-installed (sms, snailmail, partner_autocomplete...). This way, we stop the chain from the beginning. - l10n_es_edi_facturae: Not everyone in Spain requires Facturae, and even if so, the OCA implementation is more suitable. - l10n_es_pos: The implementation of this need is faulty (creating one journal entry per PoS order), so the OCA one should be used instead. - mail_bot: It doesn't bring any real feature per se (only the annoying "Write an emoji" initial conversation). - pos_epson_printer: Not everyone using PoS has an Epson printer. - privacy_lookup: Privacy tool that not everyone uses. - sale_pdf_quote_builder: Optional feature. --- addons/account_qr_code_sepa/__manifest__.py | 2 +- addons/base_install_request/__manifest__.py | 2 +- addons/iap/__manifest__.py | 2 +- addons/l10n_es_edi_facturae/__manifest__.py | 2 +- addons/mail_bot/__manifest__.py | 2 +- addons/pos_epson_printer/__manifest__.py | 2 +- addons/privacy_lookup/__manifest__.py | 2 +- addons/sale_pdf_quote_builder/__manifest__.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/account_qr_code_sepa/__manifest__.py b/addons/account_qr_code_sepa/__manifest__.py index 7d229cf32d04c..85a6a817d7748 100644 --- a/addons/account_qr_code_sepa/__manifest__.py +++ b/addons/account_qr_code_sepa/__manifest__.py @@ -12,6 +12,6 @@ # any module necessary for this one to work correctly 'depends': ['account', 'base_iban'], - 'auto_install': True, + 'auto_install': False, 'license': 'LGPL-3', } diff --git a/addons/base_install_request/__manifest__.py b/addons/base_install_request/__manifest__.py index 89fa1dba16e49..48da847f9ec4a 100644 --- a/addons/base_install_request/__manifest__.py +++ b/addons/base_install_request/__manifest__.py @@ -9,7 +9,7 @@ Allow internal users requesting a module installation ===================================================== """, - 'auto_install': True, + 'auto_install': False, 'data':[ 'security/ir.model.access.csv', 'wizard/base_module_install_request_views.xml', diff --git a/addons/iap/__manifest__.py b/addons/iap/__manifest__.py index 893435895285c..f61a24148d371 100644 --- a/addons/iap/__manifest__.py +++ b/addons/iap/__manifest__.py @@ -20,7 +20,7 @@ 'views/iap_views.xml', 'views/res_config_settings.xml', ], - 'auto_install': True, + 'auto_install': False, 'assets': { 'web.assets_backend': [ 'iap/static/src/**/*.js', diff --git a/addons/l10n_es_edi_facturae/__manifest__.py b/addons/l10n_es_edi_facturae/__manifest__.py index fd5d9ec5e0bc8..dfc6f35f8db41 100644 --- a/addons/l10n_es_edi_facturae/__manifest__.py +++ b/addons/l10n_es_edi_facturae/__manifest__.py @@ -38,6 +38,6 @@ ], 'post_init_hook': '_l10n_es_edi_facturae_post_init_hook', 'installable': True, - 'auto_install': ['l10n_es'], + 'auto_install': False, 'license': 'LGPL-3', } diff --git a/addons/mail_bot/__manifest__.py b/addons/mail_bot/__manifest__.py index 9b30c984c0de3..d6105955303e8 100644 --- a/addons/mail_bot/__manifest__.py +++ b/addons/mail_bot/__manifest__.py @@ -8,7 +8,7 @@ 'summary': 'Add OdooBot in discussions', 'website': 'https://www.odoo.com/app/discuss', 'depends': ['mail'], - 'auto_install': True, + 'auto_install': False, 'installable': True, 'data': [ 'views/res_users_views.xml', diff --git a/addons/pos_epson_printer/__manifest__.py b/addons/pos_epson_printer/__manifest__.py index 58dc5464165ab..32ddac2d5a8e5 100644 --- a/addons/pos_epson_printer/__manifest__.py +++ b/addons/pos_epson_printer/__manifest__.py @@ -19,7 +19,7 @@ 'views/pos_printer_views.xml', ], 'installable': True, - 'auto_install': True, + 'auto_install': False, 'assets': { 'point_of_sale._assets_pos': [ 'pos_epson_printer/static/src/**/*', diff --git a/addons/privacy_lookup/__manifest__.py b/addons/privacy_lookup/__manifest__.py index 97aec4de4073b..d247f54afb8b6 100644 --- a/addons/privacy_lookup/__manifest__.py +++ b/addons/privacy_lookup/__manifest__.py @@ -12,6 +12,6 @@ 'security/ir.model.access.csv', 'data/ir_actions_server_data.xml', ], - 'auto_install': True, + 'auto_install': False, 'license': 'LGPL-3', } diff --git a/addons/sale_pdf_quote_builder/__manifest__.py b/addons/sale_pdf_quote_builder/__manifest__.py index b639e4bb54b48..4db4031499f5d 100644 --- a/addons/sale_pdf_quote_builder/__manifest__.py +++ b/addons/sale_pdf_quote_builder/__manifest__.py @@ -25,7 +25,7 @@ 'demo': [ 'data/sale_pdf_quote_builder_demo.xml', ], - 'auto_install': True, + 'auto_install': False, 'assets': { 'web.assets_backend': [ 'sale_pdf_quote_builder/static/src/js/**/*', From 5956fe7d8a3f017124b314e2318aa61e25c93b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <30716308+remi-filament@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:15:28 +0200 Subject: [PATCH 4/6] [IMP] google_gmail, web_unsplash: disable auto_install --- addons/google_gmail/__manifest__.py | 2 +- addons/web_unsplash/__manifest__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/google_gmail/__manifest__.py b/addons/google_gmail/__manifest__.py index 9e4a8fa6ea6ab..91ced8af2ee77 100644 --- a/addons/google_gmail/__manifest__.py +++ b/addons/google_gmail/__manifest__.py @@ -14,7 +14,7 @@ "views/ir_mail_server_views.xml", "views/res_config_settings_views.xml", ], - "auto_install": True, + "auto_install": False, "license": "LGPL-3", "assets": { "web.assets_backend": [ diff --git a/addons/web_unsplash/__manifest__.py b/addons/web_unsplash/__manifest__.py index 1dbcdd01392d6..d4a140202e79c 100644 --- a/addons/web_unsplash/__manifest__.py +++ b/addons/web_unsplash/__manifest__.py @@ -10,7 +10,7 @@ 'data': [ 'views/res_config_settings_view.xml', ], - 'auto_install': True, + 'auto_install': False, 'assets': { 'web.assets_frontend': [ 'web_unsplash/static/src/frontend/unsplash_beacon.js', From 9565358612d9d54d3e73372fb752936f8bddafb6 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 5 Aug 2025 18:27:12 +0200 Subject: [PATCH 5/6] [IMP] *: More auto-install disablings - account_edi_ubl_cii: As of now EDI export format is auto-selected depending on countries, it's useless as is in the countries where there's no EDI flavor pre-configured, so auto-installing has no sense. If you want some EDI export, then install and configure it. - base_import_module: Almost no one wants this useless feature... - iap_crm: It only makes sense if you install extra extensions like crm_iap_enrich, and that one already has this one as dependency. - sms/partner_autocomplete: If you need iap installed by other dependency, then auto-installing these other modules is not advisable. --- addons/account_edi_ubl_cii/__manifest__.py | 2 +- addons/base_import_module/__manifest__.py | 2 +- addons/iap_crm/__manifest__.py | 2 +- addons/partner_autocomplete/__manifest__.py | 2 +- addons/sms/__manifest__.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/account_edi_ubl_cii/__manifest__.py b/addons/account_edi_ubl_cii/__manifest__.py index b245861b34b7b..612085219b6d3 100644 --- a/addons/account_edi_ubl_cii/__manifest__.py +++ b/addons/account_edi_ubl_cii/__manifest__.py @@ -34,6 +34,6 @@ ], }, 'installable': True, - 'auto_install': True, + 'auto_install': False, 'license': 'LGPL-3', } diff --git a/addons/base_import_module/__manifest__.py b/addons/base_import_module/__manifest__.py index 16edaa165e206..db4f8720f058f 100644 --- a/addons/base_import_module/__manifest__.py +++ b/addons/base_import_module/__manifest__.py @@ -12,7 +12,7 @@ 'category': 'Hidden/Tools', 'depends': ['web'], 'installable': True, - 'auto_install': True, + 'auto_install': False, 'data': [ 'security/ir.model.access.csv', 'views/base_import_module_view.xml', diff --git a/addons/iap_crm/__manifest__.py b/addons/iap_crm/__manifest__.py index a01a436e11329..f5196cb0f1388 100644 --- a/addons/iap_crm/__manifest__.py +++ b/addons/iap_crm/__manifest__.py @@ -13,6 +13,6 @@ 'iap_mail', ], 'installable': True, - 'auto_install': True, + 'auto_install': False, 'license': 'LGPL-3', } diff --git a/addons/partner_autocomplete/__manifest__.py b/addons/partner_autocomplete/__manifest__.py index 5cd9af6efb01b..4724735744071 100644 --- a/addons/partner_autocomplete/__manifest__.py +++ b/addons/partner_autocomplete/__manifest__.py @@ -21,7 +21,7 @@ 'data/cron.xml', 'data/iap_service_data.xml', ], - 'auto_install': True, + 'auto_install': False, 'assets': { 'web.assets_backend': [ 'partner_autocomplete/static/src/scss/*', diff --git a/addons/sms/__manifest__.py b/addons/sms/__manifest__.py index f067ec6adb18d..e1ee824cfd894 100644 --- a/addons/sms/__manifest__.py +++ b/addons/sms/__manifest__.py @@ -43,7 +43,7 @@ 'data/mail_demo.xml', ], 'installable': True, - 'auto_install': True, + 'auto_install': False, 'assets': { 'web.assets_backend': [ 'sms/static/src/**/*', From 4301088bb35703958094feca87ac6d5741c63022 Mon Sep 17 00:00:00 2001 From: alexis-anthonissen Date: Wed, 11 Mar 2026 18:53:58 +0100 Subject: [PATCH 6/6] [REF] sale_pdf_quote_builder - add function _get_sale_pdfs --- addons/sale_pdf_quote_builder/models/ir_actions_report.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/sale_pdf_quote_builder/models/ir_actions_report.py b/addons/sale_pdf_quote_builder/models/ir_actions_report.py index 77178ded84532..20a3292aea48c 100644 --- a/addons/sale_pdf_quote_builder/models/ir_actions_report.py +++ b/addons/sale_pdf_quote_builder/models/ir_actions_report.py @@ -12,10 +12,13 @@ class IrActionsReport(models.Model): _inherit = 'ir.actions.report' + def _get_sale_pdfs(self): + return ['sale.report_saleorder'] + def _render_qweb_pdf_prepare_streams(self, report_ref, data, res_ids=None): """Override to add and fill headers, footers and product documents to the sale quotation.""" result = super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids) - if self._get_report(report_ref).report_name != 'sale.report_saleorder': + if self._get_report(report_ref).report_name not in self._get_sale_pdfs(): return result orders = self.env['sale.order'].browse(res_ids)