From 8fe93c91872f912d0af3e242631fa371dc50009e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 4 Oct 2021 09:31:19 +0200 Subject: [PATCH] purchase_order_ubl_py3o: black, isort, etc. --- purchase_order_ubl/models/purchase.py | 3 ++- purchase_order_ubl_py3o/__manifest__.py | 18 +++++++++--------- purchase_order_ubl_py3o/models/py3o_report.py | 16 ++++++++-------- .../odoo/addons/purchase_order_ubl_py3o | 1 + setup/purchase_order_ubl_py3o/setup.py | 6 ++++++ 5 files changed, 26 insertions(+), 18 deletions(-) create mode 120000 setup/purchase_order_ubl_py3o/odoo/addons/purchase_order_ubl_py3o create mode 100644 setup/purchase_order_ubl_py3o/setup.py diff --git a/purchase_order_ubl/models/purchase.py b/purchase_order_ubl/models/purchase.py index 11fd08d27f..c87af9378f 100644 --- a/purchase_order_ubl/models/purchase.py +++ b/purchase_order_ubl/models/purchase.py @@ -256,7 +256,8 @@ def embed_ubl_xml_in_pdf(self, pdf_content, pdf_file=None): xml_string, self.get_document_name(doc_type), version=version ) pdf_content = self.embed_xml_in_pdf( - xml_string, xml_filename, pdf_content=pdf_content, pdf_file=pdf_file) + xml_string, xml_filename, pdf_content=pdf_content, pdf_file=pdf_file + ) return pdf_content def get_ubl_purchase_order_doc_type(self): diff --git a/purchase_order_ubl_py3o/__manifest__.py b/purchase_order_ubl_py3o/__manifest__.py index 957c690e99..e6b196f5f6 100644 --- a/purchase_order_ubl_py3o/__manifest__.py +++ b/purchase_order_ubl_py3o/__manifest__.py @@ -3,13 +3,13 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'Py3o UBL Purchase Order', - 'version': '14.0.1.0.0', - 'category': 'Purchases', - 'license': 'AGPL-3', - 'summary': 'Generate UBL purchase orders with Py3o reporting engine', - 'author': 'Akretion,Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/edi', - 'depends': ['purchase_order_ubl', 'report_py3o_fusion_server'], - 'installable': True, + "name": "Py3o UBL Purchase Order", + "version": "14.0.1.0.0", + "category": "Purchases", + "license": "AGPL-3", + "summary": "Generate UBL purchase orders with Py3o reporting engine", + "author": "Akretion,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/edi", + "depends": ["purchase_order_ubl", "report_py3o_fusion_server"], + "installable": True, } diff --git a/purchase_order_ubl_py3o/models/py3o_report.py b/purchase_order_ubl_py3o/models/py3o_report.py index 5ff26392da..3424c25f8f 100644 --- a/purchase_order_ubl_py3o/models/py3o_report.py +++ b/purchase_order_ubl_py3o/models/py3o_report.py @@ -6,23 +6,23 @@ class Py3oReport(models.TransientModel): - _inherit = 'py3o.report' + _inherit = "py3o.report" @api.model def _ubl_purchase_order_report_names(self): - return [ - 'purchase.report_purchaseorder', - 'purchase.report_purchasequotation'] + return ["purchase.report_purchaseorder", "purchase.report_purchasequotation"] def _postprocess_report(self, model_instance, result_path): purchase_reports = self._ubl_purchase_order_report_names() # We could match on object instead of report_name... # but I'm not sure it's a better approach if ( - self.ir_actions_report_id.report_name in purchase_reports - and self.ir_actions_report_id.report_type == 'py3o' - and self.ir_actions_report_id.py3o_filetype == 'pdf' - and model_instance and result_path): + self.ir_actions_report_id.report_name in purchase_reports + and self.ir_actions_report_id.report_type == "py3o" + and self.ir_actions_report_id.py3o_filetype == "pdf" + and model_instance + and result_path + ): # re-write PDF on report_path model_instance.embed_ubl_xml_in_pdf(None, pdf_file=result_path) return super()._postprocess_report(model_instance, result_path) diff --git a/setup/purchase_order_ubl_py3o/odoo/addons/purchase_order_ubl_py3o b/setup/purchase_order_ubl_py3o/odoo/addons/purchase_order_ubl_py3o new file mode 120000 index 0000000000..ac2c8e19ec --- /dev/null +++ b/setup/purchase_order_ubl_py3o/odoo/addons/purchase_order_ubl_py3o @@ -0,0 +1 @@ +../../../../purchase_order_ubl_py3o \ No newline at end of file diff --git a/setup/purchase_order_ubl_py3o/setup.py b/setup/purchase_order_ubl_py3o/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/purchase_order_ubl_py3o/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)