Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] auth_signup: reminder about unregistered users. #31582

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@pch-odoo
Copy link
Contributor

commented Mar 5, 2019

Send a mail to a user informing him about the user(s) he has invited in Odoo, but have still not registered.

  • Here, we've sent a mail template to the user(s) who added another user(s) in Odoo.
  • It informs them about the details of users who have been invited but have not yet registered.

Note: The mail to the invitor shall be sent after 5 days(default) from the day he invited the user(s), and will be reminded only once about that day's invitations.

Task Link: https://www.odoo.com/web?#id=1912449&action=327&model=project.task&view_type=form&menu_id=4720

Pad Link: https://pad.odoo.com/p/r.0f4e15e2cb86d382d220151b24be7526

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo robodoo added the CI 🤖 label Mar 5, 2019

@C3POdoo C3POdoo added the RD label Mar 5, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch Mar 12, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 12, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch Mar 13, 2019

@robodoo robodoo removed the CI 🤖 label Mar 13, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch to b4c8f0a Mar 13, 2019

@robodoo robodoo added the CI 🤖 label Mar 13, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from b4c8f0a to 3aac1e4 Mar 19, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 19, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from 3aac1e4 to 0b1e0d0 Mar 20, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 20, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from 0b1e0d0 to f25d5f2 Mar 20, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 20, 2019

@mba-odoo mba-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from 90ca5bf to fe1d5b0 Mar 22, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 22, 2019

@mba-odoo mba-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from fe1d5b0 to 02c75f3 Mar 22, 2019

mba-odoo added a commit to odoo-dev/odoo that referenced this pull request Mar 22, 2019

[IMP] auth_signup : Send a reminder to the user who added another use…
…r in Odoo

Purpose of the task is to sent a mail template to the user who added another user(s) in Odoo.
It informs user about the details of users who have been invited by him
but have not registered after 5 days of creation.

Task ID : 1912449
Closes odoo#31582

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 22, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from 02c75f3 to 89109f3 Apr 9, 2019

pch-odoo added a commit to odoo-dev/odoo that referenced this pull request Apr 9, 2019

[IMP] auth_signup : Send a reminder to the user who added another use…
…r in Odoo

Purpose of the task is to sent a mail template to the user who added another user(s) in Odoo.
It informs user about the details of users who have been invited by him
but have not registered after 5 days of creation.

Task ID : 1912449
Closes odoo#31582

@robodoo robodoo removed the CI 🤖 label Apr 9, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from 89109f3 to c27ba23 Apr 9, 2019

pch-odoo added a commit to odoo-dev/odoo that referenced this pull request Apr 9, 2019

[IMP] auth_signup : Send a reminder to the user who added another use…
…r in Odoo

Purpose of the task is to sent a mail template to the user who added another user(s) in Odoo.
It informs user about the details of users who have been invited by him
but have not registered after 5 days of creation.

Task ID : 1912449
Closes odoo#31582

@robodoo robodoo added the CI 🤖 label Apr 9, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from c27ba23 to f7ffa6b Apr 15, 2019

pch-odoo added a commit to odoo-dev/odoo that referenced this pull request Apr 15, 2019

[IMP] auth_signup : Send a reminder to the user who added another use…
…r in Odoo

Purpose of the task is to sent a mail template to the user who added another user(s) in Odoo.
It informs user about the details of users who have been invited by him
but have not registered after 5 days of creation.

Task ID : 1912449
Closes odoo#31582

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Apr 15, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from f7ffa6b to ce5d8a5 Apr 25, 2019

pch-odoo added a commit to odoo-dev/odoo that referenced this pull request Apr 25, 2019

[IMP] auth_signup : Send a reminder to the user who added another use…
…r in Odoo

Purpose of the task is to sent a mail template to the user who added another user(s) in Odoo.
It informs user about the details of users who have been invited by him
but have not registered after 5 days of creation.

Task ID : 1912449
Closes odoo#31582

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Apr 25, 2019

@tde-banana-odoo
Copy link
Contributor

left a comment

Technical review

<field name="name">Auth Signup: Unregistered Users</field>
<field name="model_id" ref="base.model_res_users"/>
<field name="subject">Reminder for unregistered users</field>
<field name="email_from">"${object.company_id.name|safe}" &lt;${object.company_id.email or user.email|safe}&gt;</field>

This comment has been minimized.

Copy link
@tde-banana-odoo

tde-banana-odoo May 7, 2019

Contributor

Maybe you could use object.company_id.partner_id.email_formatted instead. That way you already have a formatted email instead of doing it manually.

<field name="model_id" ref="base.model_res_users"/>
<field name="subject">Reminder for unregistered users</field>
<field name="email_from">"${object.company_id.name|safe}" &lt;${object.company_id.email or user.email|safe}&gt;</field>
<field name="email_to">${object.email|safe}</field>

This comment has been minimized.

Copy link
@tde-banana-odoo

tde-banana-odoo May 7, 2019

Contributor

Use email_formatted field instead. That way it is beautiful.

<field name="subject">Reminder for unregistered users</field>
<field name="email_from">"${object.company_id.name|safe}" &lt;${object.company_id.email or user.email|safe}&gt;</field>
<field name="email_to">${object.email|safe}</field>
<field name="body_html" type="html">

This comment has been minimized.

Copy link
@tde-banana-odoo

tde-banana-odoo May 7, 2019

Contributor

Instead of hardcoding the template layout, use notif_layout parameter from template send_mail. That way we don't have synchronization issues or templates having "more or less" the same code.

This comment has been minimized.

Copy link
@mba-odoo

mba-odoo May 8, 2019

Contributor

@tde-banana-odoo , contents are different in header than our main notif layout(mail_notification_light) so we hardcoded template. if we avoid some header stuff then we can use the notif_layout. Thanks

This comment has been minimized.

Copy link
@tde-banana-odoo

tde-banana-odoo May 8, 2019

Contributor

What are the differences exactly ?

This comment has been minimized.

Copy link
@mba-odoo

mba-odoo May 8, 2019

Contributor

@tde-banana-odoo , in main view header, will be like
your XYZ and subtitle will be reocrd_name while in spec header:
header Name of your database and Big Pending invitations
Thanks

@@ -201,6 +203,28 @@ def action_reset_password(self):
template.with_context(lang=user.lang).send_mail(user.id, force_send=True, raise_exception=True)
_logger.info("Password reset email sent for user <%s> to <%s>", user.login, user.email)

@api.multi
def send_unregistered_user_reminder(self, after_days=5):
datetime_min = date_utils.start_of(date_utils.subtract(fields.Datetime.today(), days=after_days), 'day')

This comment has been minimized.

Copy link
@tde-banana-odoo

tde-banana-odoo May 7, 2019

Contributor

I bet you can simplify your code using relativedelta for example :) .

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from ce5d8a5 to 83bc994 May 8, 2019

pch-odoo added a commit to odoo-dev/odoo that referenced this pull request May 8, 2019

[IMP] auth_signup : send a reminder to the user who added another use…
…r in Odoo

Purpose of the task is to sent a mail template to the user who added another user(s) in Odoo.

It informs user about the details of users who have been invited by him
but have still not registered after given days of creation (default->5days)

Task-1912449
Closes odoo#31582

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels May 8, 2019

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from 83bc994 to 8532410 May 9, 2019

pch-odoo added a commit to odoo-dev/odoo that referenced this pull request May 9, 2019

[IMP] auth_signup : send a reminder to the user who added another use…
…r in Odoo

Purpose of the task is to sent a mail template to the user who added another user(s) in Odoo.

It informs user about the details of users who have been invited by him
but have still not registered after given days of creation (default->5days)

Task-1912449
Closes odoo#31582

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels May 9, 2019

[IMP] auth_signup : send a reminder to the user who added another use…
…r in Odoo

Purpose of the task is to sent a mail template to the user who added another user(s) in Odoo.

It informs user about the details of users who have been invited by him
but have still not registered after given days of creation (default->5days)

Task-1912449
Closes #31582

@pch-odoo pch-odoo force-pushed the odoo-dev:master-auth-signup-pending-user-pch branch from 8532410 to 87f56db May 16, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels May 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.