Skip to content

Conversation

@kobros-tech
Copy link
Contributor

@kobros-tech kobros-tech commented Mar 5, 2025

Sometimes we can resend the sign request for some partners and find that a new one is created although some people have already signed the previous one.

In that case we will have to resign agin which is extra needed

This PR is allow to resend the email or sms of the same sign request to be signed, also there is an option to allow creating request for once.

#87

unsubscribe feature is added to avoid sending emails to partners who are not interested.

Only partners who didn't sign and still followers to the specific sign request are receiving the email notifications.

@OCA-git-bot
Copy link
Contributor

Hi @etobella,
some modules you are maintaining are being modified, check this out!

@kobros-tech
Copy link
Contributor Author

kobros-tech commented Mar 6, 2025

Notification of success if email is resent successfully

Screenshot from 2025-03-06 12-43-00
Screenshot from 2025-03-06 12-47-30
Screenshot from 2025-03-06 12-40-50

@kobros-tech kobros-tech force-pushed the 16.0-imp-sign_oca-5 branch from a8fe6e2 to 531fe8d Compare March 6, 2025 10:14
@kobros-tech
Copy link
Contributor Author

@flotho

Copy link

@xaviedoanhduy xaviedoanhduy left a comment

Choose a reason for hiding this comment

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

hi @kobros-tech, why don't you change or reuse the action_send (ref) function to make the sign.oca.request support for sent state as well instead of creating a duplicate function with the same functionality. same as the Send By Email function of Sale Order.
image

@kobros-tech
Copy link
Contributor Author

hi @kobros-tech, why don't you change or reuse the action_send (ref) function to make the sign.oca.request support for sent state as well instead of creating a duplicate function with the same functionality. same as the Send By Email function of Sale Order. image

if it could be applied would be a good idea💡

@kobros-tech kobros-tech force-pushed the 16.0-imp-sign_oca-5 branch 3 times, most recently from 7971f13 to 182845c Compare March 23, 2025 22:22
@kobros-tech
Copy link
Contributor Author

@victoralmau

Copy link
Member

@victoralmau victoralmau left a comment

Choose a reason for hiding this comment

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

I don't understand the need to resend the email, in any case, maybe it would be easier to add a “Back to draft” button (while in sent status) to achieve the same goal. What do you think?

@kobros-tech
Copy link
Contributor Author

I don't understand the need to resend the email, in any case, maybe it would be easier to add a “Back to draft” button (while in sent status) to achieve the same goal. What do you think?

The point is not creaing many requests as if there are 3 partners and they should sign
Two already signed but one still not, we need to notify him again if we send the default is to create a new doc request if he signs the other two should also sign agin on the new created request.

So we better resend the same signed request with 2 partners to him to sign, so the point is not the state at all but the workflow.

@kobros-tech
Copy link
Contributor Author

by the way I didn't see back to draft button here is it recently merged or what?

@kobros-tech kobros-tech force-pushed the 16.0-imp-sign_oca-5 branch from 182845c to d8103e3 Compare March 25, 2025 20:26
@kobros-tech
Copy link
Contributor Author

Only partners who have not signed yet will receive the email to sign.

@kobros-tech
Copy link
Contributor Author

I am planning to correct the module to prevent creation if the signers are the same, return to draft button is not shown to me in this module?

Copy link

@xaviedoanhduy xaviedoanhduy left a comment

Choose a reason for hiding this comment

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

I am planning to correct the module to prevent creation if the signers are the same, return to draft button is not shown to me in this module?

I agree with your point of view. We should make the function of sending mail similar to that of sending email like Sale Order, Purchase Order, Invoice, ... (we can send mail multiple times in draft, sent or even confirm status)
Your change now is ok with me, so thanks for your work.

@dnplkndll
Copy link

I don't understand the need to resend the email, in any case, maybe it would be easier to add a “Back to draft” button (while in sent status) to achieve the same goal. What do you think?

The use case would be to remind the signer that there is a pending item needing attention. not sure if there is any better way to accomplish that. I guess if they are not longer interested in the service/status achieved from the contract, then the email should have a cancel option to prevent additional reminders.
@kobros-tech can the signer/email recipient indicate they would like to not sign/cancel the request?

@kobros-tech
Copy link
Contributor Author

I don't understand the need to resend the email, in any case, maybe it would be easier to add a “Back to draft” button (while in sent status) to achieve the same goal. What do you think?

The use case would be to remind the signer that there is a pending item needing attention. not sure if there is any better way to accomplish that. I guess if they are not longer interested in the service/status achieved from the contract, then the email should have a cancel option to prevent additional reminders. @kobros-tech can the signer/email recipient indicate they would like to not sign/cancel the request?

technically yes, they can unsubscribe to a channel

but let me try if I can.

@kobros-tech kobros-tech force-pushed the 16.0-imp-sign_oca-5 branch from d8103e3 to 833090c Compare May 11, 2025 21:28
@kobros-tech
Copy link
Contributor Author

@dnplkndll
unsubscribe can be for sign_oca all or for resending notification only, so which one I shoud take?

@kobros-tech kobros-tech force-pushed the 16.0-imp-sign_oca-5 branch 2 times, most recently from 40cb134 to 5c874de Compare May 12, 2025 17:33
@kobros-tech
Copy link
Contributor Author

Unsubscribe Feature:

Screenshot from 2025-05-12 20-27-08

Screenshot from 2025-05-12 20-27-23

@kobros-tech
Copy link
Contributor Author

I don't understand the need to resend the email, in any case, maybe it would be easier to add a “Back to draft” button (while in sent status) to achieve the same goal. What do you think?

there is an idea to achieve the same goal, shall I try and if it works we prefer the best option?
I can make PR for the other approach and after discussion and review we select the best one?
@dnplkndll

Comment on lines 108 to 135
def unsubscription(self, signer_id=None, res_id=None, access_token=None, **kwargs):
"""manage calls for unsubscription"""
if not res_id or not signer_id:
return {"state": "wrong_url"}
sign_request = request.env["sign.oca.request"].sudo().browse(int(res_id))
try:
signer = (
request.env["sign.oca.request.signer"].sudo().browse(int(signer_id))
)
if not signer:
return {"state": "wrong_id"}
signer_sudo = self._document_check_access(
signer._name, signer.id, access_token
)
sign_request.message_unsubscribe(
partner_ids=[int(signer_sudo.partner_id.id)]
)
except (AccessError, MissingError):
return {"state": "wrong_access"}
return {"state": "ok"}

@http.route("/mail/unsubscribe", type="http", auth="public", website=True)
def unsubscribe(self, signer_id=None, res_id=None, access_token=None, **kwargs):
"""unsubscription controller"""
vals = self.unsubscription(
signer_id=signer_id, res_id=res_id, access_token=access_token, **kwargs
)
return request.render("sign_oca.page_unsubscribed", vals)
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand the need for this. I mean, why would anyone want to unsubscribe from something they have to sign up for? Do we want to “allow” them to do so? I don't think so. I could apply the same “logic” to an email for a sales order, and no unsubscribe option is added, but that's just my opinion.

model = fields.Char(compute="_compute_model", compute_sudo=True, store=True)
active = fields.Boolean(default=True)
request_ids = fields.One2many("sign.oca.request", inverse_name="template_id")
create_single_request = fields.Boolean(default=True)
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand the need for this field; I think it just complicates the (clear) logic that currently exists.

string="Send"
type="object"
states="1_draft"
states="1_draft,0_sent"
Copy link
Member

Choose a reason for hiding this comment

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

Continuing with #124 (comment), this is NOT what I suggested. The “send” button in the header should remain as it is and should not be changed. A button (an icon that is representative without text) should be added to the signers, and that action should send the email to that recipient, nothing else.

Copy link
Member

Choose a reason for hiding this comment

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

I think the “simple” thing to do is to separate this part

for signer in self.signer_ids:
into a specific method in sign.request. signer and call that method to “resend.”

@kobros-tech kobros-tech force-pushed the 16.0-imp-sign_oca-5 branch 3 times, most recently from 1446f98 to 605aff8 Compare September 21, 2025 09:38
@kobros-tech kobros-tech changed the title [IMP] sign_oca: add resend and single request creation options [IMP] sign_oca: add resend feature to partners who did not sign Sep 21, 2025
@kobros-tech
Copy link
Contributor Author

@etobella
@pedrobaeza

@dnplkndll
Copy link

@kobros-tech when someone asks for the request but it goes to spam or not received for other reason ( bad email ?)
could we get link to send through the DM / chat you are talking to the customer on?

Copy link
Member

@victoralmau victoralmau left a comment

Choose a reason for hiding this comment

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

My comment #89 (comment) is still pending.

states="1_draft"
name="action_send"
icon="fa-paper-plane"
confirm="Are you sure ?"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
confirm="Are you sure ?"

I believe that this specific confirmation is not necessary.

@kobros-tech
Copy link
Contributor Author

@kobros-tech when someone asks for the request but it goes to spam or not received for other reason ( bad email ?) could we get link to send through the DM / chat you are talking to the customer on?

I created this PR so that it is very easy to DM the link in the chat or someone can sign on behalf:

#128

@kobros-tech
Copy link
Contributor Author

@victoralmau

hello?

@victoralmau
Copy link
Member

My comment https://github.com/OCA/sign/pull/89/files#r2374878936 is still pending.

@kobros-tech
Copy link
Contributor Author

@etobella

@kobros-tech
Copy link
Contributor Author

@victoralmau

the comment is resolved, is there any comment?

@dnplkndll
Copy link

@kobros-tech could a plan be setup? for instance to resend in an hour, then each day for a week then monthly unless the signer cancels? just for instance. that seems kind of annoying too.

@kobros-tech
Copy link
Contributor Author

we can make it in a private custom code, or I am working on notification automation and I would make it based on queue project.

to approach your point as long as any sign request is set to sent a queued notification will be sent untill the request becomes canceled or signed.

It is still needing finishing but can be reviewed to suggest any features.

OCA/server-tools#3425

@pedrobaeza pedrobaeza added this to the 16.0 milestone Nov 21, 2025
@pedrobaeza pedrobaeza requested a review from etobella November 21, 2025 15:06
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.

6 participants