Skip to content

Conversation

@chienandalu
Copy link
Member

@chienandalu chienandalu commented Mar 5, 2025

What's been done:

  • In the client side a big refactor was made by Odoo and it was necessary to refactor the client logic as well for this module stuff.
  • Aside from the regular migration stuff, some logic had to be adapted the new client stuff.

cc @Tecnativa TT50728

please review @carlos-lopez-tecnativa @CarlosRoca13

chienandalu added a commit to Tecnativa/social that referenced this pull request Mar 5, 2025
WIP for test workflows of mail_gateway migration in OCA#1614
@chienandalu chienandalu force-pushed the 17.0-MIG-mail_gateway branch from 40b0825 to c5ea53f Compare March 14, 2025 11:19
chienandalu added a commit to Tecnativa/social that referenced this pull request Mar 14, 2025
WIP for test workflows of mail_gateway migration in OCA#1614
@chienandalu chienandalu force-pushed the 17.0-MIG-mail_gateway branch 7 times, most recently from 2960391 to 4116f81 Compare March 18, 2025 10:46
chienandalu added a commit to Tecnativa/social that referenced this pull request Mar 18, 2025
WIP for test workflows of mail_gateway migration in OCA#1614
@chienandalu chienandalu force-pushed the 17.0-MIG-mail_gateway branch 2 times, most recently from daf2808 to 3c05c03 Compare March 18, 2025 11:07
@chienandalu chienandalu force-pushed the 17.0-MIG-mail_gateway branch 2 times, most recently from f22ff5b to a5cfe3a Compare March 18, 2025 16:34
chienandalu and others added 5 commits March 19, 2025 12:54
Other OCA modules extending the composer add m2m fields with fixed
relations. To avoid a glue module we try for the moment to add those
manually.

TT51108
Currently translated at 81.2% (113 of 139 strings)

Translation: social-16.0/social-16.0-mail_gateway
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_gateway/it/
Currently translated at 10.7% (15 of 139 strings)

Translation: social-16.0/social-16.0-mail_gateway
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_gateway/es/
…ated to the current user

- Use OdooBot for webhooks instead of the current user, following the same logic as Odoo.
- Avoid automatically adding the current user as a member of a new gateway to prevent notifications for all messages. This is now an explicit configuration.
@chienandalu chienandalu force-pushed the 17.0-MIG-mail_gateway branch from a5cfe3a to 993561c Compare March 19, 2025 12:07
@chienandalu chienandalu marked this pull request as ready for review March 19, 2025 12:12
Copy link
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

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

Code review, just a minor changes.
I tested the function locally with mail_gateway_whatsapp, and it worked fine.

<record id="mail_channel_gateway_rule" model="ir.rule">
<field name="name">Mail.channel: access gateway</field>
<field name="model_id" ref="mail.model_mail_channel" />
<record id="discuss_channel_gateway_rule" model="ir.rule">
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really necessary to change the xml_id? This change might require a script for OpenUpgrade, or did I miss something?

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, is a noupdate="0" record in this case, so the old one will be dropped.

Comment on lines +14 to +22
def create_partner(self):
partner = self.env["res.partner"].create(self._get_partner_vals())
self._merge_partner(partner)
return partner.get_formview_action()

def _get_partner_vals(self):
return {
"name": self.guest_id.name,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

When a new partner is created from an anonymous record, only the name field is set. Is it possible to populate additional fields, such as phone or mobile?

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Where do you get them from? In telegram for instance you don't have such data. Maybe in whatsapp it could be inferred from the token...

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if the data is available. I only see that the new contact only has the name set, but the main information for WhatsApp should be the phone number.

This wizard is opened from the chatter when there is no res.partner associated with the guest. Clicking on the name displays the popup.
image

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, but I mean that should be dealt in mail_gateway_whatsapp, as other gateways might not have that info at all

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but I mean that should be dealt in mail_gateway_whatsapp, as other gateways might not have that info at all

Ahh, ok, sorry! But I agree, this information is specific to WhatsApp.

@chienandalu chienandalu force-pushed the 17.0-MIG-mail_gateway branch 2 times, most recently from a5af4b4 to 4850108 Compare March 20, 2025 11:18
@chienandalu chienandalu force-pushed the 17.0-MIG-mail_gateway branch from 4850108 to 56e5c2d Compare March 20, 2025 11:28
@CarlosRoca13
Copy link
Contributor

please @carlos-lopez-tecnativa review this again

Copy link
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

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

Tested locally. LGTM.

@pedrobaeza
Copy link
Member

/ocabot migration mail_gateway
/ocabot merge nobump

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Jul 22, 2025
@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 17.0-ocabot-merge-pr-1614-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot mentioned this pull request Jul 22, 2025
40 tasks
@OCA-git-bot OCA-git-bot merged commit 319405b into OCA:17.0 Jul 22, 2025
4 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 8ebc792. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 17.0-MIG-mail_gateway branch July 22, 2025 13:50
pedrobaeza pushed a commit to Tecnativa/social that referenced this pull request Sep 22, 2025
WIP for test workflows of mail_gateway migration in OCA#1614
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants