Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0][BKP] edi_webservice #1070

Open
wants to merge 15 commits into
base: 12.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions edi_webservice/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
==============
Edi WebService
==============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5c5d9632de1c9ab479b27c83367b2430f90bffc72a7ef196f6b0286c7ae59d2d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi-lightgray.png?logo=github
:target: https://github.com/OCA/edi/tree/13.0/edi_webservice
:alt: OCA/edi
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/edi-13-0/edi-13-0-edi_webservice
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/edi&target_branch=13.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module creates WebService frameworks to be used on EDI

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/edi/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/edi/issues/new?body=module:%20edi_webservice%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Creu Blanca

Contributors
~~~~~~~~~~~~

* Enric Tobella <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/edi <https://github.com/OCA/edi/tree/13.0/edi_webservice>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions edi_webservice/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions edi_webservice/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Edi WebService",
"summary": """
Defines webservice integration from EDI Exchange records""",
"version": "12.0.1.0.0",
"license": "AGPL-3",
"development_status": "Beta",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/edi",
"depends": ["edi_oca", "webservice"],
"data": ["views/edi_backend.xml", "security/ir.model.access.csv"],
}
29 changes: 29 additions & 0 deletions edi_webservice/i18n/edi_webservice.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * edi_webservice
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: edi_webservice
#: model:ir.model,name:edi_webservice.model_edi_backend
msgid "EDI Backend"
msgstr ""

#. module: edi_webservice
#: model_terms:ir.ui.view,arch_db:edi_webservice.edi_backend_view_form
msgid "Webservice"
msgstr ""

#. module: edi_webservice
#: model:ir.model.fields,field_description:edi_webservice.field_edi_backend__webservice_backend_id
msgid "Webservice Backend"
msgstr ""
1 change: 1 addition & 0 deletions edi_webservice/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import edi_backend
35 changes: 35 additions & 0 deletions edi_webservice/models/edi_backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class EdiBackend(models.Model):

_inherit = "edi.backend"

webservice_backend_id = fields.Many2one("webservice.backend")
_webservice_actions = ("send", "receive")

def _get_component_usage_candidates(self, exchange_record, key):
candidates = super()._get_component_usage_candidates(exchange_record, key)
if not self.webservice_backend_id or key not in self._webservice_actions:
return candidates
return ["webservice.{}".format(key)] + candidates

def _component_match_attrs(self, exchange_record, key):
# Override to inject `webservice_protocol` as match attribute
res = super()._component_match_attrs(exchange_record, key)
if not self.webservice_backend_id or key not in self._webservice_actions:
return res
res["webservice_protocol"] = self.webservice_backend_id.protocol
return res

def _component_sort_key(self, component_class):
res = super()._component_sort_key(component_class)
# Override to give precedence by `webservice_protocol` when needed.
if not self.webservice_backend_id:
return res
return (
1 if getattr(component_class, "_webservice_protocol", False) else 0,
) + res
1 change: 1 addition & 0 deletions edi_webservice/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Enric Tobella <[email protected]>
1 change: 1 addition & 0 deletions edi_webservice/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module creates WebService frameworks to be used on EDI
3 changes: 3 additions & 0 deletions edi_webservice/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_webservice_backend_edi_manager,webservice_backend edi manager,webservice.model_webservice_backend,base_edi.group_edi_manager,1,1,1,1
access_webservice_backend_user,webservice_backend user,webservice.model_webservice_backend,base.group_user,1,0,0,0
Binary file added edi_webservice/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading