diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 0980e5ef6d7..3f608c62e7c 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -2445,7 +2445,7 @@
-
+
diff --git a/addons/account_payment/wizard/account_payment_populate_statement.py b/addons/account_payment/wizard/account_payment_populate_statement.py
index bd61d58be3f..daa92165615 100644
--- a/addons/account_payment/wizard/account_payment_populate_statement.py
+++ b/addons/account_payment/wizard/account_payment_populate_statement.py
@@ -37,10 +37,12 @@ class account_payment_populate_statement(osv.osv_memory):
res = super(account_payment_populate_statement, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
line_ids = line_obj.search(cr, uid, [
('move_line_id.reconcile_id', '=', False),
- ('bank_statement_line_id', '=', False),])
+ ('bank_statement_line_id', '=', False),
+ ('move_line_id.state','=','valid')])
line_ids.extend(line_obj.search(cr, uid, [
('move_line_id.reconcile_id', '=', False),
- ('order_id.mode', '=', False)]))
+ ('order_id.mode', '=', False),
+ ('move_line_id.state','=','valid')]))
domain = '[("id", "in", '+ str(line_ids)+')]'
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='lines']")
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index 9394863f0c8..d47d8fb1f6f 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -841,7 +841,6 @@ class account_voucher_line(osv.osv):
_defaults = {
'name': ''
}
-
def onchange_move_line_id(self, cr, user, ids, move_line_id, context={}):
"""
Returns a dict that contains new values and context
@@ -964,6 +963,17 @@ class account_bank_statement_line(osv.osv):
res[line.id] = 0.0
return res
+ def _check_amount(self, cr, uid, ids, context=None):
+ for obj in self.browse(cr, uid, ids, context=context):
+ if obj.voucher_id:
+ if not (obj.amount == obj.voucher_id.amount):
+ return False
+ return True
+
+ _constraints = [
+ (_check_amount, 'The amount of the voucher must be the same amount as the one on the statement line', ['amount']),
+ ]
+
_columns = {
'amount_reconciled': fields.function(_amount_reconciled,
string='Amount reconciled', method=True, type='float'),
@@ -983,4 +993,4 @@ class account_bank_statement_line(osv.osv):
account_bank_statement_line()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_voucher/wizard/account_statement_from_invoice_view.xml b/addons/account_voucher/wizard/account_statement_from_invoice_view.xml
index 1da95285c24..1c0c00bd662 100644
--- a/addons/account_voucher/wizard/account_statement_from_invoice_view.xml
+++ b/addons/account_voucher/wizard/account_statement_from_invoice_view.xml
@@ -38,7 +38,7 @@