Skip to content

[17.0][ADD] edi_local#1237

Draft
edescalona wants to merge 1 commit intoOCA:17.0from
BinhexTeam:17.0-add-edi_local
Draft

[17.0][ADD] edi_local#1237
edescalona wants to merge 1 commit intoOCA:17.0from
BinhexTeam:17.0-add-edi_local

Conversation

@edescalona
Copy link

@BinhexTeam

Add settings to generate .txt files

@edescalona edescalona force-pushed the 17.0-add-edi_local branch 4 times, most recently from 2f3aa57 to b42a2b3 Compare February 19, 2026 03:36
@simahawk
Copy link
Contributor

I'm not sure to understand this work. What is the final goal? Can you provide a real use case?
In addition, can't you use an exchange template to generate TXT?

@edescalona
Copy link
Author

edescalona commented Feb 25, 2026

Hola @simahawk I'll tell you about this job.

Objective:
To allow, through configurations, the generation or import of a .txt file (This is the type defined initially, but it can be extended to generate other types of documents).

Real-world example: GENERATE FILE
A client needs to generate .txt files with the transfers to send via EDI (Electronic Data Interchange). For example:

They need the following .txt document:

CABALMOUT12345 20260225N
LIN202602251 8414354411344

Details:

Line 1:
CAB (1 - 3 - 3):

Description: Line identifier.

Expression: ‘CAB’
ALMOUT12345 (4 - 20 - 24):

Description: Delivery note number

Expression: sanitize_value(record.name)
20260225 (24 - 8 - 32):

Description: Delivery note date

Expression: record.date_done.strftime('%Y%m%d') if record.date_done else ""
N (32 - 1 - 33):

Description: Order type

Expression: # N = Goods shipment notification (Normal, default)
# D = Return
'N'

Configuration:
Pasted Graphic

Line 2:
LIN (1 - 3 - 4):

Description: Line identifier

Expression: ‘LIN’
1 (4 - 8 - 12):

Description: Delivery note date

Expression: record.picking_id.date_done.strftime('%Y%m%d') if record.picking_id.date_done else ""
1 (12 - 4 - 16):

Description: Line number

Expression: num_line or record.id
8414354411344 (16 - 13 - 29):

Description: Barcode of product X

Expression: record.product_id.barcode or ""

Configuration:
Pasted Graphic 1

Notes:

  1. The numeric range within the parentheses: Start - Size - End
  2. record: corresponds to the current object being iterated according to the selected model.
Pasted Graphic 2

Luego de realizar todas la configuraciones se puede realizar un test (Test generare file) el cual evalúa todas las expresiones sin generar el archivo final.

Cuando s verifica que todo esta correcto se procede a ejecutar la generación del fichero mediante el botón Generate file, el cual se muestra cuando se habilita la configuración (Enabled)
Generate file

I'm still testing some scenarios with real clients to cover the most generic aspects, and in more specific cases the methods can be extended and adjusted according to the needs of each project.

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.

2 participants