Skip to content

[18.0][ADD] edi_purchase_diapar_oca#7

Open
P-H-Phuc wants to merge 15 commits into18.0from
18.0-mig-edi_purchase_diapar
Open

[18.0][ADD] edi_purchase_diapar_oca#7
P-H-Phuc wants to merge 15 commits into18.0from
18.0-mig-edi_purchase_diapar

Conversation

@P-H-Phuc
Copy link
Owner

This module was initially part of the Foodcoop set of addons. We're now migrating it to 18.0 and taking this occasion to contribute it to OCA.

TEST FLOW

  1. Create a EDI config system
image
  1. Set Vendor is an EDI supllier
image
  1. Create a Purchase Order and confirm it
image
  1. File is sent to FPT server and create a log
  • Note: create a folder as "/Reception" previous
image image

@P-H-Phuc P-H-Phuc changed the title [18.0][MIG] edi_purchase_diapar: Migration to 18.0 [18.0][ADD] edi_purchase_diapar Dec 17, 2025
Copy link

@nguyenminhchien nguyenminhchien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@P-H-Phuc P-H-Phuc force-pushed the 18.0-mig-edi_purchase_diapar branch from bbb4a17 to b48a236 Compare February 9, 2026 11:41
@P-H-Phuc P-H-Phuc changed the title [18.0][ADD] edi_purchase_diapar [18.0][ADD] edi_purchase_diapar_oca Feb 10, 2026
@P-H-Phuc
Copy link
Owner Author

P-H-Phuc commented Feb 10, 2026

CONFIGURATION

I. FS Storage

Go to Settings > Technical > FS Storage

  • Name: Diapar FTP Storage
  • Code: diapar_ftp
  • Protocol: ftp (FTPFileSystem)
  • Options: {"host": "127.0.0.1", "username": "admin", "password": "admin", "port": 5000}

II .EDI Backend Type

Go to EDI > Config > Backend types

  • Name: DIAPAR
  • Code: diapar
  • Name: Diapar

III. EDI Backend

Go to EDI > Config > Backends

  • Name: Diapar
  • EDI Backend type: DIAPAR
  • FS Storage: Diapar FTP Storage
  • Input pending directory: IN/PENDING
  • Input done directory: IN/DONE
  • Input error directory: IN/ERROR
  • Output pending directory: OUT/PENDING
  • Output done directory: OUT/DONE
  • Output error directory: OUT/ERROR

IV. EDI Exchange Template Output

Go to EDI > Config > EDI Exchange Template Output

  • Name: Diapar Output Exchange Template
  • EDI Backend type: Diapar
  • Backend: Diapar
  • Code: diapar.output.exchange.template
  • Output Type: text
  • Generator: Qweb Template
  • Qweb Template: create new template
  • Business params: Vrp Code, Customer Code, Constant File Start / End,...

V. EDI Exchange Type

Go to EDI > Config > Exchange types
1. OUTPUT: PO

  • Name / Code: diapar_out_order
  • Backend / Backend type?: Diapar
  • Direction: Output
  • Enabled for partners: Select partners...
  • Filename pattern: edi.config.system.po_text_file_pattern
  • File ext: C99
  • Encoding: iso-8859-1

2. INPUT: BLE (Despatch Advice)

  • Name / Code: diapar_in_despatch_advice
  • Backend / Backend type: Diapar
  • Direction: Input
  • partner_ids: Select partners...
  • Filename pattern: BLE*
  • File ext: txt
  • Encoding: iso-8859-1
  • Advanced Settings:
components:
    process:
        usage: input.process.diapar.purchase.price
        env_ctx:
            msg_type: 'Purchase Price'
  • INPUT: Purchase Price (CH)
    • Name/Code: diapar_in_purchase_price
    • Backend: Diapar
    • Direction: Input
    • partner_ids: from edi.config.system.supplier_id
    • Filename pattern: CH*
    • File ext: txt
    • Encoding: iso-8859-1
    • Advanced Settings:
components:
    process:
        usage: input.process.diapar.purchase.price
        env_ctx:
            msg_type: 'Purchase Price'

VI. EDI Configuration

Go to EDI > Config > Configurations

  • Name: Diapar Purchase Order
  • Backend: Diapar
  • Exchange Type: diapar_out_order
  • Trigger: On record write
  • Model: Purchase Order
  • EDI Config Do:
if record.state == 'purchase':
  record._edi_send_via_edi(conf.type_id)

VII. Vendor

Open Vendor form > EDI > Purchase > Select EDI Configure Diapar Purchase Order

@P-H-Phuc P-H-Phuc force-pushed the 18.0-mig-edi_purchase_diapar branch from b48a236 to aa112f3 Compare February 10, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants