Skip to content

Commit

Permalink
TA#72332 [14.0][FIX] account_check_deposit_enhanced (#231)
Browse files Browse the repository at this point in the history
- TA#72332 [14.0][FIX] account_check_deposit_enhanced
  • Loading branch information
abenzbiria authored Nov 27, 2024
1 parent 47a6baf commit 22f774c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion account_check_deposit_enhanced/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Account Check Deposit Enhanced",
"version": "1.0.0",
"version": "1.1.0",
"category": "Accounting",
"license": "AGPL-3",
"summary": "Enhance check deposits",
Expand Down
11 changes: 6 additions & 5 deletions account_check_deposit_enhanced/models/account_check_deposit.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# © 2022 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import api, models
from odoo import models


class AccountCheckDeposit(models.Model):
_inherit = "account.check.deposit"

@api.model
def _prepare_counterpart_move_lines_vals(self, *args, **kwargs):
vals = super()._prepare_counterpart_move_lines_vals(*args, **kwargs)
vals["partner_id"] = self.company_id.partner_id.id
def _prepare_move_vals(self):
vals = super()._prepare_move_vals()
for line in vals["line_ids"]:
if 'debit' in line[2].keys():
line[2]['partner_id'] = self.company_id.partner_id.id
return vals
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def setUpClass(cls):
}
)

def test_debit_move_line_has_company(self):
def test_deposit_line_ids_partner_id(self):
self.deposit.validate_deposit()
debit = self.deposit.line_ids.filtered(lambda l: l.debit)
assert debit.partner_id == self.env.user.company_id.partner_id
assert debit.partner_id == self.deposit.company_id.partner_id
credit = self.deposit.line_ids.filtered(lambda l: l.credit)
assert credit.partner_id == self.partner
assert not credit.partner_id

0 comments on commit 22f774c

Please sign in to comment.