summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorCedric Snauwaert <csn@openerp.com>2015-06-11 14:08:47 +0200
committerqdp-odoo <qdp@odoo.com>2015-06-19 16:06:10 +0200
commit911bdabc0774dec4937efd23f9e034b3ad35e135 (patch)
treeebee0d652cf6c8dc8b0081784107ad48187d2ab8 /addons
parentd017827c1ae30b6d2a203f653110359d183da5c5 (diff)
[FIX] account: fix payment onchange
Diffstat (limited to 'addons')
-rw-r--r--addons/account/account_payment.py14
-rw-r--r--addons/account/views/account_payment_view.xml2
2 files changed, 1 insertions, 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 @@
<label for="amount"/>
<div name="amount_div">
<field name="amount" class="oe_inline"/>
- <field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency" class="oe_inline" invisible="1"/><!-- FIXME see account_abstract_payment._onchange_currency_id -->
+ <field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency" class="oe_inline" invisible="1"/>
</div>
</group>
<group>