Skip to content

Commit

Permalink
Merge pull request #473 from itpp-labs/16.0-odoomagic
Browse files Browse the repository at this point in the history
  • Loading branch information
itpp-bot authored May 9, 2024
2 parents 5a55a0a + cbd04b6 commit 558b53f
Show file tree
Hide file tree
Showing 32 changed files with 1,651 additions and 1,313 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exclude: |
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
/static/(src/)?lib/|
/lib/|
# Repos using Sphinx to generate docs don't need prettying
^docs/_templates/.*\.html$|
# You don't usually want a bot to modify your legal texts
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# generated from manifests external_dependencies
bravado_core
jsonschema<4
markdown
pyyaml
swagger_spec_validator
9 changes: 2 additions & 7 deletions sync/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,9 @@ Few more steps requires to use https connection (e.g. telegram api works with ht
Questions?
==========

To get an assistance on this module contact us by email :arrow_right: [email protected]
To get an assistance on this module contact us by email :arrow_right: [email protected]

Further information
===================

Odoo Apps Store: https://apps.odoo.com/apps/modules/14.0/sync/


Notifications on updates: `via Atom <https://github.com/itpp-labs/sync-addons/commits/15.0/sync.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/itpp-labs/sync-addons/commits/15.0/sync.atom>`_

Tested on `Odoo 15.0 <https://github.com/odoo/odoo/commit/77e62b56ce57edf621e4c7ed42d6b53a98fc044f>`_
Tested on `Odoo 16.0 <https://github.com/odoo/odoo/commit/6565502494aa1c00104beb59698e359b8769553f>`__
1 change: 0 additions & 1 deletion sync/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# License MIT (https://opensource.org/licenses/MIT).

from . import models
from . import wizard
from . import controllers
from . import lib
from . import tools
34 changes: 19 additions & 15 deletions sync/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# Copyright 2020-2021 Ivan Yelizariev <https://twitter.com/yelizariev>
# Copyright 2020-2021,2024 Ivan Yelizariev <https://twitter.com/yelizariev>
# Copyright 2020-2021 Denis Mudarisov <https://github.com/trojikman>
# Copyright 2021 Ilya Ilchenko <https://github.com/mentalko>
# License MIT (https://opensource.org/licenses/MIT).

{
"name": """Sync Studio""",
"summary": """Synchronize something with anything: SystemX↔Odoo, Odoo1↔Odoo2, SystemX↔SystemY. ETL/ESB tool similar to OCA/connector, but more flexible""",
"category": "Extra Tools",
"images": ["images/sync-studio.jpg"],
"version": "16.0.6.2.0",
"name": "Sync 🪬 Studio",
"summary": """Join the Amazing 😍 Community ⤵️""",
"category": "VooDoo ✨ Magic",
"version": "16.0.7.0.0",
"application": True,
"author": "IT Projects Labs, Ivan Yelizariev",
"support": "[email protected]",
"author": "Ivan Kropotkin",
"support": "[email protected]",
"website": "https://sync_studio.t.me/",
"license": "Other OSI approved licence", # MIT
"depends": ["base_automation", "mail", "queue_job"],
"external_dependencies": {"python": [], "bin": []},
"external_dependencies": {"python": ["markdown", "pyyaml"], "bin": []},
"data": [
"security/sync_groups.xml",
"security/ir.model.access.csv",
Expand All @@ -29,16 +28,21 @@
"views/sync_task_views.xml",
"views/sync_project_views.xml",
"views/sync_link_views.xml",
"wizard/sync_make_module_views.xml",
"data/queue_job_function_data.xml",
],
"assets": {
"web.assets_backend": [
"sync/static/src/scss/src.scss",
],
},
"demo": [
"data/sync_project_context_demo.xml",
"data/sync_project_telegram_demo.xml",
"data/sync_project_odoo2odoo_demo.xml",
"data/sync_project_trello_github_demo.xml",
"data/sync_project_unittest_demo.xml",
"data/sync_project_context_demo.xml",
# Obsolete
# "data/sync_project_context_demo.xml",
# "data/sync_project_telegram_demo.xml",
# "data/sync_project_odoo2odoo_demo.xml",
# "data/sync_project_trello_github_demo.xml",
# "data/sync_project_context_demo.xml",
],
"qweb": [],
"post_load": None,
Expand Down
4 changes: 2 additions & 2 deletions sync/data/sync_project_unittest_demo.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2020 Ivan Yelizariev <https://twitter.com/yelizariev>
<!-- Copyright 2020,2024 Ivan Yelizariev <https://twitter.com/yelizariev>
Copyright 2021 Denis Mudarisov <https://github.com/trojikman>
Copyright 2021 Ilya Ilchenko <https://github.com/mentalko>
License MIT (https://opensource.org/licenses/MIT). -->
Expand All @@ -20,7 +20,7 @@
<![CDATA[
def handle_db(records):
for r in records:
r.set_link(params.PARTNER_RELATION, r.id)
r.set_link(PARAMS.PARTNER_RELATION, r.id)
]]>
</field>
</record>
Expand Down
90 changes: 90 additions & 0 deletions sync/doc/MAGIC.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
This document describes `MAGIC.*` tools available on Project Code evaluation (core code, library code, task code)


Base
====

* ``MAGIC.env``: Odoo Environment
* ``MAGIC.log(message, level=MAGIC.LOG_INFO)``: logging function to record debug information

log levels:

* ``MAGIC.LOG_DEBUG``
* ``MAGIC.LOG_INFO``
* ``MAGIC.LOG_WARNING``
* ``MAGIC.LOG_ERROR``

* ``MAGIC.log_transmission(recipient_str, data_str)``: report on data transfer to external recipients

Links
=====

* ``MAGIC.get_link(...)``
* ``MAGIC.set_link(...)``

These methods are documented separetely in `<links.rst>`__.

Sync Helpers
============

* ``MAGIC.sync_odoo2x(...)``
* ``MAGIC.sync_x2odoo(...)``
* ``MAGIC.sync_external(...)``

These methods are documented separetely in `<sync.rst>`__.

Event
=====

* ``MAGIC.trigger_name``: available in tasks' code only
* ``MAGIC.user``: user related to the event, e.g. who clicked a button

Asynchronous work
=================

* ``MAGIC.add_job(func_name, **options)(*func_args, **func_kwargs)``: call a function asynchronously; options are similar to ``with_delay`` method of ``queue_job`` module:

* ``priority``: Priority of the job, 0 being the higher priority. Default is 10.
* ``eta``: Estimated Time of Arrival of the job. It will not be executed before this date/time.
* ``max_retries``: maximum number of retries before giving up and set the job
state to 'failed'. A value of 0 means infinite retries. Default is 5.
* ``description`` human description of the job. If None, description is
computed from the function doc or name
* ``identity_key`` key uniquely identifying the job, if specified and a job
with the same key has not yet been run, the new job will not be added.


Attachments
===========

* ``attachment._public_url()``: generates access url. Can be used to pass attachments to an external system as url, instead of direct uploading the content.

Libs
====

* ``MAGIC.json``
* ``MAGIC.time``
* ``MAGIC.datetime``
* ``MAGIC.dateutil``
* ``MAGIC.timezone``
* ``MAGIC.b64encode``
* ``MAGIC.b64decode``

Tools
=====

* ``MAGIC.url2base64``
* ``MAGIC.url2bin``
* ``MAGIC.get_lang(env, lang_code=False)``: returns `res.lang` record
* ``MAGIC.html2plaintext``
* ``MAGIC.type2str``: get type of the given object
* ``MAGIC.DEFAULT_SERVER_DATETIME_FORMAT``
* ``MAGIC.AttrDict``: Extended dictionary that allows for attribute-style access

Exceptions
==========

* ``MAGIC.UserError``
* ``MAGIC.ValidationError``
* ``MAGIC.RetryableJobError``: raise to restart job from beginning; e.g. in case of temporary errors like broken connection
* ``MAGIC.OSError``
5 changes: 5 additions & 0 deletions sync/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`7.0.0`
-------

- **New:** Dramatic improvement on Sync Studio API

`6.2.0`
-------

Expand Down
Loading

0 comments on commit 558b53f

Please sign in to comment.