mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] line_type assignation
This commit is contained in:
@@ -499,14 +499,14 @@ class AccountBankSatementLine(Model):
|
|||||||
res = {}
|
res = {}
|
||||||
obj_partner = self.pool.get('res.partner')
|
obj_partner = self.pool.get('res.partner')
|
||||||
obj_stat = self.pool.get('account.bank.statement')
|
obj_stat = self.pool.get('account.bank.statement')
|
||||||
ltype= receiv_account = pay_account = account_id = False
|
line_type = receiv_account = pay_account = account_id = False
|
||||||
# If profile has a receivable_account_id, we return it in any case
|
# If profile has a receivable_account_id, we return it in any case
|
||||||
if profile_id:
|
if profile_id:
|
||||||
profile = self.pool.get("account.statement.profile").browse(
|
profile = self.pool.get("account.statement.profile").browse(
|
||||||
cr, uid, profile_id, context=context)
|
cr, uid, profile_id, context=context)
|
||||||
if profile.receivable_account_id:
|
if profile.receivable_account_id:
|
||||||
account_id = profile.receivable_account_id.id
|
account_id = profile.receivable_account_id.id
|
||||||
ltype = 'general'
|
line_type = 'general'
|
||||||
return res
|
return res
|
||||||
# If partner -> take from him
|
# If partner -> take from him
|
||||||
if partner_id:
|
if partner_id:
|
||||||
@@ -525,12 +525,12 @@ class AccountBankSatementLine(Model):
|
|||||||
elif amount is not False:
|
elif amount is not False:
|
||||||
if amount >= 0:
|
if amount >= 0:
|
||||||
account_id = receiv_account
|
account_id = receiv_account
|
||||||
ltype = 'customer'
|
line_type = 'customer'
|
||||||
else:
|
else:
|
||||||
account_id = pay_account
|
account_id = pay_account
|
||||||
ltype = 'supplier'
|
line_type = 'supplier'
|
||||||
res['account_id'] = account_id if account_id else receiv_account
|
res['account_id'] = account_id if account_id else receiv_account
|
||||||
res['type'] = ltype
|
res['type'] = line_type
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def onchange_partner_id(self, cr, uid, ids, partner_id, profile_id=None, context=None):
|
def onchange_partner_id(self, cr, uid, ids, partner_id, profile_id=None, context=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user