diff --git a/pingen/__manifest__.py b/pingen/__manifest__.py index 1d9acd81db1..314737bf3c9 100644 --- a/pingen/__manifest__.py +++ b/pingen/__manifest__.py @@ -1,5 +1,5 @@ # Author: Guewen Baconnier -# Copyright 2012-2017 Camptocamp SA +# Copyright 2012-2023 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { diff --git a/pingen/data/pingen_data.xml b/pingen/data/pingen_data.xml index 866c51d3207..424b0ce526b 100644 --- a/pingen/data/pingen_data.xml +++ b/pingen/data/pingen_data.xml @@ -16,7 +16,7 @@ Run Pingen Document Update - + 1 days diff --git a/pingen/models/base_config_settings.py b/pingen/models/base_config_settings.py index 0ac91437e0c..ed9fae663d8 100644 --- a/pingen/models/base_config_settings.py +++ b/pingen/models/base_config_settings.py @@ -1,4 +1,4 @@ -# Copyright 2018 Camptocamp SA +# Copyright 2012-2023 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models diff --git a/pingen/models/ir_attachment.py b/pingen/models/ir_attachment.py index d8b99fc73b5..349d8591ebe 100644 --- a/pingen/models/ir_attachment.py +++ b/pingen/models/ir_attachment.py @@ -1,5 +1,5 @@ # Author: Guewen Baconnier -# Copyright 2012-2017 Camptocamp SA +# Copyright 2012-2023 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). import base64 @@ -22,7 +22,6 @@ class IrAttachment(models.Model): def _prepare_pingen_document_vals(self): return { "attachment_id": self.id, - # 'config': 'created from attachment' } def _handle_pingen_document(self): diff --git a/pingen/models/pingen.py b/pingen/models/pingen.py index 8296c426fa4..e7829c59005 100644 --- a/pingen/models/pingen.py +++ b/pingen/models/pingen.py @@ -1,5 +1,5 @@ # Author: Guewen Baconnier -# Copyright 2012-2017 Camptocamp SA +# Copyright 2012-2023 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). import json @@ -224,27 +224,13 @@ def push_document( 3. dict of the created item on pingen (details) """ - # we cannot use the `files` param alongside - # with the `datas`param when data is a - # JSON-encoded data. We have to construct - # the entire body and send it to `data` - # https://github.com/kennethreitz/requests/issues/950 - # formdata = { - # 'file': (filename, filestream.read()), - # } - url, url_signature = self._get_file_upload() - # file_upload = self._get_file_upload() - - # multipart, content_type = encode_multipart_formdata(formdata) - self.upload_file(url, filestream.read(), content_type) data_attributes = { "file_original_name": filename, "file_url": url, "file_url_signature": url_signature, - # TODO Use parameters and mapping "address_position": "left", "auto_send": send, "delivery_product": delivery_product, @@ -263,10 +249,6 @@ def push_document( rjson_data = response.json().get("data", {}) document_id = rjson_data.get("id") - # if rjson.get('send'): - # # confusing name but send_id is the posted id - # posted_id = rjson['send'][0]['send_id'] - # item = rjson['item'] item = rjson_data.get("attributes") return document_id, False, item @@ -314,4 +296,3 @@ def post_infos(self, document_uuid): letter_id=document_uuid, ) return response.json().get("data", {}).get("attributes") - # return response.json()['item'] diff --git a/pingen/models/pingen_document.py b/pingen/models/pingen_document.py index 4ee5729efe9..0adebbf01b4 100644 --- a/pingen/models/pingen_document.py +++ b/pingen/models/pingen_document.py @@ -1,5 +1,5 @@ # Author: Guewen Baconnier -# Copyright 2012-2017 Camptocamp SA +# Copyright 2012-2023 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). import logging @@ -138,11 +138,6 @@ def _push_to_pingen(self, pingen=None): raise error = False state = "pushed" - # if post_id: - # state = 'sendcenter' - # elif infos['requirement_failure']: - # state = 'pingen_error' - # error = _('The document does not meet the Pingen requirements.') push_date = pingen_datetime_to_utc(infos.get("created_at")) self.write( { diff --git a/pingen/models/res_company.py b/pingen/models/res_company.py index 8b0dc218c3e..cd30e5058e2 100644 --- a/pingen/models/res_company.py +++ b/pingen/models/res_company.py @@ -1,5 +1,5 @@ # Author: Guewen Baconnier -# Copyright 2012-2017 Camptocamp SA +# Copyright 2012-2023 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import fields, models diff --git a/pingen/tests/test_pingen.py b/pingen/tests/test_pingen.py index b12cbdbd1fc..ac4f7a004ad 100644 --- a/pingen/tests/test_pingen.py +++ b/pingen/tests/test_pingen.py @@ -1,4 +1,4 @@ -# Copyright 2023 Camptocamp SA +# Copyright 2012-2023 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) import base64