Skip to content

Commit

Permalink
[MIG] account_statement_import_move_line : Migration to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis D. Lafaurie committed May 20, 2022
1 parent 42fb897 commit ab50b8c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
1 change: 1 addition & 0 deletions account_statement_import_move_line/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"website": "https://github.com/OCA/bank-statement-import",
"depends": ["account"],
"data": [
"security/ir.model.access.csv",
"wizards/account_statement_line_create_view.xml",
"views/account_bank_statement_view.xml",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ def _prepare_statement_line_vals(self, statement):
"amount": amount,
"partner_id": self.partner_id.id,
"statement_id": statement.id,
"ref": self.ref,
"payment_ref": self.move_id.payment_reference,
"date": self.date_maturity,
"amount_currency": self.amount_currency,
"currency_id": self.currency_id.id,
}
if self.currency_id != self.env.company.currency_id:
vals["foreign_currency_id"] = self.currency_id.id
vals["amount_currency"] = self.amount_currency
return vals

def create_statement_line_from_move_line(self, statement):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_statement_line_create,access_account_statement_line_create,model_account_statement_line_create,base.group_user,1,1,1,1
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,32 @@ def setUpClass(cls):
"user_type_id": cls.account_type.id,
}
)
cls.a_suspense = cls.env["account.account"].create(
{
"code": "TSA",
"name": "Test Suspense Account",
"user_type_id": cls.account_type.id,
}
)
cls.partner = cls.env["res.partner"].create(
{"name": "Test Partner 2", "parent_id": False}
)
cls.journal = cls.env["account.journal"].create(
{"name": "Test Journal", "type": "sale", "code": "TJS0"}
)
cls.bank_journal = cls.env["account.journal"].create(
{
"name": "Bank Journal - (test)",
"code": "TBNK",
"type": "bank",
"suspense_account_id": cls.a_suspense.id,
}
)
cls.invoice = cls.env["account.move"].create(
{
"name": "Test Invoice 3",
"partner_id": cls.partner.id,
"type": "out_invoice",
"move_type": "out_invoice",
"journal_id": cls.journal.id,
"invoice_line_ids": [
(
Expand All @@ -49,11 +64,11 @@ def setUpClass(cls):
}
)
cls.statement = cls.env["account.bank.statement"].create(
{"journal_id": cls.journal.id}
{"journal_id": cls.bank_journal.id}
)

def test_global(self):
self.invoice.post()
self.invoice.action_post()
self.assertTrue(self.invoice.id)
wizard_o = self.env["account.statement.line.create"]
context = wizard_o._context.copy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ def _prepare_move_line_domain(self):
paylines = self.env["account.payment"].search(
[
("state", "in", ("draft", "posted", "sent")),
("move_line_ids", "!=", False),
("line_ids", "!=", False),
]
)
if paylines:
move_in_payment_ids = paylines.mapped("move_line_ids.id")
move_in_payment_ids = paylines.mapped("line_ids.id")
domain += [("id", "not in", move_in_payment_ids)]
return domain

Expand Down

This file was deleted.

0 comments on commit ab50b8c

Please sign in to comment.