mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
FIX better handling of account_id in transfer move
This commit is contained in:
committed by
Pedro M. Baeza
parent
b972417be2
commit
4f3f094370
@@ -169,10 +169,15 @@ class PaymentOrder(models.Model):
|
||||
def _prepare_move_line_partner_account(self, bank_line, move, labels):
|
||||
# TODO : ALEXIS check don't group if move_line_id.account_id
|
||||
# is not the same
|
||||
if self.payment_order_type == 'debit':
|
||||
account_id = bank_line.partner_id.property_account_receivable.id
|
||||
if bank_line.payment_line_ids[0].move_line_id:
|
||||
account_id =\
|
||||
bank_line.payment_line_ids[0].move_line_id.account_id.id
|
||||
else:
|
||||
account_id = bank_line.partner_id.property_account_payable.id
|
||||
if self.payment_order_type == 'debit':
|
||||
account_id =\
|
||||
bank_line.partner_id.property_account_receivable.id
|
||||
else:
|
||||
account_id = bank_line.partner_id.property_account_payable.id
|
||||
vals = {
|
||||
'name': _('%s line %s') % (
|
||||
labels[self.payment_order_type], bank_line.name),
|
||||
|
||||
Reference in New Issue
Block a user