Skip to content

Commit 2fe84cf

Browse files
[MIG] account_invoice_block_payment: Migration to 18.0
1 parent 8dafc35 commit 2fe84cf

File tree

8 files changed

+61
-14
lines changed

8 files changed

+61
-14
lines changed

account_invoice_block_payment/README.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Account Invoice Payment Block
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:c3e9bc1d75a9bd7ebb64df35b4a09230431ec8c6115aa7ac5a7219c4e3b4dc89
10+
!! source digest: sha256:189d9f5529777ab9e032d084ce9e6e199d5e9adff15ab8c7708968b73f3e5a56
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -68,6 +68,9 @@ Contributors
6868
------------
6969

7070
- Victor Vermot-Petit-Outhenin <[email protected]>
71+
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__
72+
73+
- Bhavesh Heliconia
7174

7275
Maintainers
7376
-----------

account_invoice_block_payment/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{
55
"name": "Account Invoice Payment Block",
6-
"version": "16.0.1.0.0",
6+
"version": "18.0.1.0.0",
77
"summary": "Module to block payment of invoices",
88
"author": "Camptocamp, Odoo Community Association (OCA)",
99
"website": "https://github.com/OCA/account-invoicing",

account_invoice_block_payment/i18n/account_invoice_block_payment.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
msgid ""
66
msgstr ""
7-
"Project-Id-Version: Odoo Server 16.0\n"
7+
"Project-Id-Version: Odoo Server 17.0\n"
88
"Report-Msgid-Bugs-To: \n"
99
"Last-Translator: \n"
1010
"Language-Team: \n"

account_invoice_block_payment/i18n/it.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#
55
msgid ""
66
msgstr ""
7-
"Project-Id-Version: Odoo Server 16.0\n"
7+
"Project-Id-Version: Odoo Server 17.0\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"PO-Revision-Date: 2024-09-05 10:06+0000\n"
9+
"PO-Revision-Date: 2024-09-04 10:06+0000\n"
1010
"Last-Translator: mymage <[email protected]>\n"
1111
"Language-Team: none\n"
1212
"Language: it\n"
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
- Victor Vermot-Petit-Outhenin \<[email protected]\>
1+
- Victor Vermot-Petit-Outhenin \<<[email protected]>\>
2+
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
3+
- Bhavesh Heliconia

account_invoice_block_payment/static/description/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ <h1 class="title">Account Invoice Payment Block</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:c3e9bc1d75a9bd7ebb64df35b4a09230431ec8c6115aa7ac5a7219c4e3b4dc89
370+
!! source digest: sha256:189d9f5529777ab9e032d084ce9e6e199d5e9adff15ab8c7708968b73f3e5a56
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372372
<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/18.0/account_invoice_block_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-18-0/account-invoicing-18-0-account_invoice_block_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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<div class="section" id="block-payment-of-invoices">
@@ -410,6 +410,10 @@ <h1>Authors</h1>
410410
<h1>Contributors</h1>
411411
<ul class="simple">
412412
<li>Victor Vermot-Petit-Outhenin &lt;<a class="reference external" href="mailto:victor.vermot&#64;camptocamp.com">victor.vermot&#64;camptocamp.com</a>&gt;</li>
413+
<li><a class="reference external" href="https://www.heliconia.io">Heliconia Solutions Pvt. Ltd.</a><ul>
414+
<li>Bhavesh Heliconia</li>
415+
</ul>
416+
</li>
413417
</ul>
414418
</div>
415419
<div class="section" id="maintainers">

account_invoice_block_payment/tests/test_account_block_payment.py

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,50 @@
11
# Copyright 2023 Camptocamp SA
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
3-
3+
from odoo import Command
44
from odoo.exceptions import UserError
5-
from odoo.tests import TransactionCase
5+
6+
from odoo.addons.base.tests.common import BaseCommon
67

78

8-
class TestAccountInvoice(TransactionCase):
9+
class TestAccountInvoice(BaseCommon):
910
@classmethod
1011
def setUpClass(cls):
1112
super().setUpClass()
13+
cls.customer = cls.env["res.partner"].create(
14+
{
15+
"name": "Test Customer",
16+
"customer_rank": 1,
17+
}
18+
)
19+
cls.product = cls.env["product.product"].create(
20+
{
21+
"name": "Test Product",
22+
"type": "service",
23+
"list_price": 100.0,
24+
}
25+
)
1226
# create an invoice with its payment unblocked
13-
cls.account_move = cls.env["account.move"].create({"payment_blocked": False})
27+
cls.account_move = cls.env["account.move"].create(
28+
{
29+
"payment_blocked": False,
30+
"partner_id": cls.customer.id,
31+
"move_type": "out_invoice",
32+
"invoice_line_ids": [
33+
Command.create(
34+
{
35+
"product_id": cls.product.id,
36+
"quantity": 1,
37+
"price_unit": 100.0,
38+
},
39+
)
40+
],
41+
}
42+
)
1443

1544
def test_payment_blocked(self):
1645
# Blocked boolean set to true rises a ValidationError
1746
self.assertFalse(self.account_move.payment_blocked)
47+
self.account_move.action_post()
1848
self.account_move.payment_blocked = True
1949
with self.assertRaises(UserError):
2050
self.account_move.action_register_payment()

account_invoice_block_payment/views/account_move.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" ?>
22
<!-- Copyright 2023 Camptocamp SA
33
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) -->
44
<odoo>
@@ -9,8 +9,16 @@
99
<field name="payment_reference" position="after">
1010
<field
1111
name="payment_blocked"
12-
attrs="{'invisible': ['|', '|', ('state', '!=', 'posted'), ('payment_state', 'not in', ('not_paid', 'partial')),
13-
('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}"
12+
invisible="state != 'posted'
13+
or payment_state not in ('not_paid', 'partial')
14+
or move_type not in (
15+
'out_invoice',
16+
'out_refund',
17+
'in_invoice',
18+
'in_refund',
19+
'out_receipt',
20+
'in_receipt'
21+
)"
1422
/>
1523
</field>
1624
</field>

0 commit comments

Comments
 (0)