Skip to content

[19.0][MIG] edi_exchange_template_oca: Migration to 19.0 - #250

Closed
sergijPf wants to merge 98 commits into
OCA:19.0from
DeineTuer-GmbH:19.0-mig-edi_exchange_template_oca
Closed

sergijPf wants to merge 98 commits into
OCA:19.0from
DeineTuer-GmbH:19.0-mig-edi_exchange_template_oca

Conversation

@sergijPf

Copy link
Copy Markdown
Contributor

few changes done as per 19.0:

  • replace odoo.fields.first(), removed in core;
  • remove 'nocopy' param in safe_eval(), no more exists;
  • odoo_test_helper.FakeModelLoader replaced with _setup_env(), done similar way to edi_core_oca;
  • remove string/expand attributes for search view (edi_exchange_template_output_view_search), causing failure

@etobella

Copy link
Copy Markdown
Member

/ocabot migration edi_exchange_template

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Mar 25, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Mar 25, 2026
14 of 26 tasks
@etobella

Copy link
Copy Markdown
Member

/ocabot rebase

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@etobella The rebase process failed, because command git push --force DeineTuer-GmbH tmp-pr-250:19.0-mig-edi_exchange_template_oca failed with output:

remote: Repository not found.
fatal: repository 'https://github.com/DeineTuer-GmbH/edi-framework/' not found

@etobella

Copy link
Copy Markdown
Member

/ocabot migration edi_exchange_template_oca

@sergijPf
sergijPf force-pushed the 19.0-mig-edi_exchange_template_oca branch from 44d0990 to 23ff6e9 Compare May 21, 2026 10:47
@OCA-git-bot OCA-git-bot added series:19.0 mod:edi_exchange_template_oca Module edi_exchange_template_oca labels May 21, 2026
yankinmax and others added 18 commits June 9, 2026 09:00
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: edi-framework-18.0/edi-framework-18.0-edi_exchange_template_oca
Translate-URL: https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_exchange_template_oca/
Currently translated at 100.0% (41 of 41 strings)

Translation: edi-framework-18.0/edi-framework-18.0-edi_exchange_template_oca
Translate-URL: https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_exchange_template_oca/it/
Fix the behavior according to the feature ported from v14
and drop the deprecated lookup by code.
It slows down test suites by creating too many things when not needed.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: edi-framework-18.0/edi-framework-18.0-edi_exchange_template_oca
Translate-URL: https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_exchange_template_oca/
Currently translated at 100.0% (42 of 42 strings)

Translation: edi-framework-18.0/edi-framework-18.0-edi_exchange_template_oca
Translate-URL: https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_exchange_template_oca/it/
@sergijPf
sergijPf force-pushed the 19.0-mig-edi_exchange_template_oca branch from 23ff6e9 to f33e03a Compare June 9, 2026 06:22
@sergijPf
sergijPf force-pushed the 19.0-mig-edi_exchange_template_oca branch from f33e03a to 6f08f49 Compare June 9, 2026 06:40
def _prettify_xml(self, xml_string):
return etree.tostring(etree.fromstring(xml_string), pretty_print=True)

def _get_info_provider(self, exchange_record, work_ctx=None, usage=None, **kw):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@etobella this slipped out of our reviews when moving away from components: it's dead code w/o edi_component_oca.
In fact, this is a part that I wanted to remove anyway because the snippet already allow you to prepare data from where you want w/o needing to define a specific component.
The original idea was to be able to define default "info" components that could be reused.

@sergijPf pls get rid of it in a separate commit. Something like

[REM] edi_exchange_template_oca: get rid of dead code

Meant to work with components only. 

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@simahawk removed as requested

from lxml import etree


def xml_purge_nswrapper(xml_content):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@sergijPf may I ask you you to test one thing?
The nswrapper trick should be superflous today because to define namespaces you can use this approach

<t xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
            <cac:DeliveryParty>
              [...]
            </cac:DeliveryParty>
</t>

If this works, we can leave behind this trick.

@SilvioC2C SilvioC2C left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PR looks good overall, I'm afraid the new first_of function might crash. Can you please test it (possibly add an automated test)?


def _time_utils(self):
def first():
return lambda records: next(iter(records)) if len(records) > 1 else records

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm afraid this may break the code:

  • fields.first was a function that accepted a recordset as param and returned its first record (if any)
  • this new implementation, instead, accepts no arguments and returns a function

Can you test this, please?
If not working, should be easy to fix:

def first(recs):
    return next(iter(recs)) if len(recs) > 1 else recs

@etobella

Copy link
Copy Markdown
Member

@sergijPf can you review @SilvioC2C comments please?

@etobella

etobella commented Oct 2, 2026

Copy link
Copy Markdown
Member

Superseeded in #364

@etobella etobella closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:edi_exchange_template_oca Module edi_exchange_template_oca series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.