Search 1.9 billion lines of Odoo code on GitHub

connector_channelengine

Author: ACSONE SA/NV, Odoo Community Association (OCA)
License: AGPL-3
Branch: 12.0-asw_master
Repository: acsone/connector-ecommerce
Dependencies: base_jsonify, base_partition, component, connector, product, product_brand, queue_job, server_environment, stock, and storage_image_product
Languages: HTML (484, 30.3%), Python (644, 40.3%), and XML (471, 29.5%)
Other branches: 12.0-channelengine-len

<h1 class="title">connector_channelengine</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/Acsone/connector-ecommerce/tree/12.0/connector_channelengine"><img alt="Acsone/connector-ecommerce" src="https://img.shields.io/badge/github-Acsone%2Fconnector--ecommerce-lightgray.png?logo=github" /></a></p> <p>This module provides a connector between ChannelEngine and Odoo.</p> <p>A ChannelEngine backend corresponds to an account, which is given by a host (the root url of the account, typically <cite>https://yourcompany.channelengine.net/api</cite>) and an api_key, obtained from that account. The latter needs to be set in an <cite>.env</cite> file.</p> <p>ChannelEngine lets the user uploads arbitrary fields to ChannelEngine, and configure in their web interface how these fields should be used. There is a number of standard fields (stock, price, description, ...) as well as any other field through extraData. These extra fields must be given with their type information in a subdictionary.</p> <p>To accommodate with these requirements without requiring custom fields or code, a backend has an &quot;export&quot; field, which allows to configure each field independently. The module comes with a default export configuration, which can entirely be customised. It relies on &quot;resolvers&quot;, objects to perform the needed transformations on each field. For instance the extraData dictionary transformation come with corresponding resolvers. For instance, <cite>standard_price</cite> is used for price, but any one of the hundreds of prices that are defined on products can be used instead. The same observation can be made for &quot;Stock&quot;, which by default is &quot;qty_available&quot;, but e.g. &quot;qty_available&quot; (forecasted quantity) could be used instead. The &quot;MerchantProductNo&quot; is essentially ChannelEngine's primary key for products. As such, care should be taken to make sure that there is no collision on the field which is exported as &quot;MerchantProductNo&quot;. By default this field is <cite>default_code</cite>.</p> <p>To be recognized as the &quot;Color&quot; ChannelEngine attribute, the attribute line should be named &quot;Color&quot; (not color, Colour, ...), same with Size. All other product attributes will be set in extraData as expected.</p> <p>To provide translations, it is possible to set export lines with a given lang (e.g. fr_FR), choose the corresponding field, e.g. description, and put it in extraData. A translation resolver is provided which will automatically postfix the field name with the export lang. An example is provided in the default export.</p> <p>ChannelEngine can export products to multiple backends; to make things simple, a channel tag is added on products so that they can be filtered easily.</p> <p>To decide which products to export, a backend comes with a domain; bindings are automatically created and removed when a product respectively falls in or out of the domain. This is checked every time a product is created or modified. However if the domain depends on properties that are not directly on the product (e.g. depends on an attribute of the product category) then this check will not be automatically performed (and there is no way to make this possible). In this case it is still possible to force to check existing products, or even to create an automated action to handle such modifications, but this is the responsibility and care of the one designing the domain.</p> <a name="usage"></a> <h2>Usage</h2> <p>The main thing to configure as a user are the 4 ChannelEngine scheduled actions, for the checks on data, domain, update, and remove. Two things can be modified: each method accepts a limit argument which defaults to zero; if set, will process only by batches of at most that many records. The most tricky one is the remove cron, as it requires one API call per record; thus it is the most likely to cause rate limiting issues. Because of that, it is unadvised to set up products in a way that would frequently delete large volumes or products, since these calls could</p> <a name="monitoring"></a> <h2>Monitoring</h2> <p>The main view of the ChannelEngine app is on the bindings. A binding symbolises the export of the product to the backend. A binding as a state (new, todo, done, toremove), an exception state, a message, and a check. The check means that the product data may have changed. Thus we need to recompute its data before being able to export it. The bindings that are not in exception state &quot;OK&quot; should regularly be checked. An exception state &quot;warning&quot; is non-blocking, meaning the export could be performed, whereas &quot;exception&quot; means that the export failed entirely. In both cases, the message should provide an explanation on the root cause. When a binding is in state &quot;to remove&quot;, at the next deleter run the binding will be deleted.</p> <p>On product there is a similar check; when a product is updated, it should be checked whether a binding should be created or removed. Forcing these recomputes can be done from the backend view.</p> <a name="field-list"></a> <h2>Field list</h2> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field"><th class="field-name">MerchantProductNo:</th><td class="field-body"><p class="first">The product ID on ChannelEngine (SKU). Should be unique. Defaults to <cite>default_code</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">Name:</th><td class="field-body"><p class="first">The product name. Defaults to <cite>display_name</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">Description:</th><td class="field-body"><p class="first">The product description. Allows basic HTML. Defaults to <cite>description</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">Price:</th><td class="field-body"><p class="first">The price at which the product should be sold. Defaults to <cite>price</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">Stock:</th><td class="field-body"><p class="first">The product stock. Defaults to <cite>qty_available</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">Brand:</th><td class="field-body"><p class="first">The product brand. Defaults to <cite>product_brand_id.name</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">ImageUrl/ExtraImageUrl1/.../ExtraImageUrl9:</th><td class="field-body"><p class="first">Publicly accessible images for the product. Defaults to <cite>variant_image_ids/image_url</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">CategoryTrail:</th><td class="field-body"><p class="first">Essentially the product <cite>categ_id.complete_name</cite>. Defaults to <cite>category_trail</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">Size:</th><td class="field-body"><p class="first">The product size. Exported if the product has an attribute named <cite>Size</cite>, i.e. <cite>attribute_value_ids/attribute_id/name</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">Color:</th><td class="field-body"><p class="first">The product color. Exported if the product has an attribute named <cite>Color</cite>, i.e. <cite>attribute_value_ids/attribute_id/name</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">ExtraData:</th><td class="field-body"><p class="first">A list of ExtraData dictionaries. Each custom attribute, translations, go there. These can be of type NUMBER, TEXT, URL, or IMAGEURL. Resolvers are provided for each type.</p> </td> </tr> <tr class="field"><th class="field-name">Url:</th><td class="field-body"><p class="first">A publicly accessible URL for the product. Not exported by default.</p> </td> </tr> <tr class="field"><th class="field-name">Ean:</th><td class="field-body"><p class="first">The product EAN. Defaults to <cite>barcode</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">ManufacturerProductNumber:</th><td class="field-body"><p class="first">The product manufacturer catalogue identifier. Not exported by default.</p> </td> </tr> <tr class="field"><th class="field-name">MSRP:</th><td class="field-body"><p class="first">The product MSRP. Not exported by default.</p> </td> </tr> <tr class="field"><th class="field-name">PurchasePrice:</th><td class="field-body"><p class="first">The product purchase price. Defaults to <cite>standard_price</cite>.</p> </td> </tr> <tr class="field"><th class="field-name">ShippingCost:</th><td class="field-body"><p class="first">The shipping cost of the product. Not exported by default.</p> </td> </tr> <tr class="field"><th class="field-name">ShippingTime:</th><td class="field-body"><p class="first">A description for the expected product shipping delay. Not exported by default.</p> </td> </tr> <tr class="field"><th class="field-name">VatRateType:</th><td class="field-body"><dl class="first docutils"> <dt>One of the following four choices:</dt> <dd><p class="first last">&quot;STANDARD&quot;, &quot;REDUCED&quot;, &quot;SUPER_REDUCED&quot;, &quot;EXEMPT&quot;</p> </dd> </dl> <p class="last">Not exported by default.</p> </td> </tr> </tbody> </table> <a name="developer-section"></a> <h2>Developer Section</h2> <p>The main difficulty in this module comes from the fact that bindings (which symbolise the export to a ChannelEngine backend) should depend on a list of fields which is given by the backend's export. Therefore the dependency is given by a record, and not simply by the model. The two main problems are that at module install the corresponding table is expected to exist already (easily solved by a pre_init hook) and the second one is to ensure that any modification on the export changes the depends. This second point is managed by having a stored computed field depending on the export, which forces the setup of the binding model when it's recomputed. It is not expected that such a modification should happen often; business-wise, changing the export means a change in business process.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id2">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id3">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li> </ul> </li> </ul> </div> <a name="bug-tracker"></a> <h3><a class="toc-backref" href="#id1">Bug Tracker</a></h3> <p>Bugs are tracked on <a class="reference external" href="https://github.com/Acsone/connector-ecommerce/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed <a class="reference external" href="https://github.com/Acsone/connector-ecommerce/issues/new?body=module:%20connector_channelengine%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h3><a class="toc-backref" href="#id2">Credits</a></h3> <a name="authors"></a> <h4><a class="toc-backref" href="#id3">Authors</a></h4> <ul class="simple"> <li>ACSONE SA/NV</li> </ul> <a name="contributors"></a> <h4><a class="toc-backref" href="#id4">Contributors</a></h4> <ul class="simple"> <li>Nans Lefebvre &lt;<a class="reference external" href="mailto:nans.lefebvre&#64;acsone.eu">nans.lefebvre&#64;acsone.eu</a>&gt;</li> <li>Denis Roussel &lt;<a class="reference external" href="mailto:denis.roussel&#64;acsone.eu">denis.roussel&#64;acsone.eu</a>&gt;</li> </ul> <a name="maintainers"></a> <h4><a class="toc-backref" href="#id5">Maintainers</a></h4> <p>This module is part of the <a class="reference external" href="https://github.com/Acsone/connector-ecommerce/tree/12.0/connector_channelengine">Acsone/connector-ecommerce</a> project on GitHub.</p> <p>You are welcome to contribute.</p>