Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions fetchmail_attach_from_folder/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================
Email gateway - folders
=======================
Expand All @@ -17,7 +13,7 @@ Email gateway - folders
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
Expand Down Expand Up @@ -120,9 +116,9 @@ Authors
Contributors
------------

- Holger Brunn hbrunn@therp.nl
- Ronald Portier ronald@therp.nl
- Alexandre Fayolle alexandre.fayolle@camptocamp.com
- Holger Brunn hbrunn@therp.nl
- Ronald Portier ronald@therp.nl
- Alexandre Fayolle alexandre.fayolle@camptocamp.com

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion fetchmail_attach_from_folder/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Email gateway - folders",
"summary": "Attach mails in an IMAP folder to existing objects",
"version": "18.0.1.0.0",
"version": "18.0.1.0.1",
"author": "Therp BV,Odoo Community Association (OCA)",
"maintainers": ["NL66278"],
"website": "https://github.com/OCA/server-tools",
Expand Down
6 changes: 4 additions & 2 deletions fetchmail_attach_from_folder/models/fetchmail_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ def onchange_server_type(self):
self.state = "draft"
return result

def fetch_mail(self):
def fetch_mail(self, raise_exception=True):
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of raise_exception=True put **kwargs here.

result = True
for this in self:
if not this.folders_only:
result = result and super(FetchmailServer, this).fetch_mail()
result = result and super(FetchmailServer, this).fetch_mail(
Copy link
Contributor

Choose a reason for hiding this comment

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

and **kwargs here. We are not doing anything with any keyword argument here, so using '**kwargs` will pass any keyword argument in the invocation of this method unchanged to the super() method. This will keep working, no matter how many keyword arguments are added or changed in the future.

raise_exception
)
this.folder_ids.fetch_mail()
return result
34 changes: 14 additions & 20 deletions fetchmail_attach_from_folder/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Email gateway - folders</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="email-gateway-folders">
<h1 class="title">Email gateway - folders</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="email-gateway-folders">
<h1>Email gateway - folders</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e4c93058a6151bbc67ceadf75cf0fee376e22dbd28e548bc91887592979779de
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/18.0/fetchmail_attach_from_folder"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-fetchmail_attach_from_folder"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-tools&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/18.0/fetchmail_attach_from_folder"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-fetchmail_attach_from_folder"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-tools&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Adds the possibility to attach emails from a certain IMAP folder to
objects, ie partners. Matching is done via several algorithms, ie email
address, email address’s domain or the original Odoo algorithm.</p>
Expand All @@ -400,13 +395,13 @@ <h1>Email gateway - folders</h1>
</ul>
</div>
<div class="section" id="configuration">
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>In your fetchmail configuration, you’ll find a new list field
<tt class="docutils literal">Folders to&nbsp; monitor</tt>. Add your folders here in IMAP notation (usually
something like <tt class="docutils literal">INBOX.your_folder_name.your_subfolder_name</tt>), choose a
model to attach mails to and a matching algorithm to use.</p>
<div class="section" id="exact-mailaddress">
<h3><a class="toc-backref" href="#toc-entry-2">Exact mailaddress</a></h3>
<h2><a class="toc-backref" href="#toc-entry-2">Exact mailaddress</a></h2>
<p>Fill in a field to search for the email address in <tt class="docutils literal">Field (model)</tt>.
For partners, this would be <tt class="docutils literal">email</tt>. Also fill in the header field
from the email to look at in <tt class="docutils literal">Field (email)</tt>. If you want to match
Expand All @@ -415,22 +410,22 @@ <h3><a class="toc-backref" href="#toc-entry-2">Exact mailaddress</a></h3>
fill in <tt class="docutils literal">to,cc,bcc</tt>.</p>
</div>
<div class="section" id="domain-of-email-addresses">
<h3><a class="toc-backref" href="#toc-entry-3">Domain of email addresses</a></h3>
<h2><a class="toc-backref" href="#toc-entry-3">Domain of email addresses</a></h2>
<p>Match the domain of the email address(es) found in <tt class="docutils literal">Field (email)</tt>.
This would attach a mail to <tt class="docutils literal">test1&#64;example.com</tt> to a record with
<tt class="docutils literal">Field (model)</tt> set to <tt class="docutils literal">test2&#64;example.com</tt>. Given that this is a
fuzzy match, you probably want to check <tt class="docutils literal">Use 1st match</tt>, because
otherwise nothing happens if multiple possible matches are found.</p>
</div>
<div class="section" id="odoo-standard">
<h3><a class="toc-backref" href="#toc-entry-4">Odoo standard</a></h3>
<h2><a class="toc-backref" href="#toc-entry-4">Odoo standard</a></h2>
<p>This is stricly speaking no matching algorithm, but calls the model’s
standard action on new incoming mail, which is usually creating a new
record.</p>
</div>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-5">Usage</a></h2>
<h1><a class="toc-backref" href="#toc-entry-5">Usage</a></h1>
<p>A widespread configuration is to have a shared mailbox with several
folders, i.e. one where users drop mails they want to attach to
partners. Let this folder be called <tt class="docutils literal">From partners</tt>. Then create a
Expand All @@ -448,31 +443,31 @@ <h2><a class="toc-backref" href="#toc-entry-5">Usage</a></h2>
archive folder that can be specified.</p>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-6">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-6">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-tools/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20fetchmail_attach_from_folder%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-7">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-7">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-8">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-8">Authors</a></h2>
<ul class="simple">
<li>Therp BV</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-9">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-9">Contributors</a></h2>
<ul class="simple">
<li>Holger Brunn <a class="reference external" href="mailto:hbrunn&#64;therp.nl">hbrunn&#64;therp.nl</a></li>
<li>Ronald Portier <a class="reference external" href="mailto:ronald&#64;therp.nl">ronald&#64;therp.nl</a></li>
<li>Alexandre Fayolle <a class="reference external" href="mailto:alexandre.fayolle&#64;camptocamp.com">alexandre.fayolle&#64;camptocamp.com</a></li>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -487,6 +482,5 @@ <h3><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h3>
</div>
</div>
</div>
</div>
</body>
</html>