Skip to content

Commit

Permalink
TA#66819 [16.0][FIX] account_negative_debit_credit : unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lanto-razafindrabe committed Jul 1, 2024
1 parent af03155 commit c9edd34
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions account_negative_debit_credit/tests/test_account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from datetime import datetime
from odoo.tests import common
from odoo.tests import common, new_test_user

Check warning on line 5 in account_negative_debit_credit/tests/test_account_move_line.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

account_negative_debit_credit/tests/test_account_move_line.py#L5

Unused new_test_user imported from odoo.tests
from odoo.tests.common import Form

Check warning on line 6 in account_negative_debit_credit/tests/test_account_move_line.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

account_negative_debit_credit/tests/test_account_move_line.py#L6

Unused Form imported from odoo.tests.common


class TestAccountMoveLine(common.SavepointCase):
Expand All @@ -22,15 +23,15 @@ def setUpClass(cls):
{
"account_type": "expense",
"name": "Revenus",
"code": "400001 - test",
"code": "400001",
}
)

cls.asset = cls.env["account.account"].create(
{
"account_type": "asset_current",
"name": "Assets",
"code": "100001 - test",
"code": "100001",
}
)

Expand Down Expand Up @@ -143,16 +144,18 @@ def test_write(self):
),
]
)
lines = move.line_ids.sorted()
move.write(
{
"line_ids": [
(1, move.line_ids[0].id, {"debit": -10, "credit": 0}),
(1, move.line_ids[1].id, {"debit": 0, "credit": -10}),
]
(1, lines[0].id, {"credit": -10}),
(1, lines[1].id, {"debit": -10}),
],
}
)
assert move.line_ids[0].credit == 10
assert move.line_ids[1].debit == 10

assert move.line_ids[1].credit == 10
assert move.line_ids[0].debit == 10

def _create_move(self, line_vals):
return self.env["account.move"].create(
Expand Down

0 comments on commit c9edd34

Please sign in to comment.