Skip to content

[20.0][MIG] edi_core_oca: Migration to 20.0 - #377

Open
HviorForgeFlow wants to merge 396 commits into
OCA:20.0from
ForgeFlow:20.0-mig-edi_core_oca
Open

HviorForgeFlow wants to merge 396 commits into
OCA:20.0from
ForgeFlow:20.0-mig-edi_core_oca

Conversation

@HviorForgeFlow

@HviorForgeFlow HviorForgeFlow commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Standard migration + some improvements:

  • ir.model.access and ir.rule are merged into ir.access (core 19.4-00-ir-access script), record rules are now accesses with a domain
  • exchange_file is written with BinaryBytes and read with .content, _set_file_content/_get_file_content keep their signature and existing checksums stay valid
  • get_formview_action() replaced by _get_records_action()
  • Query imported from odoo.orm.query
  • Drop tests/test_frontend.py, core WebSuite already runs the hoot tests
  • Drop the 19.0 migration script

Anything writing exchange_file with base64.b64encode(...) bytes has to pass a str or a BinaryBytes now.

Depends on:

CC @ForgeFlow

simahawk and others added 26 commits October 21, 2026 13:45
Prior to this change jobs were tied to the backend.

The backend must be responsible for processing records
and this is why the logic has been implemented there
and it's kept there with this change too.

However, it's way better if the job is tied to its record directly
because it makes more sense and it helps jumping to the record
w/ the 'related' btn on the job.
Makes little sense to show backends first
when you enter the EDI menu.
Ongoing exchanges are the most important thing.
We want to keep functionality on the same version. It is marked to remove for 16
By setting specific timezone and datetime format on exchange type
advanced settings, we can easily override the datetime used for generation of
exchange record filename.
Co-authored-by: etobella
Co-authored-by: Núria Sancho <nuria.sancho@creublanca.es>
Not all components might be bound to an exchange record.
* auto btns on/off flag per exchange type
* offer hook to customize how btns are rendered
* improve UI
Raise specific error when exchange type is not found.
Hadrien Huvelle and others added 29 commits October 21, 2026 13:45
…records

Add configurable auto-archiving and auto-deletion of EDI exchange records
per backend. This backend-specific settings that can be managed individually.

Changes:
- Add "Auto Cleanup" tab in backend form view for easy configuration
- Add archive cron job that respect backend-specific retention policies
- Add delete cron job that respect backend-specific retention policies
- Add "Archived" filter to exchange record search view

Benefits:
- Each backend can have different retention policies
- Setting fields to 0 (default value) disables the respective cleanup behavior
- More flexible data retention management
- Better control over storage and performance optimization

The cron jobs iterate through backends with configured retention
settings, applying appropriate cutoff values.

chore(edi_core_oca): update documentation
Ensure the conf and the env on the record is loaded properly when the handler is initialized.
You can finally jump from a type to its existing records.
Currently translated at 100.0% (286 of 286 strings)

Translation: edi-framework-19.0/edi-framework-19.0-edi_core_oca
Translate-URL: https://translation.odoo-community.org/projects/edi-framework-19-0/edi-framework-19-0-edi_core_oca/it/
When using edi_notification_oca, EDI exchanges that failed during send,
receive, or validation did not trigger any notification, leaving errors
unnoticed and requiring manual detection.

The backend only emitted "on_edi_exchange_error" on the process error
path. Other error paths updated the state and posted chatter messages
but did not fire the event.

This change ensures the error event is emitted on all error transitions:

exchange_send -> _notify_error("send_ko")

exchange_receive -> _notify_error("receive_ko", "validate_ko")

exchange_generate -> _notify_error("validate_ko")

Calls are guarded by state changes to avoid duplicate notifications.
Redundant chatter messages are removed since _notify_error already
handles logging and event emission.
Make `env` directly available in `edi.configuration` snippets, alongside
the existing `record`, `conf`, `user` and `uid` helpers. Snippets no
longer need to reach for `record.env` to access the environment, which
keeps them shorter and consistent with the context shared via
`env.context`.
Some errors such as

  ValueError,
  FileNotFoundError,
  exceptions.UserError,
  exceptions.ValidationError,

are caught, never re-raised, and the transaction is finally committed.

Which means a UserError/ValidationError gets committed, leading to
corruption of the processed data.
Currently translated at 100.0% (286 of 286 strings)

Translation: edi-framework-19.0/edi-framework-19.0-edi_core_oca
Translate-URL: https://translation.odoo-community.org/projects/edi-framework-19-0/edi-framework-19-0-edi_core_oca/da/
Currently translated at 100.0% (286 of 286 strings)

Translation: edi-framework-19.0/edi-framework-19.0-edi_core_oca
Translate-URL: https://translation.odoo-community.org/projects/edi-framework-19-0/edi-framework-19-0-edi_core_oca/sv/
The new _check_direction_handlers constraint broke installation with
demo data and several test suites. Add edi.oca.handler.noop in
edi_core_oca, reference it from the affected demo exchange types, and
make test exchange types default to it when no handler is registered.
Currently translated at 100.0% (290 of 290 strings)

Translation: edi-framework-19.0/edi-framework-19.0-edi_core_oca
Translate-URL: https://translation.odoo-community.org/projects/edi-framework-19-0/edi-framework-19-0-edi_core_oca/it/
Add on_cron_hourly and on_cron_daily triggers, fired by scheduled actions
of the same period. They carry no originating record, so each configuration
resolves its own targets: a global one runs once, any other runs against the
records linked to it through a many2many on its model.

That lookup is now shared with action_view_partners, which went through the
relation tables directly and assumed every many2many linking res.partner to
edi.configuration named its columns partner_id and conf_id.
Currently translated at 100.0% (290 of 290 strings)

Translation: edi-framework-19.0/edi-framework-19.0-edi_core_oca
Translate-URL: https://translation.odoo-community.org/projects/edi-framework-19-0/edi-framework-19-0-edi_core_oca/it/
An input record was received and then left for the next run of the input
cron to be processed, up to an hour later. Chain the two the way generate
and send already are, so a document is processed as soon as it lands.
Introduces a new class to wrap ``_exchange_$action`` methods.
It stores the methods' results and a message allowing further customization.
EdiExchangeConsumerMixin.get_view() rebuilds the form arch to inject
the EDI buttons, then serializes it back with etree.tostring(doc)
without encoding="unicode". lxml's tostring() defaults to bytes in
that case, while every other get_view() override in Odoo core and
elsewhere in this codebase explicitly passes encoding="unicode" to
keep the result a str, matching what ir.ui.view.get_view() itself
returns.

Any caller that does a plain string operation on the returned arch
(e.g. `"foo" in result["arch"]`) breaks with
`TypeError: a bytes-like object is required, not 'str'` for any model
inheriting this mixin, as soon as its form view has at least one
<sheet> without an ancestor <field>.
The exchange notification reads the path of window actions, which only
admins can read: posting it as any other user raised an AccessError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.