From 203d6721854d2d97ecc3d6ce390df5f40ff0e4af Mon Sep 17 00:00:00 2001 From: "gborruso@dinamicheaziendali.it" Date: Fri, 29 Jan 2021 12:07:44 +0100 Subject: [PATCH] [MIG] l10n_it_fatturapa_export_zip: Migration to 14.0 --- l10n_it_fatturapa_export_zip/README.rst | 16 +- l10n_it_fatturapa_export_zip/__manifest__.py | 7 +- .../i18n/l10n_it_fatturapa_export_zip.pot | 138 ------------------ .../security/ir.model.access.csv | 2 + .../static/description/index.html | 14 +- .../wizard/export_fatturapa.py | 7 +- .../wizard/export_fatturapa_view.xml | 37 ++--- 7 files changed, 42 insertions(+), 179 deletions(-) delete mode 100644 l10n_it_fatturapa_export_zip/i18n/l10n_it_fatturapa_export_zip.pot create mode 100644 l10n_it_fatturapa_export_zip/security/ir.model.access.csv diff --git a/l10n_it_fatturapa_export_zip/README.rst b/l10n_it_fatturapa_export_zip/README.rst index 7220bbf2e7c4..ac5e62420b04 100644 --- a/l10n_it_fatturapa_export_zip/README.rst +++ b/l10n_it_fatturapa_export_zip/README.rst @@ -1,6 +1,6 @@ -======================================================= -Italian Localization - Fattura elettronica - Export ZIP -======================================================= +====================================== +ITA - Fattura elettronica - Export ZIP +====================================== .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! @@ -14,13 +14,13 @@ Italian Localization - Fattura elettronica - Export ZIP :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-italy/tree/12.0/l10n_it_fatturapa_export_zip + :target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_export_zip :alt: OCA/l10n-italy .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-italy-12-0/l10n-italy-12-0-l10n_it_fatturapa_export_zip + :target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_fatturapa_export_zip :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/122/12.0 + :target: https://runbot.odoo-community.org/runbot/122/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -44,7 +44,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -83,6 +83,6 @@ Current `maintainer `__: |maintainer-sergiocorato| -This module is part of the `OCA/l10n-italy `_ project on GitHub. +This module is part of the `OCA/l10n-italy `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_it_fatturapa_export_zip/__manifest__.py b/l10n_it_fatturapa_export_zip/__manifest__.py index 313f9a5ec72b..e5a65eaff666 100644 --- a/l10n_it_fatturapa_export_zip/__manifest__.py +++ b/l10n_it_fatturapa_export_zip/__manifest__.py @@ -1,12 +1,12 @@ # Copyright 2019 Sergio Corato (https://efatto.it) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { - "name": "Italian Localization - Fattura elettronica - Export ZIP", + "name": "ITA - Fattura elettronica - Export ZIP", "summary": "Permette di esportare in uno ZIP diversi file XML di " "fatture elettroniche", - "version": "12.0.1.0.1", + "version": "14.0.1.0.0", "development_status": "Beta", - "category": "other", + "category": "Localization/Italy", "website": "https://github.com/OCA/l10n-italy", "author": "Efatto.it di Sergio Corato, Odoo Community Association (OCA)", "maintainers": ["sergiocorato"], @@ -18,6 +18,7 @@ "l10n_it_fatturapa_in", ], "data": [ + "security/ir.model.access.csv", "wizard/export_fatturapa_view.xml", "views/attachment_view.xml", ], diff --git a/l10n_it_fatturapa_export_zip/i18n/l10n_it_fatturapa_export_zip.pot b/l10n_it_fatturapa_export_zip/i18n/l10n_it_fatturapa_export_zip.pot deleted file mode 100644 index f6e517a98e28..000000000000 --- a/l10n_it_fatturapa_export_zip/i18n/l10n_it_fatturapa_export_zip.pot +++ /dev/null @@ -1,138 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * l10n_it_fatturapa_export_zip -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" -"Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: l10n_it_fatturapa_export_zip -#: code:addons/l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py:30 -#, python-format -msgid "Attachment %s already exported. Remove ZIP file first" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: code:addons/l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py:35 -#, python-format -msgid "Attachment %s does not have XML file" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_export_zip.wizard_fatturapa_export -msgid "Cancel" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_wizard_fatturapa_export__create_uid -msgid "Created by" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_wizard_fatturapa_export__create_date -msgid "Created on" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_wizard_fatturapa_export__display_name -msgid "Display Name" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_export_zip.wizard_fatturapa_export -msgid "Download ZIP E-Invoices XML" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.actions.act_window,name:l10n_it_fatturapa_export_zip.action_fatturapa_in_export -#: model:ir.actions.act_window,name:l10n_it_fatturapa_export_zip.action_fatturapa_out_export -msgid "Download ZIP e-invoice XML" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model,name:l10n_it_fatturapa_export_zip.model_fatturapa_attachment_in -msgid "E-bill import file" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model,name:l10n_it_fatturapa_export_zip.model_fatturapa_attachment_out -msgid "E-invoice Export File" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: code:addons/l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py:18 -#, python-format -msgid "E-invoice-export" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: code:addons/l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py:54 -#, python-format -msgid "Export E-Invoices" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_export_zip.wizard_fatturapa_export -msgid "Export zip" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_fatturapa_attachment_in__exported_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_fatturapa_attachment_out__exported_zip -msgid "Exported ZIP" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_wizard_fatturapa_export__data -msgid "File" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_wizard_fatturapa_export__name -msgid "Filename" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_wizard_fatturapa_export__id -msgid "ID" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_wizard_fatturapa_export____last_update -msgid "Last Modified on" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_wizard_fatturapa_export__write_uid -msgid "Last Updated by" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model.fields,field_description:l10n_it_fatturapa_export_zip.field_wizard_fatturapa_export__write_date -msgid "Last Updated on" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model:ir.model,name:l10n_it_fatturapa_export_zip.model_wizard_fatturapa_export -msgid "Wizard e-invoice export ZIP" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_export_zip.view_fatturapa_in_attachment_search -#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_export_zip.view_fatturapa_out_attachment_search -msgid "ZIP Exported" -msgstr "" - -#. module: l10n_it_fatturapa_export_zip -#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_export_zip.view_fatturapa_in_attachment_search -#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_export_zip.view_fatturapa_out_attachment_search -msgid "ZIP Not Exported" -msgstr "" - diff --git a/l10n_it_fatturapa_export_zip/security/ir.model.access.csv b/l10n_it_fatturapa_export_zip/security/ir.model.access.csv new file mode 100644 index 000000000000..da079590e77a --- /dev/null +++ b/l10n_it_fatturapa_export_zip/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_wizard_fatturapa_export_user,access_wizard_fatturapa_export_user,model_wizard_fatturapa_export,account.group_account_invoice,1,1,1,0 diff --git a/l10n_it_fatturapa_export_zip/static/description/index.html b/l10n_it_fatturapa_export_zip/static/description/index.html index d43215f0deda..4957467f5a12 100644 --- a/l10n_it_fatturapa_export_zip/static/description/index.html +++ b/l10n_it_fatturapa_export_zip/static/description/index.html @@ -3,8 +3,8 @@ - -Italian Localization - Fattura elettronica - Export ZIP + +ITA - Fattura elettronica - Export ZIP -
-

Italian Localization - Fattura elettronica - Export ZIP

+
+

ITA - Fattura elettronica - Export ZIP

-

Beta License: AGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runbot

Italiano

Questo modulo aggiunge una procedura per esportare in uno ZIP diversi file XML di fatture elettroniche.

English

@@ -389,7 +389,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -416,7 +416,7 @@

Maintainers

promote its widespread use.

Current maintainer:

sergiocorato

-

This module is part of the OCA/l10n-italy project on GitHub.

+

This module is part of the OCA/l10n-italy project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py b/l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py index b5fab76844f5..f5f5739fce07 100644 --- a/l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py +++ b/l10n_it_fatturapa_export_zip/wizard/export_fatturapa.py @@ -20,7 +20,6 @@ def _default_name(self): data = fields.Binary("File", readonly=True) name = fields.Char("Filename", default=_default_name, required=True) - @api.multi def export_zip(self): self.ensure_one() attachments = self.env[self.env.context["active_model"]].browse( @@ -32,7 +31,7 @@ def export_zip(self): _("Attachment %s already exported. Remove ZIP file first") % att.display_name ) - if not att.datas or not att.datas_fname: + if not att.datas or not att.name: raise UserError( _("Attachment %s does not have XML file") % att.display_name ) @@ -40,19 +39,17 @@ def export_zip(self): fp = io.BytesIO() with zipfile.ZipFile(fp, mode="w") as zf: for att in attachments: - zf.writestr(att.datas_fname, base64.b64decode(att.datas)) + zf.writestr(att.name, base64.b64decode(att.datas)) fp.seek(0) data = fp.read() attach_vals = { "name": self.name + ".zip", - "datas_fname": self.name + ".zip", "datas": base64.encodestring(data), } zip_att = self.env["ir.attachment"].create(attach_vals) for att in attachments: att.exported_zip = zip_att return { - "view_type": "form", "name": _("Export E-Invoices"), "res_id": zip_att.id, "view_mode": "form", diff --git a/l10n_it_fatturapa_export_zip/wizard/export_fatturapa_view.xml b/l10n_it_fatturapa_export_zip/wizard/export_fatturapa_view.xml index 2e9478a6b5df..f084fa28214f 100644 --- a/l10n_it_fatturapa_export_zip/wizard/export_fatturapa_view.xml +++ b/l10n_it_fatturapa_export_zip/wizard/export_fatturapa_view.xml @@ -16,23 +16,24 @@ - + + Download ZIP e-invoice XML + ir.actions.act_window + wizard.fatturapa.export + form + new + + list,form + + + + Download ZIP e-invoice XML + ir.actions.act_window + wizard.fatturapa.export + form + new + + list,form + -