From 911bdabc0774dec4937efd23f9e034b3ad35e135 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 11 Jun 2015 14:08:47 +0200 Subject: [PATCH] [FIX] account: fix payment onchange --- addons/account/account_payment.py | 14 -------------- addons/account/views/account_payment_view.xml | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/addons/account/account_payment.py b/addons/account/account_payment.py index 7812a5f48f8..bd0fc240653 100644 --- a/addons/account/account_payment.py +++ b/addons/account/account_payment.py @@ -75,15 +75,6 @@ class account_abstract_payment(models.AbstractModel): return {'domain': {'payment_method': [('payment_type', '=', payment_type), ('id', 'in', payment_methods.ids)]}} return {} - # FIXME : If you change the currency_id, invoice_ids is mysteriously obliterated - @api.onchange('currency_id') - def _onchange_currency_id(self): - self._set_total_invoices_amount() - - @api.onchange('payment_date') - def _onchange_date(self): - self._set_total_invoices_amount() - def _get_invoices(self): """ Return the invoices of the payment. Must be overridden """ raise NotImplementedError @@ -98,11 +89,6 @@ class account_abstract_payment(models.AbstractModel): total = self.company_id.currency_id.with_context(date=self.payment_date).compute(total, payment_currency) return abs(total) - def _set_total_invoices_amount(self): - """ Set self.amount = total residual of invoices, do nothing if the payment does not refer to invoices """ - if len(self._get_invoices()) != 0: - self.amount = self._compute_total_invoices_amount() - class account_register_payments(models.TransientModel): _name = "account.register.payments" diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index 8ba6383a983..d15c91629c1 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -191,7 +191,7 @@