-
-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] bank_statement_check_number: Migration to 16.0
- Loading branch information
1 parent
0447cce
commit 0b519f1
Showing
6 changed files
with
62 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_check_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from odoo.tests import tagged | ||
|
||
from odoo.addons.account.tests.common import AccountTestInvoicingCommon | ||
|
||
|
||
@tagged("post_install", "-at_install") | ||
class TestCheckNumber(AccountTestInvoicingCommon): | ||
@classmethod | ||
def setUpClass(cls, chart_template_ref=None): | ||
super().setUpClass(chart_template_ref=chart_template_ref) | ||
|
||
cls.bank_journal = cls.company_data["default_journal_bank"] | ||
cls.currency = cls.currency_data["currency"] | ||
cls.statement = cls.env["account.bank.statement"].create( | ||
{ | ||
"name": "test_statement", | ||
"line_ids": [ | ||
( | ||
0, | ||
0, | ||
{ | ||
"date": "2019-01-01", | ||
"payment_ref": "line_1", | ||
"partner_id": cls.partner_a.id, | ||
"foreign_currency_id": cls.currency.id, | ||
"journal_id": cls.bank_journal.id, | ||
"amount": 1250.0, | ||
"amount_currency": 2500.0, | ||
"check_number": "111", | ||
}, | ||
), | ||
], | ||
} | ||
) | ||
cls.statement_line = cls.statement.line_ids | ||
|
||
def test_01_check_number(self): | ||
|
||
self.assertEqual(self.statement_line.check_number, "111") |
40 changes: 19 additions & 21 deletions
40
bank_statement_check_number/views/account_bank_statement_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="view_bank_statement_form" model="ir.ui.view"> | ||
<record id="view_bank_statement_tree" model="ir.ui.view"> | ||
<field name="name">account.bank.statement.form</field> | ||
<field name="model">account.bank.statement</field> | ||
<field name="inherit_id" ref="account.view_bank_statement_form" /> | ||
<field name="model">account.bank.statement.line</field> | ||
<field | ||
name="inherit_id" | ||
ref="account_statement_base.account_bank_statement_line_tree" | ||
/> | ||
<field name="arch" type="xml"> | ||
<xpath | ||
expr="//field[@name='line_ids']/tree/field[@name='date']" | ||
position="after" | ||
> | ||
<field | ||
name="check_number" | ||
optional="show" | ||
attrs="{'readonly': [('parent.state', '!=', 'open')]}" | ||
/> | ||
</xpath> | ||
<field name="date" position="after"> | ||
<field name="check_number" optional="show" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record id="view_bank_statement_line_tree" model="ir.ui.view"> | ||
<field name="name">account.bank.statement.line.tree</field> | ||
<record id="account_bank_statement_line_form" model="ir.ui.view"> | ||
<field name="name">account.bank.statement.form</field> | ||
<field name="model">account.bank.statement.line</field> | ||
<field name="priority">8</field> | ||
<field name="inherit_id" ref="account.view_bank_statement_line_tree" /> | ||
<field | ||
name="inherit_id" | ||
ref="account_statement_base.account_bank_statement_line_form" | ||
/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='date']" position="after"> | ||
<field name="check_number" /> | ||
</xpath> | ||
<field name="date" position="after"> | ||
<field name="check_number" optional="show" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
odoo-addon-account_move_line_check_number@git+https://github.com/OCA/account-financial-tools.git@refs/pull/1669/head#subdirectory=setup/account_move_line_check_number |