Skip to content

Commit

Permalink
[MIG] account_invoice_view_payment: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anusriNPS committed Nov 25, 2024
1 parent 352ca40 commit 099f5f2
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 35 deletions.
10 changes: 5 additions & 5 deletions account_invoice_view_payment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Account Invoice View Payment
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/15.0/account_invoice_view_payment
:target: https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_view_payment
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-15-0/account-invoicing-15-0-account_invoice_view_payment
:target: https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_invoice_view_payment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=15.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -66,7 +66,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_view_payment%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_view_payment%0Aversion:%2016.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 Down Expand Up @@ -100,6 +100,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/account-invoicing <https://github.com/OCA/account-invoicing/tree/15.0/account_invoice_view_payment>`_ project on GitHub.
This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_view_payment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion account_invoice_view_payment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Account Invoice View Payment",
"summary": "Access to the payment from an invoice",
"version": "15.0.1.1.1",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"website": "https://github.com/OCA/account-invoicing",
"author": "ForgeFlow, " "Odoo Community Association (OCA)",
Expand Down
6 changes: 3 additions & 3 deletions account_invoice_view_payment/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Account Invoice View Payment</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0cca4874ac9c8da20233b28a13917e68e208348a2a0575f94b7bf241aa5bcea2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/account-invoicing/tree/15.0/account_invoice_view_payment"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-15-0/account-invoicing-15-0-account_invoice_view_payment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_view_payment"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_invoice_view_payment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows users to access directly to the payment from an invoice
when registering a payment or afterwards.</p>
<p>The option to open the payment when it’s being registered is useful
Expand Down Expand Up @@ -413,7 +413,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-invoicing/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 to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_view_payment%0Aversion:%2015.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/account-invoicing/issues/new?body=module:%20account_invoice_view_payment%0Aversion:%2016.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 Down Expand Up @@ -443,7 +443,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">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/account-invoicing/tree/15.0/account_invoice_view_payment">OCA/account-invoicing</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_view_payment">OCA/account-invoicing</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
Original file line number Diff line number Diff line change
Expand Up @@ -11,65 +11,68 @@ class TestAccountInvoiceViewPayment(TransactionCase):
Tests for Account Invoice View Payment.
"""

def setUp(self):
super(TestAccountInvoiceViewPayment, self).setUp()
group_ids = self.env.ref("account.group_account_invoice").ids
self.test_user_1 = self.env["res.users"].create(
@classmethod
def setUpClass(cls):
super(TestAccountInvoiceViewPayment, cls).setUpClass()
group_ids = cls.env.ref("account.group_account_invoice").ids
cls.test_user_1 = cls.env["res.users"].create(
{"name": "John", "login": "test1", "groups_id": [(6, 0, group_ids)]}
)
self.par_model = self.env["res.partner"]
self.acc_model = self.env["account.account"]
self.inv_model = self.env["account.move"]
self.inv_line_model = self.env["account.move.line"]
self.pay_model = self.env["account.payment"]
self.reg_pay_model = self.env["account.payment.register"]

self.cash = self.env["account.journal"].create(
cls.par_model = cls.env["res.partner"]
cls.acc_model = cls.env["account.account"]
cls.inv_model = cls.env["account.move"]
cls.inv_line_model = cls.env["account.move.line"]
cls.pay_model = cls.env["account.payment"]
cls.reg_pay_model = cls.env["account.payment.register"]

cls.cash = cls.env["account.journal"].create(
{"name": "Cash Test", "type": "cash", "code": "CT"}
)
self.payment_method_manual_in = self.env.ref(
cls.payment_method_manual_in = cls.env.ref(
"account.account_payment_method_manual_in"
)

self.partner1 = self._create_partner()
cls.partner1 = cls._create_partner()

self.invoice_account = self.acc_model.search(
cls.invoice_account = cls.acc_model.search(
[
(
"user_type_id",
"=",
self.env.ref("account.data_account_type_revenue").id,
cls.env.ref("account.data_account_type_revenue").id,
)
],
limit=1,
)

self.invoice1 = self._create_invoice(self.partner1, "out_invoice")
self.invoice2 = self._create_invoice(self.partner1, "in_invoice")
self.invoice3 = self._create_invoice(self.partner1, "in_invoice")
self.invoice2.invoice_date = self.invoice3.invoice_date = fields.Date.today()
cls.invoice1 = cls._create_invoice(cls.partner1, "out_invoice")
cls.invoice2 = cls._create_invoice(cls.partner1, "in_invoice")
cls.invoice3 = cls._create_invoice(cls.partner1, "in_invoice")
cls.invoice2.invoice_date = cls.invoice3.invoice_date = fields.Date.today()

def _create_partner(self):
partner = self.par_model.create(
@classmethod
def _create_partner(cls):
partner = cls.par_model.create(
{"name": "Test Partner", "company_type": "company"}
)
return partner

def _create_invoice(self, partner, invoice_type):
@classmethod
def _create_invoice(cls, partner, invoice_type):
inv_line = [
(
0,
0,
{
"product_id": self.env.ref("product.product_product_8").id,
"product_id": cls.env.ref("product.product_product_8").id,
"name": "Test Invoice Line",
"account_id": self.invoice_account.id,
"account_id": cls.invoice_account.id,
"quantity": 1.0,
"price_unit": 3.0,
},
)
]
invoice = self.inv_model.create(
invoice = cls.inv_model.create(
{
"partner_id": partner.id,
"move_type": invoice_type,
Expand Down

0 comments on commit 099f5f2

Please sign in to comment.