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/README.md b/README.md index ac3c04c8f4c53..92c9eb5515d6f 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,7 @@ -# Odoo +Odoo Community Backports (OCB) +------------------------------ -[![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/) +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](https://www.odoo.com/page/crm), -[Website Builder](https://www.odoo.com/app/website), -[eCommerce](https://www.odoo.com/app/ecommerce), -[Warehouse Management](https://www.odoo.com/app/inventory), -[Project Management](https://www.odoo.com/app/project), -[Billing & Accounting](https://www.odoo.com/app/accounting), -[Point of Sale](https://www.odoo.com/app/point-of-sale-shop), -[Human Resources](https://www.odoo.com/app/employees), -[Marketing](https://www.odoo.com/app/social-marketing), -[Manufacturing](https://www.odoo.com/app/manufacturing), -[...](https://www.odoo.com/) - -Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get -a full-featured [Open Source ERP](https://www.odoo.com) when you install several Apps. - -## Getting started with Odoo - -For a standard installation please follow the [Setup instructions](https://www.odoo.com/documentation/master/administration/install/install.html) -from the documentation. - -To learn the software, we recommend the [Odoo eLearning](https://www.odoo.com/slides), -or [Scale-up, the business game](https://www.odoo.com/page/scale-up-business-game). -Developers can start with [the developer tutorials](https://www.odoo.com/documentation/master/developer/howtos.html). - -## Security - -If you believe you have found a security issue, check our [Responsible Disclosure page](https://www.odoo.com/security-report) -for details and get in touch with us via email. 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/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_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/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/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/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/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/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/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/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/**/*', 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) 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/**/*', 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', 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 + )