Skip to content

Commit a267d1c

Browse files
committed
[FIX] account_payment_order: Manager can create partner bank accounts
1 parent 311be5c commit a267d1c

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

account_payment_order/security/payment_security.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
/>
1010
<field name="category_id" ref="base.module_category_usability" />
1111
</record>
12+
13+
<record id="account.group_account_manager" model="res.groups">
14+
<field
15+
name="implied_ids"
16+
eval="[
17+
Command.link(ref('group_account_payment')),
18+
]"
19+
/>
20+
</record>
1221
</data>
1322
<data noupdate="1">
1423
<record id="account_payment_order_company_rule" model="ir.rule">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from . import test_payment_mode
22
from . import test_bank
3+
from . import test_partner_bank
34
from . import test_payment_order_inbound
45
from . import test_payment_order_outbound
56
from . import test_account_payment
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2025 Simone Rubino
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo.tests import Form, tagged
5+
6+
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
7+
8+
9+
@tagged("post_install", "-at_install")
10+
class TestPartnerBank(AccountTestInvoicingCommon):
11+
def test_manager_create(self):
12+
"""An Account manager can create partner bank accounts."""
13+
# Arrange
14+
user = self.env.user
15+
partner_form = Form(self.env["res.partner"])
16+
partner_form.name = "Test Partner"
17+
partner = partner_form.save()
18+
# pre-condition
19+
self.assertTrue(user.has_group("account.group_account_manager"))
20+
21+
# Act
22+
partner_bank_form = Form(self.env["res.partner.bank"])
23+
partner_bank_form.acc_number = "Test Account Number"
24+
partner_bank_form.partner_id = partner
25+
partner_bank = partner_bank_form.save()
26+
27+
# Assert
28+
self.assertTrue(partner_bank)

0 commit comments

Comments
 (0)