How do I disable the note when sending an email? - odoo

Is there a way to disable the creation of a "log note" when I send an email using the send_mail() method of mail.template?
Basically what I'm doing is sending an email to all team members every time a ticket is opened in the helpdesk. the problem is that in the ticket itself, it creates as many log notes for me as there are emails I send.
How can I disable the creation of log notes?
Thanks in advance

I had the same issue which you are facing so my solution :
mail_id = template_valuess.with_context(
ctx).send_mail(self.id, force_send=True)
if mail_id:
mail_obj = self.env['mail.mail'].sudo().browse(mail_id)
mail_message_id = mail_obj.mail_message_id
mail_message_id.res_id = False
It worked for me as i unlinked the res_id.
Note: If someone has better option, please add as i'm looking for alternative too.

I found the solution add auto_delete:True on template's value

Related

How can I configure EAGetMail DLL options to make date search work?

Hi everyone and thanks in advance for taking the time reading my question.
I have this scenario: I'm using EAGetMail DLL to retrieve emails from a POP3 e-mail server. I have used an example given on the website and so far so good; I can get all the emails from my inbox.
My problem arises when I try to use the data filters that the DLL provides, in order to not get all the emails in the inbox, just a few, using a certain data range.
The code that I'm using for this purpose is the following:
Dim oClient As New MailClient("TryIt")
oClient.Connect(oServer)
Dim options As GetMailInfosOptionType
options = options Or GetMailInfosOptionType.DateRange
options = options Or GetMailInfosOptionType.OrderByDateTime
oClient.GetMailInfosParam.Reset()
oClient.GetMailInfosParam.GetMailInfosOptions = options
oClient.GetMailInfosParam.DateRange.SINCE = System.DateTime.Now.AddDays(-4)
oClient.GetMailInfosParam.DateRange.BEFORE = System.DateTime.Now.AddDays(1)
Theoretically this should retrieve only the emails within last four days from today, but it is not working. Everytime I execute the code I get every e-mail from my inbox.
Has someone faced something similar to this?
The first sentence on this page, regarding the MailClient.GetMailInfosParam property, says that POP3 is not supported:
Search email on IMAP4 Server and MS Exchange Server. It doesn't
support POP3 protocol.

WHMCS show single ticket reply by last update

I want make a new file to call a ticket replies from db and adding feature for showing a single reply only by reply id or reply time for example if called a URL like
history.php?tid=844130&c=1uT0TR8y&lastreply=1222
How I can do that?

Odoo v8 survey user invitation and number answer per user issue?

I'm trying to use the new version of Odoo Survey and survey_crm but I'm facing the following problems.
In the previous version there is an option of restricting number of answer per user but in this new version there is no such option (may be I don't know yet), however I tried the following:
Quizz mode (check box): I used this but still not working any user has an option to answer twice
In the invitation I used the last option (which is, Send private invitation to your audience(only one response per recipient and per invitation)) but still this option wouldn't prevent user answering more than once b/c of "Test" link in the Kanban view of Survey
when I tried to send any invitation it popups an error saying OpenERP server error even if I successfully configure my outgoing and incoming email server but when i try it again without and modification it sends with out any error.
As in v8 we are getting wizard.survey_id as "survey.survey" object , instead of id. so, override the _get_public_url function as below:
def _get_public_url(self, cr, uid, ids, name, arg, context=None):
res = dict((id, 0) for id in ids)
survey_obj = self.pool.get('survey.survey')
for wizard in self.browse(cr, uid, ids, context=context):
if isinstance(wizard.survey_id,int):
res[wizard.id] = survey_obj.browse(cr, uid, wizard.survey_id, context=context).public_url
else:
res[wizard.id] = wizard.survey_id.public_url
return res
While Share and Invite by Mail select "Send private invitation to your audience (only one response per recipient and per invitation)" option so that it sends a unique link for each contact and you can able to see those linked Tokens in Answers.
One more thing, these links won't work until and unless the Odoo server start with db-filter option(if multiple databases are present). Because, with these links data base name is not present. So, if we click on these generated links it returns an Error like "This webpage is not available".

ASP: SMTP authentification fails with JMail

I have a bit specific problem. One of the websites I am taking care of runs on ASP and obtains form, whose results are e-mailed to specific address.
For this to achieve, JMail component is used. As long as e-mail was sent locally (let say to user#clientserver.com through mailserver mail.clientserver.com), there was no problem and no need for authentication. However I recently got request to add another address to copy(copy#differentserver.com) and that's when problem occurred.
Firstly I tried adding authentication, however same error still occurred, when without:
jmail.Message error '8000ffff'
The message was undeliverable. All servers failed to receive the message
I tried google solutions, temper with some valuables. I am sure user and pass are correct, mail server address also worked when I wasn't try to sent mail with authentication.
Since I prefer PHP, my knowledge and skill with ASP are not of the bests. Have someone experienced something similar and solved it? Or does anyone know some other solution?
The code, which is used for sending mail:
set msg = Server.CreateOBject( "JMail.Message" )
msg.Charset = "windows-1250"
msg.Logging = true
msg.From= "from#mail.com"
msg.FromName= name&" - "&mail
'those should care of smtp auth
msg.MailServerUserName = "smtpuser#localmailserver.com"
msg.MailServerPassword = "smtppass"
'local mail address
msg.AddRecipient "user#localmailserver.com"
'outside mail address
msg.AddRecipient "address#differentmail.com"
msg.Subject = "Some subject"
msg.Body = "Some text"
if not msg.Send( "mail.localmailserver.com" ) then
Response.write "<pre>" & msg.log & "</pre>"
else
'Succesfully sent, redirect
Response.Redirect("mailjob_sent.asp")
end if
So the problem is solved at last. After help with analysis by my colleagues responsible for local mailserver, we found out, the problem was username for SMTP authentification.
I got confused, since it wasn't smtpuser#localmailserver.com (I'm referring to example I made), but
smtpuser#localdomainname.com.
So advice for others with similar problem, try to add testing account(one you are using for authentification) to your e-mail client(i.e. Thunderbird) and once that is allright, you have right credentials. Also try sending mail from that account elsewhere.

Sending Full Master data objects of DEBMAS from change pointer

I need to send complete DEBMAS and complete MATMAS idoc to my other system. I'm able to create and send MATMAS and DEBMAS idocs on change but it only sends the changed (delta) data. So I have made an enhancement on FM: CHANGE_POINTERS_READ which is like this:
ENHANCEMENT 1 ZSEND_COMPLETE_IDOCS. "active version
field-symbols <fs_bdcp> type bdcp.
if message_type = 'DEBMAS' or message_type = 'MATMAS'.
loop at change_pointers assigning <fs_bdcp>.
<fs_bdcp>-fldname = 'ALELISTING'.
endloop.
endif.
ENDENHANCEMENT.
However this only works for MATMAS. When I change a material in MM02, my idoc is created with complete segments, not only with changed segments. However this enhancement does not work for DEBMAS!?!? Anyone knows why?
I need to find out how to send my DEBMAS idoc completely to my other system.
Thanks in advance.
Talha
Solved by myself. You need to use BD12 tcode in order to send complete idoc of DEBMAS, other ways are not working correctly.