Skip to content

Commit

Permalink
BSSFL-490: On payment, empty the amount when a difference appears
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoux committed Feb 13, 2018
1 parent 78a83ff commit a2f0811
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ latest (unreleased)
**Features and Improvements**

* BSSFL-485: Custom sale order report (add field note)
* BSSFL-490: On payment, empty the amount when a difference appears

**Bugfixes**

Expand Down
1 change: 1 addition & 0 deletions odoo/local-src/sf_account/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
from . import account
from . import account_invoice
from . import account_move
from . import account_payment
from . import res_bank
13 changes: 13 additions & 0 deletions odoo/local-src/sf_account/models/account_payment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# Part of sensefly.

from odoo import models, api


class AccountPayment(models.Model):
_inherit = 'account.payment'

@api.onchange('payment_difference')
def onchange_payment_difference(self):
if self.payment_difference != 0:
self.amount = 0

0 comments on commit a2f0811

Please sign in to comment.