Skip to content

Conversation

@etobella
Copy link
Member

@etobella etobella commented Feb 2, 2026

Depends on #215

Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

Interesting approach! Thanks!


class EdiExchangeType(models.Model):
_name = "edi.exchange.type"
_inherit = ["edi.exchange.type", "mail.alias.mixin"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking out loud: instead of polluting the exchange type model, wouldn't be interesting to have a specific record for this? Eg: "EDI mail gateway" or something similar.
Easier to maintain and to configure for the end user probably. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Or maybe using edi.backend. At the end, that is the goal of backends, isn't it?

@etobella etobella force-pushed the 19.0-mig-mail branch 2 times, most recently from 8b6c81b to 82e92fb Compare February 4, 2026 08:31
@etobella
Copy link
Member Author

etobella commented Feb 4, 2026

@simahawk After your comments, I do agree that the best approach would be to set everything on the backend and do the same thing we do with Storage.

Also, I improved REadmes and information inside the backend to make it easier to handle (actually, it would be nice to include similar information in other modules to make it easier for users. Thanks for your comments, IMO they improved the solution.

image

return values

def _mail_exchange_type_pending_input_domain(self):
"""Domain for retrieving input exchange types for emails."""
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add some more conventional constraint here.
What if we add specific type of backend Email and we rely on the fact that exc types refer to that type.
I would make it more clear from the configuration point of view.

not custom_values.get("type_id")
and not backend.full_mail_exchange_type_id
):
types = self.env["edi.exchange.type"].search(
Copy link
Contributor

Choose a reason for hiding this comment

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

if we rely on the fact that we can have multiple files in an email and multiple types configured, we should support multiple creation of records.

Hence, here we should collect all new record values and call super on each set of values at the end.
Also, each record should be related to a single parent record (conventionally I would use the 1st one).

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I understand the idea, however, we cannot do that, as the message_new should return just one record and is attaching some extra information... however, I will find a solution for that. don't worry 😉

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