mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] Only commercial partners are allowed in bank statement lines
This commit is contained in:
@@ -658,6 +658,11 @@ class AccountBankSatementLine(Model):
|
||||
# This can be quite a performance killer as we read ir.properity fields
|
||||
if partner_id:
|
||||
part = obj_partner.browse(cr, uid, partner_id, context=context)
|
||||
part = part.commercial_partner_id
|
||||
# When the method is called from bank statement completion,
|
||||
# ensure that the line's partner is a commercial
|
||||
# (accounting) entity
|
||||
res['partner_id'] = part.id
|
||||
pay_account = part.property_account_payable.id
|
||||
receiv_account = part.property_account_receivable.id
|
||||
# If no value, look on the default company property
|
||||
|
||||
Reference in New Issue
Block a user