diff --git a/account_statement_ext/statement.py b/account_statement_ext/statement.py index c300824b..cd0b8c07 100644 --- a/account_statement_ext/statement.py +++ b/account_statement_ext/statement.py @@ -499,14 +499,14 @@ class AccountBankSatementLine(Model): res = {} obj_partner = self.pool.get('res.partner') obj_stat = self.pool.get('account.bank.statement') - receiv_account = pay_account = account_id = False + ltype= receiv_account = pay_account = account_id = False # If profile has a receivable_account_id, we return it in any case if profile_id: profile = self.pool.get("account.statement.profile").browse( cr, uid, profile_id, context=context) if profile.receivable_account_id: - res['account_id'] = profile.receivable_account_id.id - res['type'] = 'general' + account_id = profile.receivable_account_id.id + ltype = 'general' return res # If partner -> take from him if partner_id: @@ -525,11 +525,12 @@ class AccountBankSatementLine(Model): elif amount is not False: if amount >= 0: account_id = receiv_account - res['type'] = 'customer' + ltype = 'customer' else: account_id = pay_account - res['type'] = 'supplier' + ltype = 'supplier' res['account_id'] = account_id if account_id else receiv_account + res['type'] = ltype return res def onchange_partner_id(self, cr, uid, ids, partner_id, profile_id=None, context=None):