Skip to content

Commit

Permalink
[BKP][ADD]edi_endpoint_oca
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillemCForgeFlow committed Oct 29, 2024
1 parent 12ea92b commit 6da2864
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 36 deletions.
4 changes: 2 additions & 2 deletions edi_endpoint_oca/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"summary": """
Base module allowing configuration of custom endpoints for EDI framework.
""",
"version": "14.0.1.5.1",
"version": "13.0.1.0.0",
"development_status": "Beta",
"license": "LGPL-3",
"website": "https://github.com/OCA/edi",
"author": "Camptocamp,Odoo Community Association (OCA)",
"depends": ["base_edi", "edi_oca", "endpoint"],
"depends": ["edi", "endpoint"],
"data": [
"data/server_action.xml",
"security/ir.model.access.csv",
Expand Down
6 changes: 3 additions & 3 deletions edi_endpoint_oca/demo/edi_backend_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<odoo>
<record id="edi_backend_demo" model="edi.backend">
<field name="name">EDI backend with endpoints DEMO</field>
<field name="backend_type_id" ref="edi_oca.demo_edi_backend_type" />
<field name="backend_type_id" ref="edi.demo_edi_backend_type" />
</record>

<record id="edi_exchange_type_demo" model="edi.exchange.type">
<field name="name">EDI exchange demo </field>
<field name="code">demo_endpoint</field>
<field name="backend_type_id" ref="edi_oca.demo_edi_backend_type" />
<field name="backend_type_id" ref="edi.demo_edi_backend_type" />
<field name="direction">input</field>
</record>

<record id="edi_endpoint_demo_1" model="edi.endpoint">
<field name="backend_id" ref="edi_backend_demo" />
<field name="backend_type_id" ref="edi_oca.demo_edi_backend_type" />
<field name="backend_type_id" ref="edi.demo_edi_backend_type" />
<field name="exchange_type_id" ref="edi_exchange_type_demo" />
<field name="name">EDI Demo Endpoint 1</field>
<!-- The prefix `/edi/` will be added automatically -->
Expand Down
1 change: 0 additions & 1 deletion edi_endpoint_oca/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
from . import edi_backend_type
from . import edi_endpoint
from . import edi_exchange_record
from . import edi_exchange_consumer_mixin
5 changes: 3 additions & 2 deletions edi_endpoint_oca/models/edi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ def _compute_endpoints_count(self):
record.endpoints_count = by_backend_id.get(record.id)

def action_manage_endpoints(self):
xmlid = "edi_endpoint_oca.edi_endpoint_act_window"
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
module_name = "edi_endpoint_oca"
action_xmlid = "edi_endpoint_act_window"
action = self.env["ir.actions.act_window"].for_xml_id(module_name, action_xmlid)
action["domain"] = [
("backend_type_id", "=", self.backend_type_id.id),
"|",
Expand Down
9 changes: 5 additions & 4 deletions edi_endpoint_oca/models/edi_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import werkzeug

from odoo import _, api, exceptions, fields, models
from odoo.tools import safe_eval
from odoo.tools.safe_eval import safe_eval


class EDIEndpoint(models.Model):
Expand Down Expand Up @@ -70,13 +70,14 @@ def _handle_request(self, request):

def action_view_edi_records(self):
self.ensure_one()
xmlid = "edi_oca.act_open_edi_exchange_record_view"
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
module_name = "edi"
action_xmlid = "act_open_edi_exchange_record_view"
action = self.env["ir.actions.act_window"].for_xml_id(module_name, action_xmlid)
action["domain"] = [("edi_endpoint_id", "=", self.id)]
# Purge default search filters from ctx to avoid hiding records
ctx = action.get("context", {})
if isinstance(ctx, str):
ctx = safe_eval.safe_eval(ctx, self.env.context)
ctx = safe_eval(ctx, self.env.context)
action["context"] = {
k: v for k, v in ctx.items() if not k.startswith("search_default_")
}
Expand Down
19 changes: 0 additions & 19 deletions edi_endpoint_oca/models/edi_exchange_consumer_mixin.py

This file was deleted.

2 changes: 1 addition & 1 deletion edi_endpoint_oca/views/edi_backend_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<odoo>
<record id="edi_backend_view_form" model="ir.ui.view">
<field name="model">edi.backend</field>
<field name="inherit_id" ref="edi_oca.edi_backend_view_form" />
<field name="inherit_id" ref="edi.edi_backend_view_form" />
<field name="arch" type="xml">
<notebook position="inside">
<page name="endpoints" string="Endpoints">
Expand Down
2 changes: 1 addition & 1 deletion edi_endpoint_oca/views/edi_endpoint_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

<record model="ir.ui.menu" id="edi_endpoint_menu">
<field name="name">EDI Endpoints</field>
<field name="parent_id" ref="edi_oca.menu_edi_config" />
<field name="parent_id" ref="edi.menu_edi_config" />
<field name="action" ref="edi_endpoint_act_window" />
<field name="sequence" eval="100" />
</record>
Expand Down
6 changes: 3 additions & 3 deletions edi_endpoint_oca/views/edi_exchange_record_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<odoo>
<record id="edi_exchange_record_view_form" model="ir.ui.view">
<field name="model">edi.exchange.record</field>
<field name="inherit_id" ref="edi_oca.edi_exchange_record_view_form" />
<field name="inherit_id" ref="edi.edi_exchange_record_view_form" />
<field name="arch" type="xml">
<group name="status" position="inside">
<field name="edi_endpoint_id" />
Expand All @@ -12,7 +12,7 @@

<record id="edi_exchange_record_view_search" model="ir.ui.view">
<field name="model">edi.exchange.record</field>
<field name="inherit_id" ref="edi_oca.edi_exchange_record_view_search" />
<field name="inherit_id" ref="edi.edi_exchange_record_view_search" />
<field name="arch" type="xml">
<field name="parent_id" position="after">
<field name="edi_endpoint_id" string="Endpoint" />
Expand All @@ -22,7 +22,7 @@

<record id="edi_exchange_record_view_tree" model="ir.ui.view">
<field name="model">edi.exchange.record</field>
<field name="inherit_id" ref="edi_oca.edi_exchange_record_view_tree" />
<field name="inherit_id" ref="edi.edi_exchange_record_view_tree" />
<field name="arch" type="xml">
<field name="edi_exchange_state" position="after">
<field name="edi_endpoint_id" string="Endpoint" />
Expand Down

0 comments on commit 6da2864

Please sign in to comment.