Skip to content

Commit

Permalink
[MIG] l10n_it_fatturapa_sale: Migration to 14.0 [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMule71 committed Apr 2, 2021
1 parent b22e569 commit 430c547
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 31 deletions.
10 changes: 5 additions & 5 deletions l10n_it_fatturapa_sale/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ ITA - Fattura elettronica - Integrazione vendite
: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_sale
:target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_sale
: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_sale
:target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_fatturapa_sale
: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|
Expand All @@ -44,7 +44,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/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 <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_sale%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_sale%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand All @@ -69,6 +69,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 <https://github.com/OCA/l10n-italy/tree/12.0/l10n_it_fatturapa_sale>`_ project on GitHub.
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_sale>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions l10n_it_fatturapa_sale/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"name": "ITA - Fattura elettronica - Integrazione vendite",
"summary": "Aggiunge alcuni dati per la "
"fatturazione elettronica nell'ordine di vendita",
"version": "12.0.1.1.1",
"website": "https://github.com/OCA/l10n-italy" "12.0/l10n_it_fatturapa_sale",
"version": "14.0.1.0.0",
"website": "https://github.com/OCA/l10n-italy" "14.0/l10n_it_fatturapa_sale",
"author": "Agile Business Group, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Hidden",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Copyright 2020 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, models
from odoo import models


class AccountInvoice(models.Model):
_inherit = "account.invoice"
class AccountMove(models.Model):
_inherit = "account.move"

@api.multi
def unlink(self):
related_documents = self.mapped("related_documents")
res = super().unlink()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Copyright 2020 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, models
from odoo import models


class AccountInvoiceLine(models.Model):
_inherit = "account.invoice.line"
class AccountMoveLine(models.Model):
_inherit = "account.move.line"

@api.multi
def unlink(self):
related_documents = self.mapped("related_documents")
res = super().unlink()
Expand Down
3 changes: 1 addition & 2 deletions l10n_it_fatturapa_sale/models/related_document.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2020 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models
from odoo import fields, models


class FatturapaRelatedDocumentType(models.Model):
Expand All @@ -26,7 +26,6 @@ class FatturapaRelatedDocumentType(models.Model):
readonly=True,
)

@api.multi
def check_unlink(self):
"""
Related documents only make sense if they are related (linked)
Expand Down
4 changes: 1 addition & 3 deletions l10n_it_fatturapa_sale/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2020 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models
from odoo import fields, models


class SaleOrder(models.Model):
Expand All @@ -15,7 +15,6 @@ class SaleOrder(models.Model):
groups="account.group_account_user",
)

@api.multi
def _finalize_invoices(self, invoices, references):
res = super()._finalize_invoices(invoices, references)
# To each invoice, link the documents of the related order
Expand All @@ -33,7 +32,6 @@ def _finalize_invoices(self, invoices, references):
)
return res

@api.multi
def unlink(self):
related_documents = self.mapped("related_documents")
res = super().unlink()
Expand Down
5 changes: 1 addition & 4 deletions l10n_it_fatturapa_sale/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2020 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models
from odoo import fields, models


class SaleOrderLine(models.Model):
Expand All @@ -16,12 +16,10 @@ class SaleOrderLine(models.Model):
)
admin_ref = fields.Char(
string="Admin. ref.",
size=20,
copy=False,
groups="account.group_account_user",
)

@api.multi
def _prepare_invoice_line(self, qty):
self.ensure_one()
invoice_line_vals = super()._prepare_invoice_line(qty)
Expand Down Expand Up @@ -56,7 +54,6 @@ def _prepare_invoice_line(self, qty):
)
return invoice_line_vals

@api.multi
def unlink(self):
related_documents = self.mapped("related_documents")
res = super().unlink()
Expand Down
8 changes: 4 additions & 4 deletions l10n_it_fatturapa_sale/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>ITA - Fattura elettronica - Integrazione vendite</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">ITA - Fattura elettronica - Integrazione vendite</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/12.0/l10n_it_fatturapa_sale"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-italy-12-0/l10n-italy-12-0-l10n_it_fatturapa_sale"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/122/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_sale"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_fatturapa_sale"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/122/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><strong>Italiano</strong></p>
<p>Questo modulo permette di impostare i documenti correlati e il riferimento amministrazione nell’ordine di vendita (o le sue righe) e propagarli alla fattura (o le sue righe) durante la creazione della fattura.</p>
<p><strong>English</strong></p>
Expand All @@ -388,7 +388,7 @@ <h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_sale%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_sale%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -406,7 +406,7 @@ <h2><a class="toc-backref" href="#id4">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/12.0/l10n_it_fatturapa_sale">OCA/l10n-italy</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_sale">OCA/l10n-italy</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions l10n_it_fatturapa_sale/tests/test_fatturapa_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_create_invoice(self):
# Check the invoice
invoice_ids = sale_order.action_invoice_create()
self.assertEqual(len(invoice_ids), 1, "Multiple invoices for sale order")
invoice = self.env["account.invoice"].browse(invoice_ids)
invoice = self.env["account.move"].browse(invoice_ids)
self.assertEqual(invoice.related_documents, sale_order.related_documents)

# Check the invoice line
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_create_invoice_multiple(self):
# Check the invoice
invoice_ids = sale_orders.action_invoice_create()
self.assertEqual(len(invoice_ids), 1, "Multiple invoices for sale order")
invoice = self.env["account.invoice"].browse(invoice_ids)
invoice = self.env["account.move"].browse(invoice_ids)
self.assertEqual(
invoice.related_documents, sale_orders.mapped("related_documents")
)
Expand All @@ -112,7 +112,7 @@ def test_keep_document(self):

invoice_ids = sale_order.action_invoice_create()
self.assertEqual(len(invoice_ids), 1, "Multiple invoices for sale order")
invoice = self.env["account.invoice"].browse(invoice_ids)
invoice = self.env["account.move"].browse(invoice_ids)
related_documents = invoice.related_documents

# Delete the invoice: the related document persists
Expand Down

0 comments on commit 430c547

Please sign in to comment.