summaryrefslogtreecommitdiff
path: root/addons/snailmail
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-05-04 09:18:39 +0000
committerThibault Delavallée <tde@odoo.com>2020-08-18 11:41:59 +0000
commitfcd10b3691c2291f224ac5083395edf0f00fc9ee (patch)
treeb9b7535bf820959eb6e311bf72e9352dc4c1da4a /addons/snailmail
parent14a73fa1dffc50295e59cdaa4db2a8427cfcb040 (diff)
[REF] iap, various: reorganize IAP module organization
PURPOSE Clean and improve IAP tools integration in Odoo. Introduce bridge modules to extract common features, notably for CRM and Partner. SPECIFICATIONS In this commit we reorganize IAP module to better understand its content and ease future cleaning * have models separated from tools; * rename some tools to find their grep. An iap_ prefix is added to ensure we don't clash with other global functions or methods; * perform some linting; To provide backward compatibility support we keep some import in init file of IAP addon. Standard code is about to be updated but we want to avoid too much issues when migrating code to 13.5 . Compatibility layer will be removed after v14 final freeze. LINKS Task ID-2248367 Community PR odoo/odoo#53214 Enterprise PR odoo/enterprise#11258 Upgrade PR odoo/upgrade#1363 IAP PR odoo/iap-apps#191
Diffstat (limited to 'addons/snailmail')
-rw-r--r--addons/snailmail/models/snailmail_letter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/snailmail/models/snailmail_letter.py b/addons/snailmail/models/snailmail_letter.py
index e60286cec9e..2eb19271b3c 100644
--- a/addons/snailmail/models/snailmail_letter.py
+++ b/addons/snailmail/models/snailmail_letter.py
@@ -4,7 +4,7 @@ import re
import base64
from odoo import fields, models, api, _
-from odoo.addons.iap import jsonrpc
+from odoo.addons.iap.tools import iap_tools
from odoo.tools.safe_eval import safe_eval
DEFAULT_ENDPOINT = 'https://iap-snailmail.odoo.com'
@@ -335,7 +335,7 @@ class SnailmailLetter(models.Model):
endpoint = self.env['ir.config_parameter'].sudo().get_param('snailmail.endpoint', DEFAULT_ENDPOINT)
timeout = int(self.env['ir.config_parameter'].sudo().get_param('snailmail.timeout', DEFAULT_TIMEOUT))
params = self._snailmail_create('print')
- response = jsonrpc(endpoint + PRINT_ENDPOINT, params=params, timeout=timeout)
+ response = iap_tools.iap_jsonrpc(endpoint + PRINT_ENDPOINT, params=params, timeout=timeout)
for doc in response['request']['documents']:
if doc.get('sent') and response['request_code'] == 200:
note = _('The document was correctly sent by post.<br>The tracking id is %s', doc['send_id'])