|
| 1 | +========== |
| 2 | +Components |
| 3 | +========== |
| 4 | + |
| 5 | +.. |
| 6 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 7 | + !! This file is generated by oca-gen-addon-readme !! |
| 8 | + !! changes will be overwritten. !! |
| 9 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 10 | + !! source digest: sha256:a17ffda475316eda129ff24559c5cd3822c3698fa06e1f22e4e64e400a446e2a |
| 11 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 12 | +
|
| 13 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png |
| 14 | + :target: https://odoo-community.org/page/development-status |
| 15 | + :alt: Production/Stable |
| 16 | +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png |
| 17 | + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html |
| 18 | + :alt: License: LGPL-3 |
| 19 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fconnector-lightgray.png?logo=github |
| 20 | + :target: https://github.com/OCA/connector/tree/18.0/component |
| 21 | + :alt: OCA/connector |
| 22 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 23 | + :target: https://translation.odoo-community.org/projects/connector-18-0/connector-18-0-component |
| 24 | + :alt: Translate me on Weblate |
| 25 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 26 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/connector&target_branch=18.0 |
| 27 | + :alt: Try me on Runboat |
| 28 | + |
| 29 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 30 | + |
| 31 | +This module implements a component system and is a base block for the |
| 32 | +Connector Framework. It can be used without using the full Connector |
| 33 | +though. |
| 34 | + |
| 35 | +Documentation: http://odoo-connector.com/ |
| 36 | + |
| 37 | +You may also want to check the `Introduction to Odoo |
| 38 | +Components <https://dev.to/guewen/introduction-to-odoo-components-bn0>`__ |
| 39 | +by @guewen. |
| 40 | + |
| 41 | +**Table of contents** |
| 42 | + |
| 43 | +.. contents:: |
| 44 | + :local: |
| 45 | + |
| 46 | +Usage |
| 47 | +===== |
| 48 | + |
| 49 | +As a developer, you have access to a component system. You can find the |
| 50 | +documentation in the code or on http://odoo-connector.com |
| 51 | + |
| 52 | +In a nutshell, you can create components: |
| 53 | + |
| 54 | +:: |
| 55 | + |
| 56 | + from odoo.addons.component.core import Component |
| 57 | + |
| 58 | + class MagentoPartnerAdapter(Component): |
| 59 | + _name = 'magento.partner.adapter' |
| 60 | + _inherit = 'magento.adapter' |
| 61 | + |
| 62 | + _usage = 'backend.adapter' |
| 63 | + _collection = 'magento.backend' |
| 64 | + _apply_on = ['res.partner'] |
| 65 | + |
| 66 | +And later, find the component you need at runtime (dynamic dispatch at |
| 67 | +component level): |
| 68 | + |
| 69 | +:: |
| 70 | + |
| 71 | + def run(self, external_id): |
| 72 | + backend_adapter = self.component(usage='backend.adapter') |
| 73 | + external_data = backend_adapter.read(external_id) |
| 74 | + |
| 75 | +In order for tests using components to work, you will need to use the |
| 76 | +base class provided by \`odoo.addons.component.tests.common\`: |
| 77 | + |
| 78 | +- TransactionComponentCase |
| 79 | + |
| 80 | +There are also some specific base classes for testing the component |
| 81 | +registry, using the ComponentRegistryCase as a base class. See the |
| 82 | +docstrings in tests/common.py. |
| 83 | + |
| 84 | +Changelog |
| 85 | +========= |
| 86 | + |
| 87 | +16.0.1.0.0 (2022-10-04) |
| 88 | +----------------------- |
| 89 | + |
| 90 | +- [MIGRATION] from 15.0 |
| 91 | + |
| 92 | +15.0.1.0.0 (2021-11-25) |
| 93 | +----------------------- |
| 94 | + |
| 95 | +- [MIGRATION] from 14.0 |
| 96 | + |
| 97 | +14.0.1.0.0 (2020-10-22) |
| 98 | +----------------------- |
| 99 | + |
| 100 | +- [MIGRATION] from 13.0 |
| 101 | + |
| 102 | +13.0.1.0.0 (2019-10-23) |
| 103 | +----------------------- |
| 104 | + |
| 105 | +- [MIGRATION] from 12.0 |
| 106 | + |
| 107 | +12.0.1.0.0 (2018-10-02) |
| 108 | +----------------------- |
| 109 | + |
| 110 | +- [MIGRATION] from 11.0 branched at rev. 324e006 |
| 111 | + |
| 112 | +Bug Tracker |
| 113 | +=========== |
| 114 | + |
| 115 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/connector/issues>`_. |
| 116 | +In case of trouble, please check there if your issue has already been reported. |
| 117 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 118 | +`feedback <https://github.com/OCA/connector/issues/new?body=module:%20component%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
| 119 | + |
| 120 | +Do not contact contributors directly about support or help with technical issues. |
| 121 | + |
| 122 | +Credits |
| 123 | +======= |
| 124 | + |
| 125 | +Authors |
| 126 | +------- |
| 127 | + |
| 128 | +* Camptocamp |
| 129 | + |
| 130 | +Contributors |
| 131 | +------------ |
| 132 | + |
| 133 | +- Guewen Baconnier <guewen.baconnier@camptocamp.com> |
| 134 | +- Laurent Mignon <laurent.mignon@acsone.eu> |
| 135 | +- Simone Orsi <simone.orsi@camptocamp.com> |
| 136 | +- Thien Vo <thienvh@trobz.com> |
| 137 | + |
| 138 | +Other credits |
| 139 | +------------- |
| 140 | + |
| 141 | +The migration of this module from 17.0 to 18.0 was financially supported |
| 142 | +by Camptocamp. |
| 143 | + |
| 144 | +Maintainers |
| 145 | +----------- |
| 146 | + |
| 147 | +This module is maintained by the OCA. |
| 148 | + |
| 149 | +.. image:: https://odoo-community.org/logo.png |
| 150 | + :alt: Odoo Community Association |
| 151 | + :target: https://odoo-community.org |
| 152 | + |
| 153 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 154 | +mission is to support the collaborative development of Odoo features and |
| 155 | +promote its widespread use. |
| 156 | + |
| 157 | +.. |maintainer-guewen| image:: https://github.com/guewen.png?size=40px |
| 158 | + :target: https://github.com/guewen |
| 159 | + :alt: guewen |
| 160 | + |
| 161 | +Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: |
| 162 | + |
| 163 | +|maintainer-guewen| |
| 164 | + |
| 165 | +This module is part of the `OCA/connector <https://github.com/OCA/connector/tree/18.0/component>`_ project on GitHub. |
| 166 | + |
| 167 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments