Skip to content

Commit

Permalink
[MIG] account_statement_import_move_line: Migration to version 17.0
Browse files Browse the repository at this point in the history
TT51242
  • Loading branch information
pilarvargas-tecnativa committed Oct 28, 2024
1 parent 8f6b3e3 commit bb215d7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
4 changes: 2 additions & 2 deletions account_statement_import_move_line/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

{
"name": "Bank statement import move lines",
"version": "15.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Accounting",
"summary": "Import journal items into bank statement",
"author": "Tecnativa, " "Odoo Community Association (OCA)",
"maintainers": ["pedrobaeza"],
"website": "https://github.com/OCA/bank-statement-import",
"depends": ["account"],
"depends": ["account_statement_base"],
"data": [
"security/ir.model.access.csv",
"wizards/account_statement_line_create_view.xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,23 @@
class TestAccountBankStatementImportMoveLine(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestAccountBankStatementImportMoveLine, cls).setUpClass()

cls.account_type = cls.env["account.account.type"].create(
{"name": "Test Account Type", "type": "other", "internal_group": "asset"}
)

super().setUpClass()
cls.a_receivable = cls.env["account.account"].create(
{
"code": "TAA",
"name": "Test Receivable Account",
"internal_type": "receivable",
"user_type_id": cls.account_type.id,
"account_type": "asset_receivable",
}
)
cls.partner = cls.env["res.partner"].create(
{"name": "Test Partner 2", "parent_id": False}
)
cls.partner = cls.env["res.partner"].create({"name": "Test Partner 2"})
cls.journal = cls.env["account.journal"].create(
{"name": "Test Journal", "type": "sale", "code": "TJS0"}
{"name": "Test Journal Sale", "type": "sale", "code": "TJS0"}
)
cls.journal_bank = cls.env["account.journal"].create(
{"name": "Test Journal Bank", "type": "bank", "code": "TJB0"}
)
cls.invoice = cls.env["account.move"].create(
{
"name": "Test Invoice 3",
"partner_id": cls.partner.id,
"move_type": "out_invoice",
"journal_id": cls.journal.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@
<record id="view_bank_statement_form" model="ir.ui.view">
<field name="name">account.bank.statement.form.population</field>
<field name="model">account.bank.statement</field>
<field name="inherit_id" ref="account.view_bank_statement_form" />
<field
name="inherit_id"
ref="account_statement_base.view_bank_statement_form"
/>
<field name="arch" type="xml">
<field name="all_lines_reconciled" position="after">
<button name="open_entries" position="after">
<button
name="%(account_statement_line_create_action)d"
string="Import Journal Items"
type="action"
class="oe_highlight"
attrs="{'invisible':[('state', '!=', 'open')]}"
class="oe_stat_button"
icon="fa-upload"
invisible="not id"
groups="account.group_account_user"
/>
</field>
>
<div class="o_stat_info">
<span class="o_stat_text">Import Journal Items</span>
</div>
</button>
</button>
</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ def _prepare_move_line_domain(self):
self.ensure_one()
domain = [
("reconciled", "=", False),
("account_id.internal_type", "in", ("payable", "receivable")),
(
"account_id.account_type",
"in",
("asset_receivable", "liability_payable"),
),
("company_id", "=", self.env.company.id),
]
if self.journal_ids:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<field name="date_type" />
<field
name="move_date"
attrs="{'required': [('date_type', '=', 'move')],
'invisible': [('date_type', '!=', 'move')]}"
required="date_type == 'move'"
invisible="date_type != 'move'"
/>
<field
name="due_date"
attrs="{'required': [('date_type', '=', 'due')],
'invisible': [('date_type', '!=', 'due')]}"
required="date_type == 'due'"
invisible="date_type != 'due'"
/>
<field
name="journal_ids"
Expand Down

0 comments on commit bb215d7

Please sign in to comment.