From 22f6497fac7ee3f142a2836c2ecd0d6b62b3ed84 Mon Sep 17 00:00:00 2001 From: eLBati Date: Mon, 10 Sep 2018 12:27:49 +0200 Subject: [PATCH 01/16] l10n_it_ipa ADD is_pa bool field ADD PECDestinatario, CodiceDestinatario , FormatoTrasmissione handling ADD Lotto di fatture verso soggetto privato ADD gestione prodotti nelle fatture passive ADD l10n_it_fatturapa_in_purchase ADD einvoice.line model IMP form fatture ADD Livello di dettaglio Fatture elettroniche ADD PDF preview dell'XML ADD Link to existing supplier invoice and handle "registered" XML ADD rappresentante fiscale e stabile organizzazione in emissione gestione prodotti DatiBollo , DatiCassaPrevidenziale e ScontoMaggiorazione CodiceArticolo, ftpa_line_number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IMP "show preview" as link FIX invoice duplication ADD constraints and Nome Cognome Avoid to cancel invoice with XML Mostra i dati fattura elettronica solo se il cliente è soggetto IMP READMEs Gestione IVA inclusa nel prezzo --- l10n_it_fatturapa_in_purchase/README.rst | 78 +++++++++++++++++++ l10n_it_fatturapa_in_purchase/__init__.py | 3 + l10n_it_fatturapa_in_purchase/__manifest__.py | 23 ++++++ l10n_it_fatturapa_in_purchase/i18n/it.po | 37 +++++++++ .../models/__init__.py | 3 + .../models/purchase_order.py | 28 +++++++ .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 5 ++ .../readme/USAGE.rst | 1 + .../views/invoice_view.xml | 21 +++++ 10 files changed, 200 insertions(+) create mode 100644 l10n_it_fatturapa_in_purchase/README.rst create mode 100644 l10n_it_fatturapa_in_purchase/__init__.py create mode 100644 l10n_it_fatturapa_in_purchase/__manifest__.py create mode 100644 l10n_it_fatturapa_in_purchase/i18n/it.po create mode 100644 l10n_it_fatturapa_in_purchase/models/__init__.py create mode 100644 l10n_it_fatturapa_in_purchase/models/purchase_order.py create mode 100644 l10n_it_fatturapa_in_purchase/readme/CONTRIBUTORS.rst create mode 100644 l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst create mode 100644 l10n_it_fatturapa_in_purchase/readme/USAGE.rst create mode 100644 l10n_it_fatturapa_in_purchase/views/invoice_view.xml diff --git a/l10n_it_fatturapa_in_purchase/README.rst b/l10n_it_fatturapa_in_purchase/README.rst new file mode 100644 index 000000000000..12cc29de373c --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/README.rst @@ -0,0 +1,78 @@ +========================================== +Fattura Elettronica - Purchase integration +========================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-italy/tree/10.0/l10n_it_fatturapa_in_purchase + :alt: OCA/l10n-italy +.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/122/10.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| + +Integra gli ordini di acquisto con le fatture elettroniche passive. + +Con questo modulo è possibile collegare una fattura elettronica passiva ad un ordine di acquisto esistente nel sistema. + +Così facendo si potrà tracciare se l'ordine è stato fatturato o meno. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Nelle fatture elettroniche passive in stato bozza, aprire la riga che si vuole collegare ad una riga di ordine d'acquisto e riempire il campo 'Riga ordine d'acquisto'. + +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. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Agile Business Group + +Contributors +~~~~~~~~~~~~ + +* Lorenzo Battistini + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +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_in_purchase/__init__.py b/l10n_it_fatturapa_in_purchase/__init__.py new file mode 100644 index 000000000000..cde864bae21a --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models diff --git a/l10n_it_fatturapa_in_purchase/__manifest__.py b/l10n_it_fatturapa_in_purchase/__manifest__.py new file mode 100644 index 000000000000..b8627022f5ad --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/__manifest__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Lorenzo Battistini +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + + +{ + 'name': 'Fattura Elettronica - Purchase integration', + 'version': '10.0.1.0.0', + 'category': 'Hidden', + 'author': 'Agile Business Group, ' + 'Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/l10n-italy', + 'license': 'LGPL-3', + "depends": [ + 'l10n_it_fatturapa_in', + 'purchase', + ], + "data": [ + "views/invoice_view.xml", + ], + "installable": True, + 'auto_install': True, +} diff --git a/l10n_it_fatturapa_in_purchase/i18n/it.po b/l10n_it_fatturapa_in_purchase/i18n/it.po new file mode 100644 index 000000000000..401243e9f15e --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/i18n/it.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_fatturapa_in_purchase +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-09-27 08:55+0000\n" +"PO-Revision-Date: 2018-09-27 08:55+0000\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_in_purchase +#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_account_invoice_line_fatturapa_attachment_in_id +msgid "E-Invoice Import File" +msgstr "File importazione fattura elettronica" + +#. module: l10n_it_fatturapa_in_purchase +#: model:ir.model,name:l10n_it_fatturapa_in_purchase.model_account_invoice_line +msgid "Invoice Line" +msgstr "Riga Fattura" + +#. module: l10n_it_fatturapa_in_purchase +#: model:ir.model,name:l10n_it_fatturapa_in_purchase.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "Riga Ordine d'Acquisto" + +#. module: l10n_it_fatturapa_in_purchase +#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line_to_invoice +msgid "To invoice" +msgstr "Da fatturare" + diff --git a/l10n_it_fatturapa_in_purchase/models/__init__.py b/l10n_it_fatturapa_in_purchase/models/__init__.py new file mode 100644 index 000000000000..16dca48a04e4 --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import purchase_order diff --git a/l10n_it_fatturapa_in_purchase/models/purchase_order.py b/l10n_it_fatturapa_in_purchase/models/purchase_order.py new file mode 100644 index 000000000000..95bd12c5545c --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/models/purchase_order.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +from odoo import models, fields, api + + +class POLine(models.Model): + _inherit = 'purchase.order.line' + to_invoice = fields.Boolean( + "To invoice", compute="_compute_to_invoice", store=True) + + @api.depends( + "invoice_lines.invoice_id.state", "product_qty", "product_uom", + "invoice_lines.quantity", "invoice_lines.uom_id" + ) + def _compute_to_invoice(self): + for line in self: + if line.product_qty > line.qty_invoiced: + line.to_invoice = True + else: + line.to_invoice = False + + @api.multi + def name_get(self): + res = [] + for line in self: + name = "%s: %s" % (line.order_id.name, line.name) + res.append((line.id, name)) + return res diff --git a/l10n_it_fatturapa_in_purchase/readme/CONTRIBUTORS.rst b/l10n_it_fatturapa_in_purchase/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..f52b696bb04f --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Lorenzo Battistini diff --git a/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst b/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..508619bdc0c5 --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +Integra gli ordini di acquisto con le fatture elettroniche passive. + +Con questo modulo è possibile collegare una fattura elettronica passiva ad un ordine di acquisto esistente nel sistema. + +Così facendo si potrà tracciare se l'ordine è stato fatturato o meno. diff --git a/l10n_it_fatturapa_in_purchase/readme/USAGE.rst b/l10n_it_fatturapa_in_purchase/readme/USAGE.rst new file mode 100644 index 000000000000..6cd67e30aa6a --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/readme/USAGE.rst @@ -0,0 +1 @@ +Nelle fatture elettroniche passive in stato bozza, aprire la riga che si vuole collegare ad una riga di ordine d'acquisto e riempire il campo 'Riga ordine d'acquisto'. diff --git a/l10n_it_fatturapa_in_purchase/views/invoice_view.xml b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml new file mode 100644 index 000000000000..0be32c0d67c9 --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml @@ -0,0 +1,21 @@ + + + + + view_invoice_line_form_fatturapa_po_line + account.invoice.line + + + + + + + + + + + From a47423621fb81c15fbb9f48e174f79fdda33fca7 Mon Sep 17 00:00:00 2001 From: eLBati Date: Mon, 8 Oct 2018 17:09:02 +0200 Subject: [PATCH 02/16] IMP decimal precision ADD Export E-invoice button IMP README --- l10n_it_fatturapa_in_purchase/README.rst | 18 +- l10n_it_fatturapa_in_purchase/i18n/it.po | 18 +- .../i18n/l10n_it_fatturapa_in_purchase.pot | 25 + .../readme/DESCRIPTION.rst | 6 +- .../readme/USAGE.rst | 2 +- .../static/description/index.html | 426 ++++++++++++++++++ 6 files changed, 473 insertions(+), 22 deletions(-) create mode 100644 l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot create mode 100644 l10n_it_fatturapa_in_purchase/static/description/index.html diff --git a/l10n_it_fatturapa_in_purchase/README.rst b/l10n_it_fatturapa_in_purchase/README.rst index 12cc29de373c..147f722ab120 100644 --- a/l10n_it_fatturapa_in_purchase/README.rst +++ b/l10n_it_fatturapa_in_purchase/README.rst @@ -16,17 +16,20 @@ Fattura Elettronica - Purchase integration .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github :target: https://github.com/OCA/l10n-italy/tree/10.0/l10n_it_fatturapa_in_purchase :alt: OCA/l10n-italy -.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-italy-10-0/l10n-italy-10-0-l10n_it_fatturapa_in_purchase + :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/10.0 :alt: Try me on Runbot -|badge1| |badge2| |badge3| |badge4| +|badge1| |badge2| |badge3| |badge4| |badge5| -Integra gli ordini di acquisto con le fatture elettroniche passive. +Integrate purchase orders with supplier electronic invoices. -Con questo modulo è possibile collegare una fattura elettronica passiva ad un ordine di acquisto esistente nel sistema. +With this module you can link a supplier electronic invoice to an existing purchase order. -Così facendo si potrà tracciare se l'ordine è stato fatturato o meno. +In this way, you track whether the order is invoiced or not. **Table of contents** @@ -36,14 +39,15 @@ Così facendo si potrà tracciare se l'ordine è stato fatturato o meno. Usage ===== -Nelle fatture elettroniche passive in stato bozza, aprire la riga che si vuole collegare ad una riga di ordine d'acquisto e riempire il campo 'Riga ordine d'acquisto'. +In draft supplier electronic invoices, open the line to be linked to a purchase order line and fill the 'purchase order line' field. 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. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/l10n_it_fatturapa_in_purchase/i18n/it.po b/l10n_it_fatturapa_in_purchase/i18n/it.po index 401243e9f15e..e9a419c09925 100644 --- a/l10n_it_fatturapa_in_purchase/i18n/it.po +++ b/l10n_it_fatturapa_in_purchase/i18n/it.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * l10n_it_fatturapa_in_purchase +# * l10n_it_fatturapa_in_purchase # msgid "" msgstr "" @@ -10,21 +10,12 @@ msgstr "" "PO-Revision-Date: 2018-09-27 08:55+0000\n" "Last-Translator: <>\n" "Language-Team: \n" +"Language: \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_in_purchase -#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_account_invoice_line_fatturapa_attachment_in_id -msgid "E-Invoice Import File" -msgstr "File importazione fattura elettronica" - -#. module: l10n_it_fatturapa_in_purchase -#: model:ir.model,name:l10n_it_fatturapa_in_purchase.model_account_invoice_line -msgid "Invoice Line" -msgstr "Riga Fattura" - #. module: l10n_it_fatturapa_in_purchase #: model:ir.model,name:l10n_it_fatturapa_in_purchase.model_purchase_order_line msgid "Purchase Order Line" @@ -35,3 +26,8 @@ msgstr "Riga Ordine d'Acquisto" msgid "To invoice" msgstr "Da fatturare" +#~ msgid "E-Invoice Import File" +#~ msgstr "File importazione fattura elettronica" + +#~ msgid "Invoice Line" +#~ msgstr "Riga Fattura" diff --git a/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot b/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot new file mode 100644 index 000000000000..d1ffd39cec57 --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_fatturapa_in_purchase +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.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_in_purchase +#: model:ir.model,name:l10n_it_fatturapa_in_purchase.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "" + +#. module: l10n_it_fatturapa_in_purchase +#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line_to_invoice +msgid "To invoice" +msgstr "" + diff --git a/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst b/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst index 508619bdc0c5..fe4408ef5727 100644 --- a/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst +++ b/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst @@ -1,5 +1,5 @@ -Integra gli ordini di acquisto con le fatture elettroniche passive. +Integrate purchase orders with supplier electronic invoices. -Con questo modulo è possibile collegare una fattura elettronica passiva ad un ordine di acquisto esistente nel sistema. +With this module you can link a supplier electronic invoice to an existing purchase order. -Così facendo si potrà tracciare se l'ordine è stato fatturato o meno. +In this way, you track whether the order is invoiced or not. diff --git a/l10n_it_fatturapa_in_purchase/readme/USAGE.rst b/l10n_it_fatturapa_in_purchase/readme/USAGE.rst index 6cd67e30aa6a..3dcf4ca85d6d 100644 --- a/l10n_it_fatturapa_in_purchase/readme/USAGE.rst +++ b/l10n_it_fatturapa_in_purchase/readme/USAGE.rst @@ -1 +1 @@ -Nelle fatture elettroniche passive in stato bozza, aprire la riga che si vuole collegare ad una riga di ordine d'acquisto e riempire il campo 'Riga ordine d'acquisto'. +In draft supplier electronic invoices, open the line to be linked to a purchase order line and fill the 'purchase order line' field. diff --git a/l10n_it_fatturapa_in_purchase/static/description/index.html b/l10n_it_fatturapa_in_purchase/static/description/index.html new file mode 100644 index 000000000000..928e85de7758 --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/static/description/index.html @@ -0,0 +1,426 @@ + + + + + + +Fattura Elettronica - Purchase integration + + + +
+

Fattura Elettronica - Purchase integration

+ + +

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

+

Integrate purchase orders with supplier electronic invoices.

+

With this module you can link a supplier electronic invoice to an existing purchase order.

+

In this way, you track whether the order is invoiced or not.

+

Table of contents

+ +
+

Usage

+

In draft supplier electronic invoices, open the line to be linked to a purchase order line and fill the ‘purchase order line’ field.

+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Agile Business Group
  • +
+
+
+

Contributors

+
    +
  • Lorenzo Battistini
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

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.

+
+
+
+ + From 6616afba904aba8445890bb34be763335a78945a Mon Sep 17 00:00:00 2001 From: Sergio Zanchetta Date: Mon, 15 Oct 2018 12:25:59 +0000 Subject: [PATCH 03/16] Translated using Weblate (Italian) Currently translated at 100.0% (2 of 2 strings) Translation: l10n-italy-10.0/l10n-italy-10.0-l10n_it_fatturapa_in_purchase Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-10-0/l10n-italy-10-0-l10n_it_fatturapa_in_purchase/it/ --- l10n_it_fatturapa_in_purchase/i18n/it.po | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/l10n_it_fatturapa_in_purchase/i18n/it.po b/l10n_it_fatturapa_in_purchase/i18n/it.po index e9a419c09925..b95bead99f98 100644 --- a/l10n_it_fatturapa_in_purchase/i18n/it.po +++ b/l10n_it_fatturapa_in_purchase/i18n/it.po @@ -7,19 +7,20 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-09-27 08:55+0000\n" -"PO-Revision-Date: 2018-09-27 08:55+0000\n" -"Last-Translator: <>\n" +"PO-Revision-Date: 2018-10-16 13:00+0000\n" +"Last-Translator: Sergio Zanchetta \n" "Language-Team: \n" -"Language: \n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.2.1\n" #. module: l10n_it_fatturapa_in_purchase #: model:ir.model,name:l10n_it_fatturapa_in_purchase.model_purchase_order_line msgid "Purchase Order Line" -msgstr "Riga Ordine d'Acquisto" +msgstr "Riga ordine di acquisto" #. module: l10n_it_fatturapa_in_purchase #: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line_to_invoice From 15d0382db6f0d62248ce83332aa02098e4e53b27 Mon Sep 17 00:00:00 2001 From: Sergio Zanchetta Date: Sat, 1 Dec 2018 16:56:56 +0100 Subject: [PATCH 04/16] [IMP] l10n_it_fatturapa_in_purchase revamp manifest and README --- l10n_it_fatturapa_in_purchase/README.rst | 29 +++++++++++++++---- l10n_it_fatturapa_in_purchase/__manifest__.py | 7 +++-- l10n_it_fatturapa_in_purchase/i18n/it.po | 6 ++-- .../i18n/l10n_it_fatturapa_in_purchase.pot | 2 +- .../models/purchase_order.py | 2 +- .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 14 +++++++-- .../readme/USAGE.rst | 8 ++++- .../static/description/index.html | 21 ++++++++++---- 9 files changed, 68 insertions(+), 22 deletions(-) diff --git a/l10n_it_fatturapa_in_purchase/README.rst b/l10n_it_fatturapa_in_purchase/README.rst index 147f722ab120..514a3b72d5c4 100644 --- a/l10n_it_fatturapa_in_purchase/README.rst +++ b/l10n_it_fatturapa_in_purchase/README.rst @@ -1,6 +1,6 @@ -========================================== -Fattura Elettronica - Purchase integration -========================================== +================================================================= +Italian Localization - Fattura Elettronica - Purchase integration +================================================================= .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! @@ -25,9 +25,19 @@ Fattura Elettronica - Purchase integration |badge1| |badge2| |badge3| |badge4| |badge5| -Integrate purchase orders with supplier electronic invoices. +**Italiano** -With this module you can link a supplier electronic invoice to an existing purchase order. +Integra gli ordini di acquisto con le fatture elettroniche fornitore. + +Con questo modulo è possibile collegare una fattura elettronica fornitore a un ordine di acquisto esistente. + +In questo modo si tiene traccia della fatturazione o meno dell'ordine. + +**English** + +Integrate purchase orders with supplier electronic bills. + +With this module you can link a supplier electronic bill to an existing purchase order. In this way, you track whether the order is invoiced or not. @@ -39,7 +49,13 @@ In this way, you track whether the order is invoiced or not. Usage ===== -In draft supplier electronic invoices, open the line to be linked to a purchase order line and fill the 'purchase order line' field. +**Italiano** + +Nelle fatture elettroniche fornitore in bozza, aprire la riga da collegare a una riga dell'ordine di acquisto e compilare il campo "Riga ordine di acquisto". + +**English** + +In draft supplier electronic bills, open the line to be linked to a purchase order line and fill in the 'Purchase order line' field. Bug Tracker =========== @@ -63,6 +79,7 @@ Contributors ~~~~~~~~~~~~ * Lorenzo Battistini +* Sergio Zanchetta Maintainers ~~~~~~~~~~~ diff --git a/l10n_it_fatturapa_in_purchase/__manifest__.py b/l10n_it_fatturapa_in_purchase/__manifest__.py index b8627022f5ad..a568ee7c7926 100644 --- a/l10n_it_fatturapa_in_purchase/__manifest__.py +++ b/l10n_it_fatturapa_in_purchase/__manifest__.py @@ -1,15 +1,18 @@ # -*- coding: utf-8 -*- # Copyright 2018 Lorenzo Battistini +# Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). { - 'name': 'Fattura Elettronica - Purchase integration', + 'name': 'Italian Localization - ' + 'Fattura Elettronica - Purchase integration', 'version': '10.0.1.0.0', 'category': 'Hidden', 'author': 'Agile Business Group, ' 'Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/l10n-italy', + 'website': 'https://github.com/OCA/l10n-italy/tree/10.0/' + 'l10n_it_fatturapa_in_purchase', 'license': 'LGPL-3', "depends": [ 'l10n_it_fatturapa_in', diff --git a/l10n_it_fatturapa_in_purchase/i18n/it.po b/l10n_it_fatturapa_in_purchase/i18n/it.po index b95bead99f98..f5c299726ac9 100644 --- a/l10n_it_fatturapa_in_purchase/i18n/it.po +++ b/l10n_it_fatturapa_in_purchase/i18n/it.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-09-27 08:55+0000\n" -"PO-Revision-Date: 2018-10-16 13:00+0000\n" +"PO-Revision-Date: 2018-12-04 16:08+0000\n" "Last-Translator: Sergio Zanchetta \n" "Language-Team: \n" "Language: it\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.2.1\n" +"X-Generator: Weblate 3.3\n" #. module: l10n_it_fatturapa_in_purchase #: model:ir.model,name:l10n_it_fatturapa_in_purchase.model_purchase_order_line @@ -24,7 +24,7 @@ msgstr "Riga ordine di acquisto" #. module: l10n_it_fatturapa_in_purchase #: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line_to_invoice -msgid "To invoice" +msgid "To Invoice" msgstr "Da fatturare" #~ msgid "E-Invoice Import File" diff --git a/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot b/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot index d1ffd39cec57..bd8130977f45 100644 --- a/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot +++ b/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot @@ -20,6 +20,6 @@ msgstr "" #. module: l10n_it_fatturapa_in_purchase #: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line_to_invoice -msgid "To invoice" +msgid "To Invoice" msgstr "" diff --git a/l10n_it_fatturapa_in_purchase/models/purchase_order.py b/l10n_it_fatturapa_in_purchase/models/purchase_order.py index 95bd12c5545c..7fde9d527f8b 100644 --- a/l10n_it_fatturapa_in_purchase/models/purchase_order.py +++ b/l10n_it_fatturapa_in_purchase/models/purchase_order.py @@ -6,7 +6,7 @@ class POLine(models.Model): _inherit = 'purchase.order.line' to_invoice = fields.Boolean( - "To invoice", compute="_compute_to_invoice", store=True) + "To Invoice", compute="_compute_to_invoice", store=True) @api.depends( "invoice_lines.invoice_id.state", "product_qty", "product_uom", diff --git a/l10n_it_fatturapa_in_purchase/readme/CONTRIBUTORS.rst b/l10n_it_fatturapa_in_purchase/readme/CONTRIBUTORS.rst index f52b696bb04f..0fcb0b17c2f9 100644 --- a/l10n_it_fatturapa_in_purchase/readme/CONTRIBUTORS.rst +++ b/l10n_it_fatturapa_in_purchase/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Lorenzo Battistini +* Sergio Zanchetta diff --git a/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst b/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst index fe4408ef5727..3f38e1c90ac4 100644 --- a/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst +++ b/l10n_it_fatturapa_in_purchase/readme/DESCRIPTION.rst @@ -1,5 +1,15 @@ -Integrate purchase orders with supplier electronic invoices. +**Italiano** -With this module you can link a supplier electronic invoice to an existing purchase order. +Integra gli ordini di acquisto con le fatture elettroniche fornitore. + +Con questo modulo è possibile collegare una fattura elettronica fornitore a un ordine di acquisto esistente. + +In questo modo si tiene traccia della fatturazione o meno dell'ordine. + +**English** + +Integrate purchase orders with supplier electronic bills. + +With this module you can link a supplier electronic bill to an existing purchase order. In this way, you track whether the order is invoiced or not. diff --git a/l10n_it_fatturapa_in_purchase/readme/USAGE.rst b/l10n_it_fatturapa_in_purchase/readme/USAGE.rst index 3dcf4ca85d6d..7df277de8bfe 100644 --- a/l10n_it_fatturapa_in_purchase/readme/USAGE.rst +++ b/l10n_it_fatturapa_in_purchase/readme/USAGE.rst @@ -1 +1,7 @@ -In draft supplier electronic invoices, open the line to be linked to a purchase order line and fill the 'purchase order line' field. +**Italiano** + +Nelle fatture elettroniche fornitore in bozza, aprire la riga da collegare a una riga dell'ordine di acquisto e compilare il campo "Riga ordine di acquisto". + +**English** + +In draft supplier electronic bills, open the line to be linked to a purchase order line and fill in the 'Purchase order line' field. diff --git a/l10n_it_fatturapa_in_purchase/static/description/index.html b/l10n_it_fatturapa_in_purchase/static/description/index.html index 928e85de7758..76cec11c603e 100644 --- a/l10n_it_fatturapa_in_purchase/static/description/index.html +++ b/l10n_it_fatturapa_in_purchase/static/description/index.html @@ -4,7 +4,7 @@ -Fattura Elettronica - Purchase integration +Italian Localization - Fattura Elettronica - Purchase integration -
-

Fattura Elettronica - Purchase integration

+
+

Italian Localization - Fattura Elettronica - Purchase integration

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

-

Integrate purchase orders with supplier electronic invoices.

-

With this module you can link a supplier electronic invoice to an existing purchase order.

+

Italiano

+

Integra gli ordini di acquisto con le fatture elettroniche fornitore.

+

Con questo modulo è possibile collegare una fattura elettronica fornitore a un ordine di acquisto esistente.

+

In questo modo si tiene traccia della fatturazione o meno dell’ordine.

+

English

+

Integrate purchase orders with supplier electronic bills.

+

With this module you can link a supplier electronic bill to an existing purchase order.

In this way, you track whether the order is invoiced or not.

Table of contents

@@ -386,7 +391,10 @@

Fattura Elettronica - Purchase integration

Usage

-

In draft supplier electronic invoices, open the line to be linked to a purchase order line and fill the ‘purchase order line’ field.

+

Italiano

+

Nelle fatture elettroniche fornitore in bozza, aprire la riga da collegare a una riga dell’ordine di acquisto e compilare il campo “Riga ordine di acquisto”.

+

English

+

In draft supplier electronic bills, open the line to be linked to a purchase order line and fill in the ‘Purchase order line’ field.

Bug Tracker

@@ -408,6 +416,7 @@

Authors

Contributors

From 5f0d8f816255c1e5a896845c39062ddf1c37ba77 Mon Sep 17 00:00:00 2001 From: Sergio Zanchetta Date: Tue, 4 Dec 2018 21:51:15 +0100 Subject: [PATCH 05/16] [IMP] fatturapa modules, set ITA name and summary (#694) [FIX] l10n_it_fatturapa_in typos in source translation strings --- l10n_it_fatturapa_in_purchase/README.rst | 6 +++--- l10n_it_fatturapa_in_purchase/__manifest__.py | 3 ++- l10n_it_fatturapa_in_purchase/static/description/index.html | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/l10n_it_fatturapa_in_purchase/README.rst b/l10n_it_fatturapa_in_purchase/README.rst index 514a3b72d5c4..fabe02f41a91 100644 --- a/l10n_it_fatturapa_in_purchase/README.rst +++ b/l10n_it_fatturapa_in_purchase/README.rst @@ -1,6 +1,6 @@ -================================================================= -Italian Localization - Fattura Elettronica - Purchase integration -================================================================= +================================================================== +Italian Localization - Fattura Elettronica - Integrazione acquisti +================================================================== .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! diff --git a/l10n_it_fatturapa_in_purchase/__manifest__.py b/l10n_it_fatturapa_in_purchase/__manifest__.py index a568ee7c7926..e38d1eac892b 100644 --- a/l10n_it_fatturapa_in_purchase/__manifest__.py +++ b/l10n_it_fatturapa_in_purchase/__manifest__.py @@ -6,7 +6,8 @@ { 'name': 'Italian Localization - ' - 'Fattura Elettronica - Purchase integration', + 'Fattura Elettronica - Integrazione acquisti', + "summary": "Modulo ponte tra ricezione fatture elettroniche e acquisti", 'version': '10.0.1.0.0', 'category': 'Hidden', 'author': 'Agile Business Group, ' diff --git a/l10n_it_fatturapa_in_purchase/static/description/index.html b/l10n_it_fatturapa_in_purchase/static/description/index.html index 76cec11c603e..03734d02c388 100644 --- a/l10n_it_fatturapa_in_purchase/static/description/index.html +++ b/l10n_it_fatturapa_in_purchase/static/description/index.html @@ -4,7 +4,7 @@ -Italian Localization - Fattura Elettronica - Purchase integration +Italian Localization - Fattura Elettronica - Integrazione acquisti -
-

Italian Localization - Fattura Elettronica - Purchase integration

+
+

Italian Localization - Fattura Elettronica - Integrazione acquisti

-

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

+

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

Italiano

Integra gli ordini di acquisto con le fatture elettroniche fornitore.

Con questo modulo è possibile collegare una fattura elettronica fornitore a un ordine di acquisto esistente.

@@ -401,7 +401,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.

@@ -426,7 +426,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

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_in_purchase/tests/__init__.py b/l10n_it_fatturapa_in_purchase/tests/__init__.py new file mode 100644 index 000000000000..7d340b4d3f59 --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2019 Simone Rubino - Agile Business Group +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_l10n_it_fatturapa_in_purchase diff --git a/l10n_it_fatturapa_in_purchase/tests/data/IT05979361218_008.xml b/l10n_it_fatturapa_in_purchase/tests/data/IT05979361218_008.xml new file mode 100644 index 000000000000..719edafa35f9 --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/tests/data/IT05979361218_008.xml @@ -0,0 +1,93 @@ + + + + + + IT + 05979361218 + + 008 + FPA12 + UFPQ1O + + + + + IT + 05979361218 + + + SOCIETA' ALPHA BETA SRL + + RF02 + + + VIALE ROMA 543B + 07100 + SASSARI + SS + IT + + + + + 80213330584 + + AMMINISTRAZIONE BETA + + + + VIA TORINO 38-B + 00145 + ROMA + RM + IT + + + + + + MARIO + ROSSI + + + + TZ + + + + + TD01 + EUR + 2015-06-22 + FT/2015/0012 + Rif ordine MAPA: --- Nr. Identificativo Ordine 1234567 + + + + + 1 + Prodotto di test al giorno + 1.00 + 10.00 + + SC + 10.00 + + 9.00 + 0.00 + N4 + + + 0.00 + N4 + 9.00 + 0.00 + Operazioni senza addebito imposta regime contribuenti minimi art.27 c.1-2 DL.98/11 + + + + diff --git a/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py b/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py new file mode 100644 index 000000000000..810962551537 --- /dev/null +++ b/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py @@ -0,0 +1,58 @@ +# Copyright 2019 Simone Rubino - Agile Business Group +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from datetime import datetime + +from odoo.addons.l10n_it_fatturapa_in.tests.fatturapa_common import ( + FatturapaCommon) +from odoo.fields import first +from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT + + +class Testl10nItFatturapaInPurchase(FatturapaCommon): + + def setUp(self): + super().setUp() + order_model = self.env['purchase.order'] + self.partner_id = self.env.ref('base.res_partner_1') + self.product_id_1 = self.env.ref('product.product_product_8') + self.order = order_model.create({ + 'name': 'test_po', + 'partner_id': self.partner_id.id, + 'order_line': [ + (0, 0, { + 'name': self.product_id_1.name, + 'product_id': self.product_id_1.id, + 'product_qty': 5.0, + 'product_uom': self.product_id_1.uom_po_id.id, + 'price_unit': 500.0, + 'date_planned': datetime.today().strftime( + DEFAULT_SERVER_DATETIME_FORMAT), + })] + }) + + def test_to_invoice(self): + """Check that `to_invoice` is computed correctly.""" + res = self.run_wizard('test_to_invoice', + 'IT05979361218_008.xml') + invoice_id = res.get('domain')[0][2][0] + invoice = self.invoice_model.browse(invoice_id) + + inv_line = first(invoice.invoice_line_ids) + order_line = first(self.order.order_line) + inv_line.purchase_line_id = order_line + + self.assertFalse(order_line.to_invoice) + + def test_name_get(self): + """Check that `name_get` works properly.""" + res = self.run_wizard('test_name_get', + 'IT05979361218_008.xml') + invoice_id = res.get('domain')[0][2][0] + invoice = self.invoice_model.browse(invoice_id) + + inv_line = first(invoice.invoice_line_ids) + order_line = first(self.order.order_line) + inv_line.purchase_line_id = order_line + + self.assertEqual(order_line.display_name, 'test_po: Large Desk') diff --git a/l10n_it_fatturapa_in_purchase/views/invoice_view.xml b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml index 9200696bbb1c..8b5d8e4b4293 100644 --- a/l10n_it_fatturapa_in_purchase/views/invoice_view.xml +++ b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml @@ -1,4 +1,7 @@ + From c7a599bc01fbe73df92d57312dccc0dc898d5631 Mon Sep 17 00:00:00 2001 From: SimoRubi Date: Fri, 30 Aug 2019 15:46:27 +0200 Subject: [PATCH 09/16] [IMP] l10n_it_fatturapa_in_purchase: Compute to_invoice according to purchase.order._get_invoiced --- l10n_it_fatturapa_in_purchase/README.rst | 6 +++--- l10n_it_fatturapa_in_purchase/__manifest__.py | 1 + l10n_it_fatturapa_in_purchase/i18n/it.po | 4 ++-- .../i18n/l10n_it_fatturapa_in_purchase.pot | 6 +++--- .../models/purchase_order.py | 12 +++++++++++- .../static/description/index.html | 6 +++--- 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/l10n_it_fatturapa_in_purchase/README.rst b/l10n_it_fatturapa_in_purchase/README.rst index 69e63608f615..0cdc9bb8638d 100644 --- a/l10n_it_fatturapa_in_purchase/README.rst +++ b/l10n_it_fatturapa_in_purchase/README.rst @@ -1,6 +1,6 @@ -================================================================== -Italian Localization - Fattura elettronica - Integrazione acquisti -================================================================== +================================================= +ITA - Fattura elettronica - Integrazione acquisti +================================================= .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! diff --git a/l10n_it_fatturapa_in_purchase/__manifest__.py b/l10n_it_fatturapa_in_purchase/__manifest__.py index d3bee575557b..ab2966063c22 100644 --- a/l10n_it_fatturapa_in_purchase/__manifest__.py +++ b/l10n_it_fatturapa_in_purchase/__manifest__.py @@ -1,5 +1,6 @@ # Copyright 2018 Lorenzo Battistini # Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) +# Copyright 2019 Simone Rubino - Agile Business Group # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). diff --git a/l10n_it_fatturapa_in_purchase/i18n/it.po b/l10n_it_fatturapa_in_purchase/i18n/it.po index f6d3668f1a23..ab89a0eb8661 100644 --- a/l10n_it_fatturapa_in_purchase/i18n/it.po +++ b/l10n_it_fatturapa_in_purchase/i18n/it.po @@ -18,7 +18,7 @@ msgstr "" "X-Generator: Weblate 3.3\n" #. module: l10n_it_fatturapa_in_purchase -#: model:ir.ui.view,arch_db:l10n_it_fatturapa_in_purchase.invoice_supplier_form_po_line +#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_in_purchase.invoice_supplier_form_po_line msgid "PO line" msgstr "" @@ -28,7 +28,7 @@ msgid "Purchase Order Line" msgstr "Riga ordine di acquisto" #. module: l10n_it_fatturapa_in_purchase -#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line_to_invoice +#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line__to_invoice msgid "To Invoice" msgstr "Da fatturare" diff --git a/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot b/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot index 3318c9fd5217..bb07dea35ee9 100644 --- a/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot +++ b/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -14,7 +14,7 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_it_fatturapa_in_purchase -#: model:ir.ui.view,arch_db:l10n_it_fatturapa_in_purchase.invoice_supplier_form_po_line +#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_in_purchase.invoice_supplier_form_po_line msgid "PO line" msgstr "" @@ -24,7 +24,7 @@ msgid "Purchase Order Line" msgstr "" #. module: l10n_it_fatturapa_in_purchase -#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line_to_invoice +#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line__to_invoice msgid "To Invoice" msgstr "" diff --git a/l10n_it_fatturapa_in_purchase/models/purchase_order.py b/l10n_it_fatturapa_in_purchase/models/purchase_order.py index 2aa30e83e828..531db864e6e1 100644 --- a/l10n_it_fatturapa_in_purchase/models/purchase_order.py +++ b/l10n_it_fatturapa_in_purchase/models/purchase_order.py @@ -1,8 +1,10 @@ # Copyright 2018 Lorenzo Battistini # Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) +# Copyright 2019 Simone Rubino - Agile Business Group # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo import models, fields, api +from odoo.tools import float_compare class POLine(models.Model): @@ -15,8 +17,16 @@ class POLine(models.Model): "invoice_lines.quantity", "invoice_lines.uom_id" ) def _compute_to_invoice(self): + precision = self.env['decimal.precision'] \ + .precision_get('Product Unit of Measure') for line in self: - if line.product_qty > line.qty_invoiced: + if line.product_id.purchase_method == 'purchase': + qty_to_invoice = line.product_qty + else: + qty_to_invoice = line.qty_received + + if float_compare(line.qty_invoiced, qty_to_invoice, + precision_digits=precision) == -1: line.to_invoice = True else: line.to_invoice = False diff --git a/l10n_it_fatturapa_in_purchase/static/description/index.html b/l10n_it_fatturapa_in_purchase/static/description/index.html index baf6f201bbc8..feee269916e3 100644 --- a/l10n_it_fatturapa_in_purchase/static/description/index.html +++ b/l10n_it_fatturapa_in_purchase/static/description/index.html @@ -4,7 +4,7 @@ -Italian Localization - Fattura elettronica - Integrazione acquisti +ITA - Fattura elettronica - Integrazione acquisti -
-

Italian Localization - Fattura elettronica - Integrazione acquisti

+
+

ITA - Fattura elettronica - Integrazione acquisti

-

Beta License: LGPL-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

Integra gli ordini di acquisto con le fatture elettroniche fornitore.

Con questo modulo è possibile collegare una fattura elettronica fornitore a un ordine di acquisto esistente.

diff --git a/l10n_it_fatturapa_in_purchase/views/invoice_view.xml b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml index 8b5d8e4b4293..944ddf20c31b 100644 --- a/l10n_it_fatturapa_in_purchase/views/invoice_view.xml +++ b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml @@ -1,7 +1,6 @@ + Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) --> From cd8253e8a1bd64f34fdb6dbab5f1f0f4638592fc Mon Sep 17 00:00:00 2001 From: Alfredo Zamora Date: Thu, 22 Apr 2021 14:48:12 +0200 Subject: [PATCH 13/16] [IMP] l10n_it_fatturapa_in_purchase: black, isort, prettier --- l10n_it_fatturapa_in_purchase/__init__.py | 1 - l10n_it_fatturapa_in_purchase/__manifest__.py | 20 +++---- .../models/__init__.py | 1 - .../models/purchase_order.py | 31 ++++++---- .../tests/data/IT05979361218_008.xml | 19 +++--- .../test_l10n_it_fatturapa_in_purchase.py | 59 ++++++++++--------- .../views/invoice_view.xml | 37 ++++++++---- 7 files changed, 96 insertions(+), 72 deletions(-) diff --git a/l10n_it_fatturapa_in_purchase/__init__.py b/l10n_it_fatturapa_in_purchase/__init__.py index a9e3372262cd..0650744f6bc6 100644 --- a/l10n_it_fatturapa_in_purchase/__init__.py +++ b/l10n_it_fatturapa_in_purchase/__init__.py @@ -1,2 +1 @@ - from . import models diff --git a/l10n_it_fatturapa_in_purchase/__manifest__.py b/l10n_it_fatturapa_in_purchase/__manifest__.py index 9d441b062492..62d79c29480a 100644 --- a/l10n_it_fatturapa_in_purchase/__manifest__.py +++ b/l10n_it_fatturapa_in_purchase/__manifest__.py @@ -5,22 +5,20 @@ { - 'name': 'ITA - Fattura elettronica - Integrazione acquisti', + "name": "ITA - Fattura elettronica - Integrazione acquisti", "summary": "Modulo ponte tra ricezione fatture elettroniche e acquisti", - 'version': '12.0.1.0.2', - 'category': 'Hidden', - 'author': 'Agile Business Group, ' - 'Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/l10n-italy/tree/12.0/' - 'l10n_it_fatturapa_in_purchase', - 'license': 'AGPL-3', + "version": "12.0.1.0.2", + "category": "Hidden", + "author": "Agile Business Group, " "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-italy" "l10n_it_fatturapa_in_purchase", + "license": "AGPL-3", "depends": [ - 'l10n_it_fatturapa_in', - 'purchase', + "l10n_it_fatturapa_in", + "purchase", ], "data": [ "views/invoice_view.xml", ], "installable": True, - 'auto_install': True, + "auto_install": True, } diff --git a/l10n_it_fatturapa_in_purchase/models/__init__.py b/l10n_it_fatturapa_in_purchase/models/__init__.py index fa2a61ba9660..9f03530643d8 100644 --- a/l10n_it_fatturapa_in_purchase/models/__init__.py +++ b/l10n_it_fatturapa_in_purchase/models/__init__.py @@ -1,2 +1 @@ - from . import purchase_order diff --git a/l10n_it_fatturapa_in_purchase/models/purchase_order.py b/l10n_it_fatturapa_in_purchase/models/purchase_order.py index 5c7cae3ef75a..50d1c18a3e8d 100644 --- a/l10n_it_fatturapa_in_purchase/models/purchase_order.py +++ b/l10n_it_fatturapa_in_purchase/models/purchase_order.py @@ -2,30 +2,37 @@ # Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) # Copyright 2019 Simone Rubino - Agile Business Group -from odoo import models, fields, api +from odoo import api, fields, models from odoo.tools import float_compare class POLine(models.Model): - _inherit = 'purchase.order.line' - to_invoice = fields.Boolean( - "To Invoice", compute="_compute_to_invoice", store=True) + _inherit = "purchase.order.line" + to_invoice = fields.Boolean("To Invoice", compute="_compute_to_invoice", store=True) @api.depends( - "invoice_lines.invoice_id.state", "product_qty", "product_uom", - "invoice_lines.quantity", "invoice_lines.uom_id" + "invoice_lines.invoice_id.state", + "product_qty", + "product_uom", + "invoice_lines.quantity", + "invoice_lines.uom_id", ) def _compute_to_invoice(self): - precision = self.env['decimal.precision'] \ - .precision_get('Product Unit of Measure') + precision = self.env["decimal.precision"].precision_get( + "Product Unit of Measure" + ) for line in self: - if line.product_id.purchase_method == 'purchase': + if line.product_id.purchase_method == "purchase": qty_to_invoice = line.product_qty else: qty_to_invoice = line.qty_received - if float_compare(line.qty_invoiced, qty_to_invoice, - precision_digits=precision) == -1: + if ( + float_compare( + line.qty_invoiced, qty_to_invoice, precision_digits=precision + ) + == -1 + ): line.to_invoice = True else: line.to_invoice = False @@ -34,6 +41,6 @@ def _compute_to_invoice(self): def name_get(self): res = [] for line in self: - name = "%s: %s" % (line.order_id.name, line.name) + name = "{}: {}".format(line.order_id.name, line.name) res.append((line.id, name)) return res diff --git a/l10n_it_fatturapa_in_purchase/tests/data/IT05979361218_008.xml b/l10n_it_fatturapa_in_purchase/tests/data/IT05979361218_008.xml index 719edafa35f9..cd4629331445 100644 --- a/l10n_it_fatturapa_in_purchase/tests/data/IT05979361218_008.xml +++ b/l10n_it_fatturapa_in_purchase/tests/data/IT05979361218_008.xml @@ -1,8 +1,11 @@ - - + + @@ -64,7 +67,8 @@ xsi:schemaLocation="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1. EUR 2015-06-22 FT/2015/0012 - Rif ordine MAPA: --- Nr. Identificativo Ordine 1234567 + Rif ordine MAPA: --- Nr. Identificativo Ordine 1234567 @@ -86,7 +90,8 @@ xsi:schemaLocation="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1. N4 9.00 0.00 - Operazioni senza addebito imposta regime contribuenti minimi art.27 c.1-2 DL.98/11 + Operazioni senza addebito imposta regime contribuenti minimi art.27 c.1-2 DL.98/11 diff --git a/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py b/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py index 810962551537..2c1c7a2704f7 100644 --- a/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py +++ b/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py @@ -3,39 +3,45 @@ from datetime import datetime -from odoo.addons.l10n_it_fatturapa_in.tests.fatturapa_common import ( - FatturapaCommon) from odoo.fields import first from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT +from odoo.addons.l10n_it_fatturapa_in.tests.fatturapa_common import FatturapaCommon -class Testl10nItFatturapaInPurchase(FatturapaCommon): +class Testl10nItFatturapaInPurchase(FatturapaCommon): def setUp(self): super().setUp() - order_model = self.env['purchase.order'] - self.partner_id = self.env.ref('base.res_partner_1') - self.product_id_1 = self.env.ref('product.product_product_8') - self.order = order_model.create({ - 'name': 'test_po', - 'partner_id': self.partner_id.id, - 'order_line': [ - (0, 0, { - 'name': self.product_id_1.name, - 'product_id': self.product_id_1.id, - 'product_qty': 5.0, - 'product_uom': self.product_id_1.uom_po_id.id, - 'price_unit': 500.0, - 'date_planned': datetime.today().strftime( - DEFAULT_SERVER_DATETIME_FORMAT), - })] - }) + order_model = self.env["purchase.order"] + self.partner_id = self.env.ref("base.res_partner_1") + self.product_id_1 = self.env.ref("product.product_product_8") + self.order = order_model.create( + { + "name": "test_po", + "partner_id": self.partner_id.id, + "order_line": [ + ( + 0, + 0, + { + "name": self.product_id_1.name, + "product_id": self.product_id_1.id, + "product_qty": 5.0, + "product_uom": self.product_id_1.uom_po_id.id, + "price_unit": 500.0, + "date_planned": datetime.today().strftime( + DEFAULT_SERVER_DATETIME_FORMAT + ), + }, + ) + ], + } + ) def test_to_invoice(self): """Check that `to_invoice` is computed correctly.""" - res = self.run_wizard('test_to_invoice', - 'IT05979361218_008.xml') - invoice_id = res.get('domain')[0][2][0] + res = self.run_wizard("test_to_invoice", "IT05979361218_008.xml") + invoice_id = res.get("domain")[0][2][0] invoice = self.invoice_model.browse(invoice_id) inv_line = first(invoice.invoice_line_ids) @@ -46,13 +52,12 @@ def test_to_invoice(self): def test_name_get(self): """Check that `name_get` works properly.""" - res = self.run_wizard('test_name_get', - 'IT05979361218_008.xml') - invoice_id = res.get('domain')[0][2][0] + res = self.run_wizard("test_name_get", "IT05979361218_008.xml") + invoice_id = res.get("domain")[0][2][0] invoice = self.invoice_model.browse(invoice_id) inv_line = first(invoice.invoice_line_ids) order_line = first(self.order.order_line) inv_line.purchase_line_id = order_line - self.assertEqual(order_line.display_name, 'test_po: Large Desk') + self.assertEqual(order_line.display_name, "test_po: Large Desk") diff --git a/l10n_it_fatturapa_in_purchase/views/invoice_view.xml b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml index 944ddf20c31b..80502447adf5 100644 --- a/l10n_it_fatturapa_in_purchase/views/invoice_view.xml +++ b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml @@ -1,4 +1,4 @@ - + @@ -6,15 +6,20 @@ view_invoice_line_form_fatturapa_po_line account.invoice.line - + - - + @@ -23,13 +28,19 @@ invoice_supplier_form_po_line account.invoice - + - - - + + From e2d78d532fc69ca1e3d7e1ac0bc9d78b7d914681 Mon Sep 17 00:00:00 2001 From: Alfredo Zamora Date: Thu, 22 Apr 2021 14:51:32 +0200 Subject: [PATCH 14/16] [MIG] l10n_it_fatturapa_in_purchase: Migration to 14.0 --- l10n_it_fatturapa_in_purchase/README.rst | 10 +++--- l10n_it_fatturapa_in_purchase/__manifest__.py | 4 +-- .../i18n/l10n_it_fatturapa_in_purchase.pot | 21 ++++++++---- .../models/purchase_order.py | 29 ++++------------ .../static/description/index.html | 6 ++-- .../test_l10n_it_fatturapa_in_purchase.py | 22 ++++--------- .../views/invoice_view.xml | 33 +++++++++---------- 7 files changed, 55 insertions(+), 70 deletions(-) diff --git a/l10n_it_fatturapa_in_purchase/README.rst b/l10n_it_fatturapa_in_purchase/README.rst index 70b42d6f3d82..c1f23577ca1c 100644 --- a/l10n_it_fatturapa_in_purchase/README.rst +++ b/l10n_it_fatturapa_in_purchase/README.rst @@ -14,13 +14,13 @@ ITA - Fattura elettronica - Integrazione acquisti :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_in_purchase + :target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_in_purchase :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_in_purchase + :target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_fatturapa_in_purchase :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| @@ -63,7 +63,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. @@ -94,6 +94,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -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_in_purchase/__manifest__.py b/l10n_it_fatturapa_in_purchase/__manifest__.py index 62d79c29480a..aaf72182435f 100644 --- a/l10n_it_fatturapa_in_purchase/__manifest__.py +++ b/l10n_it_fatturapa_in_purchase/__manifest__.py @@ -7,10 +7,10 @@ { "name": "ITA - Fattura elettronica - Integrazione acquisti", "summary": "Modulo ponte tra ricezione fatture elettroniche e acquisti", - "version": "12.0.1.0.2", + "version": "14.0.1.0.0", "category": "Hidden", "author": "Agile Business Group, " "Odoo Community Association (OCA)", - "website": "https://github.com/OCA/l10n-italy" "l10n_it_fatturapa_in_purchase", + "website": "https://github.com/OCA/l10n-italy", "license": "AGPL-3", "depends": [ "l10n_it_fatturapa_in", diff --git a/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot b/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot index bb07dea35ee9..ac422229f18b 100644 --- a/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot +++ b/l10n_it_fatturapa_in_purchase/i18n/l10n_it_fatturapa_in_purchase.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * l10n_it_fatturapa_in_purchase +# * l10n_it_fatturapa_in_purchase # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -14,8 +14,18 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_it_fatturapa_in_purchase -#: model_terms:ir.ui.view,arch_db:l10n_it_fatturapa_in_purchase.invoice_supplier_form_po_line -msgid "PO line" +#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_it_fatturapa_in_purchase +#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line__id +msgid "ID" +msgstr "" + +#. module: l10n_it_fatturapa_in_purchase +#: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line____last_update +msgid "Last Modified on" msgstr "" #. module: l10n_it_fatturapa_in_purchase @@ -27,4 +37,3 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_it_fatturapa_in_purchase.field_purchase_order_line__to_invoice msgid "To Invoice" msgstr "" - diff --git a/l10n_it_fatturapa_in_purchase/models/purchase_order.py b/l10n_it_fatturapa_in_purchase/models/purchase_order.py index 50d1c18a3e8d..9c70a9194031 100644 --- a/l10n_it_fatturapa_in_purchase/models/purchase_order.py +++ b/l10n_it_fatturapa_in_purchase/models/purchase_order.py @@ -2,42 +2,27 @@ # Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) # Copyright 2019 Simone Rubino - Agile Business Group -from odoo import api, fields, models +from odoo import fields, models from odoo.tools import float_compare class POLine(models.Model): _inherit = "purchase.order.line" - to_invoice = fields.Boolean("To Invoice", compute="_compute_to_invoice", store=True) - - @api.depends( - "invoice_lines.invoice_id.state", - "product_qty", - "product_uom", - "invoice_lines.quantity", - "invoice_lines.uom_id", + to_invoice = fields.Boolean( + "To Invoice", compute="_compute_qty_invoiced", store=True ) - def _compute_to_invoice(self): + + def _compute_qty_invoiced(self): + super()._compute_qty_invoiced() precision = self.env["decimal.precision"].precision_get( "Product Unit of Measure" ) for line in self: - if line.product_id.purchase_method == "purchase": - qty_to_invoice = line.product_qty - else: - qty_to_invoice = line.qty_received - - if ( - float_compare( - line.qty_invoiced, qty_to_invoice, precision_digits=precision - ) - == -1 - ): + if float_compare(line.qty_to_invoice, 0.0, precision_digits=precision) == 1: line.to_invoice = True else: line.to_invoice = False - @api.multi def name_get(self): res = [] for line in self: diff --git a/l10n_it_fatturapa_in_purchase/static/description/index.html b/l10n_it_fatturapa_in_purchase/static/description/index.html index 347c2f8c53a5..53cd4bb18ae5 100644 --- a/l10n_it_fatturapa_in_purchase/static/description/index.html +++ b/l10n_it_fatturapa_in_purchase/static/description/index.html @@ -367,7 +367,7 @@

ITA - Fattura elettronica - Integrazione acquisti

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

Integra gli ordini di acquisto con le fatture elettroniche fornitore.

Con questo modulo è possibile collegare una fattura elettronica fornitore a un ordine di acquisto esistente.

@@ -401,7 +401,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.

@@ -426,7 +426,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

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_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py b/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py index 2c1c7a2704f7..cfc3eba808c1 100644 --- a/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py +++ b/l10n_it_fatturapa_in_purchase/tests/test_l10n_it_fatturapa_in_purchase.py @@ -38,21 +38,9 @@ def setUp(self): } ) - def test_to_invoice(self): - """Check that `to_invoice` is computed correctly.""" - res = self.run_wizard("test_to_invoice", "IT05979361218_008.xml") - invoice_id = res.get("domain")[0][2][0] - invoice = self.invoice_model.browse(invoice_id) - - inv_line = first(invoice.invoice_line_ids) - order_line = first(self.order.order_line) - inv_line.purchase_line_id = order_line - - self.assertFalse(order_line.to_invoice) - - def test_name_get(self): - """Check that `name_get` works properly.""" - res = self.run_wizard("test_name_get", "IT05979361218_008.xml") + def test_fatturapa_in_purchase(self): + """Check that `name_get` works properly. verify to_invoice field""" + res = self.run_wizard("test_fatturapa_in_purchase", "IT05979361218_008.xml") invoice_id = res.get("domain")[0][2][0] invoice = self.invoice_model.browse(invoice_id) @@ -61,3 +49,7 @@ def test_name_get(self): inv_line.purchase_line_id = order_line self.assertEqual(order_line.display_name, "test_po: Large Desk") + self.assertFalse(order_line.to_invoice) + order_line.product_id.write({"purchase_method": "purchase"}) + self.order.button_approve() + self.assertTrue(order_line.to_invoice) diff --git a/l10n_it_fatturapa_in_purchase/views/invoice_view.xml b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml index 80502447adf5..d5a86aece802 100644 --- a/l10n_it_fatturapa_in_purchase/views/invoice_view.xml +++ b/l10n_it_fatturapa_in_purchase/views/invoice_view.xml @@ -3,13 +3,10 @@ Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) --> - - view_invoice_line_form_fatturapa_po_line - account.invoice.line - + + view_invoice_form_fatturapa_po_line + account.move + @@ -27,21 +24,23 @@ invoice_supplier_form_po_line - account.invoice - + account.move + - + + + + {'column_invisible': [('parent.move_type', 'not in', ('in_invoice', 'in_refund'))]} From ee5b6b3bbadd40285144c81db2d249b15ac60b96 Mon Sep 17 00:00:00 2001 From: Borruso Date: Fri, 26 May 2023 12:59:18 +0200 Subject: [PATCH 15/16] [IMP] l10n_it_fatturapa_in_purchase: pre-commit stuff --- .../odoo/addons/l10n_it_fatturapa_in_purchase | 1 + setup/l10n_it_fatturapa_in_purchase/setup.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 120000 setup/l10n_it_fatturapa_in_purchase/odoo/addons/l10n_it_fatturapa_in_purchase create mode 100644 setup/l10n_it_fatturapa_in_purchase/setup.py diff --git a/setup/l10n_it_fatturapa_in_purchase/odoo/addons/l10n_it_fatturapa_in_purchase b/setup/l10n_it_fatturapa_in_purchase/odoo/addons/l10n_it_fatturapa_in_purchase new file mode 120000 index 000000000000..3aed3a8463b9 --- /dev/null +++ b/setup/l10n_it_fatturapa_in_purchase/odoo/addons/l10n_it_fatturapa_in_purchase @@ -0,0 +1 @@ +../../../../l10n_it_fatturapa_in_purchase \ No newline at end of file diff --git a/setup/l10n_it_fatturapa_in_purchase/setup.py b/setup/l10n_it_fatturapa_in_purchase/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/l10n_it_fatturapa_in_purchase/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From 7215f1867ad9a0ab4307bca16c0059dbbd4c47cc Mon Sep 17 00:00:00 2001 From: Borruso Date: Fri, 26 May 2023 14:52:27 +0200 Subject: [PATCH 16/16] [MIG] l10n_it_fatturapa_in_purchase: Migration to 16.0 --- l10n_it_fatturapa_in_purchase/README.rst | 14 +++++++------- l10n_it_fatturapa_in_purchase/__manifest__.py | 2 +- .../models/purchase_order.py | 8 ++++---- .../static/description/index.html | 8 ++++---- .../views/invoice_view.xml | 3 +++ 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/l10n_it_fatturapa_in_purchase/README.rst b/l10n_it_fatturapa_in_purchase/README.rst index c1f23577ca1c..bceeefaf071f 100644 --- a/l10n_it_fatturapa_in_purchase/README.rst +++ b/l10n_it_fatturapa_in_purchase/README.rst @@ -14,14 +14,14 @@ ITA - Fattura elettronica - Integrazione acquisti :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/14.0/l10n_it_fatturapa_in_purchase + :target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_fatturapa_in_purchase :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-14-0/l10n-italy-14-0-l10n_it_fatturapa_in_purchase + :target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_fatturapa_in_purchase :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/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/l10n-italy&target_branch=16.0 + :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -63,7 +63,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. @@ -94,6 +94,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -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_in_purchase/__manifest__.py b/l10n_it_fatturapa_in_purchase/__manifest__.py index aaf72182435f..4fed1003651e 100644 --- a/l10n_it_fatturapa_in_purchase/__manifest__.py +++ b/l10n_it_fatturapa_in_purchase/__manifest__.py @@ -7,7 +7,7 @@ { "name": "ITA - Fattura elettronica - Integrazione acquisti", "summary": "Modulo ponte tra ricezione fatture elettroniche e acquisti", - "version": "14.0.1.0.0", + "version": "16.0.1.0.0", "category": "Hidden", "author": "Agile Business Group, " "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-italy", diff --git a/l10n_it_fatturapa_in_purchase/models/purchase_order.py b/l10n_it_fatturapa_in_purchase/models/purchase_order.py index 9c70a9194031..3d9c23b8f338 100644 --- a/l10n_it_fatturapa_in_purchase/models/purchase_order.py +++ b/l10n_it_fatturapa_in_purchase/models/purchase_order.py @@ -8,12 +8,11 @@ class POLine(models.Model): _inherit = "purchase.order.line" - to_invoice = fields.Boolean( - "To Invoice", compute="_compute_qty_invoiced", store=True - ) + + to_invoice = fields.Boolean(compute="_compute_qty_invoiced", store=True) def _compute_qty_invoiced(self): - super()._compute_qty_invoiced() + res = super()._compute_qty_invoiced() precision = self.env["decimal.precision"].precision_get( "Product Unit of Measure" ) @@ -22,6 +21,7 @@ def _compute_qty_invoiced(self): line.to_invoice = True else: line.to_invoice = False + return res def name_get(self): res = [] diff --git a/l10n_it_fatturapa_in_purchase/static/description/index.html b/l10n_it_fatturapa_in_purchase/static/description/index.html index 53cd4bb18ae5..bc47551b30ff 100644 --- a/l10n_it_fatturapa_in_purchase/static/description/index.html +++ b/l10n_it_fatturapa_in_purchase/static/description/index.html @@ -3,7 +3,7 @@ - + ITA - Fattura elettronica - Integrazione acquisti