[FIX] account: payment reconciliation line order
Create 3 invoices for customer (A: $100, B: $300, C: $200) Have a customer payment of $500 Reconcile the payment, in the widget add the line in the order: - Payment line - Invoice A - Invoice B - Invoice C (partial payment) Reconcile Check invoices Issue: C will be fully paid, the partial payment will be applied to B After 5b2c1d243c0dd5b049ceae280dd270fc8a59f955 We order the lines by amount currency but the user provided order is lost. Moving the original fix to point of sale opw-3240586 closes odoo/odoo#120779 X-original-commit: 89f9028901a8b43aab605c12e3c7bcc2a7dd8d44 Related: odoo/enterprise#40805 Signed-off-by: William André (wan) <wan@odoo.com> Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
This commit is contained in:
@@ -1959,12 +1959,18 @@ class AccountMoveLine(models.Model):
|
||||
"""
|
||||
|
||||
def process_amls(amls):
|
||||
sorted_amls = amls.sorted(key=lambda aml: (
|
||||
aml.date_maturity or aml.date,
|
||||
aml.currency_id,
|
||||
aml.amount_currency,
|
||||
aml.balance,
|
||||
))
|
||||
if self._context.get('reduced_line_sorting'):
|
||||
sorted_amls = amls.sorted(key=lambda aml: (
|
||||
aml.date_maturity or aml.date,
|
||||
aml.currency_id,
|
||||
))
|
||||
else:
|
||||
sorted_amls = amls.sorted(key=lambda aml: (
|
||||
aml.date_maturity or aml.date,
|
||||
aml.currency_id,
|
||||
aml.amount_currency,
|
||||
aml.balance,
|
||||
))
|
||||
currencies = sorted_amls.currency_id
|
||||
|
||||
results = {
|
||||
|
||||
Reference in New Issue
Block a user