refactor: improve partner type determination logic in account payment based on account type and payment direction
This commit is contained in:
parent
2cde9d3c45
commit
4c445c74f3
BIN
__pycache__/__init__.cpython-312.pyc
Normal file
BIN
__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
BIN
models/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
models/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
BIN
models/__pycache__/account_payment.cpython-312.pyc
Normal file
BIN
models/__pycache__/account_payment.cpython-312.pyc
Normal file
Binary file not shown.
BIN
models/__pycache__/account_payment_register.cpython-312.pyc
Normal file
BIN
models/__pycache__/account_payment_register.cpython-312.pyc
Normal file
Binary file not shown.
@ -165,12 +165,15 @@ class AccountPayment(models.Model):
|
|||||||
))
|
))
|
||||||
|
|
||||||
if counterpart_lines:
|
if counterpart_lines:
|
||||||
if counterpart_lines[0].account_id.account_type == 'asset_receivable':
|
account_type = counterpart_lines[0].account_id.account_type
|
||||||
|
if account_type == 'asset_receivable':
|
||||||
partner_type = 'customer'
|
partner_type = 'customer'
|
||||||
else:
|
elif account_type == 'liability_payable':
|
||||||
partner_type = 'supplier'
|
partner_type = 'supplier'
|
||||||
|
else:
|
||||||
|
partner_type = 'customer' if pay.payment_type == 'inbound' else 'supplier'
|
||||||
else:
|
else:
|
||||||
partner_type = 'customer'
|
partner_type = 'customer' if pay.payment_type == 'inbound' else 'supplier'
|
||||||
|
|
||||||
liquidity_amount = sum(liquidity_lines.mapped('amount_currency')) if len(liquidity_lines) > 1 else liquidity_lines.amount_currency
|
liquidity_amount = sum(liquidity_lines.mapped('amount_currency')) if len(liquidity_lines) > 1 else liquidity_lines.amount_currency
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user