Skip to content
Merged
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
23 changes: 23 additions & 0 deletions edi_core_oca/models/edi_oca_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,26 @@ class EdiOcaHandlerCheck(models.AbstractModel):

def check(self, exchange_record):
pass


class EdiOcaHandlerNoop(models.AbstractModel):
"""No-op implementation of every EDI handler role.

``edi.exchange.type`` requires handlers matching its direction (see
``_check_direction_handlers``) but ``edi_core_oca`` ships no concrete
implementation. This handler performs no action and can be referenced by
demo/showcase exchange types, or used as a placeholder until a real
handler is configured.
"""

_name = "edi.oca.handler.noop"
_inherit = [
"edi.oca.handler.generate",
"edi.oca.handler.input.validate",
"edi.oca.handler.output.validate",
"edi.oca.handler.send",
"edi.oca.handler.receive",
"edi.oca.handler.process",
"edi.oca.handler.check",
]
_description = "EDI OCA Handler No-op"
1 change: 1 addition & 0 deletions edi_endpoint_oca/demo/edi_backend_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<field name="code">demo_endpoint</field>
<field name="backend_type_id" ref="edi_core_oca.demo_edi_backend_type" />
<field name="direction">input</field>
<field name="process_model_id" ref="edi_core_oca.model_edi_oca_handler_noop" />
</record>

<record id="edi_endpoint_demo_1" model="edi.endpoint">
Expand Down
1 change: 1 addition & 0 deletions edi_purchase_oca/demo/edi_exchange_type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<field name="name">Demo Purchase Order out</field>
<field name="code">demo_PurchaseOrder_out</field>
<field name="direction">output</field>
<field name="send_model_id" ref="edi_core_oca.model_edi_oca_handler_noop" />
<field name="exchange_filename_pattern">{record_name}-{type.code}-{dt}</field>
<field name="exchange_file_ext">xml</field>
</record>
Expand Down
2 changes: 2 additions & 0 deletions edi_sale_oca/demo/edi_exchange_type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<field name="name">Demo Sale Order Response</field>
<field name="code">demo_SaleOrder_out</field>
<field name="direction">output</field>
<field name="send_model_id" ref="edi_core_oca.model_edi_oca_handler_noop" />
<field name="exchange_filename_pattern">{record_name}-{type.code}-{dt}</field>
<field name="exchange_file_ext">xml</field>
</record>
Expand All @@ -17,6 +18,7 @@
<field name="name">Demo Sale Order</field>
<field name="code">demo_SaleOrder_in</field>
<field name="direction">input</field>
<field name="process_model_id" ref="edi_core_oca.model_edi_oca_handler_noop" />
<field name="exchange_file_ext">xml</field>
</record>
</odoo>
Loading