[FIX] account_payment: avoid using non-stored function field in domains.
authorChristophe Simonis <chs@openerp.com>
Thu, 14 Nov 2013 11:18:02 +0000 (12:18 +0100)
committerChristophe Simonis <chs@openerp.com>
Thu, 14 Nov 2013 11:18:02 +0000 (12:18 +0100)
Backport of following commits from trunk branch:
  8962 qdp-launchpad@openerp.com-20131030164925-c66d7jfx0x3546kt
  8974 qdp-launchpad@openerp.com-20131113100713-tvl30z5oqym22jqj

bzr revid: chs@openerp.com-20131114111802-a7rp2slqyigvconz

addons/account_payment/account_payment_view.xml
addons/account_payment/wizard/account_payment_order.py

index aa52d1d..6de3798 100644 (file)
@@ -93,7 +93,7 @@
                             <notebook>
                                 <page string="Payment">
                                     <group col="4">
-                                        <field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode,parent.date_prefered,parent.date_scheduled,currency,company_currency)" domain="[('reconcile_id','=', False), ('credit', '>',0),('amount_residual','>',0)] "/>
+                                        <field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode,parent.date_prefered,parent.date_scheduled,currency,company_currency)" domain="[('reconcile_id','=', False), ('credit', '>',0), ('account_id.reconcile', '=', True)] "/>
                                         <separator colspan="4" string="Transaction Information"/>
                                         <field name="date"/>
                                         <label for="amount_currency" groups="base.group_multi_currency"/>
                         <page string="Payment">
                             <group col="4">
                                 <field name="order_id"/>
-                                <field name="move_line_id" on_change="onchange_move_line(move_line_id, False, currency, company_currency)" domain="[('reconcile_id','=', False), ('credit', '>',0),('amount_residual','>',0)]"/>
+                                <field name="move_line_id" on_change="onchange_move_line(move_line_id, False, currency, company_currency)" domain="[('reconcile_id','=', False), ('credit', '>',0), ('account_id.reconcile', '=', True)]"/>
                                 <separator colspan="4" string="Transaction Information"/>
                                 <field name="date"/>
                                 <label for="amount_currency" groups="base.group_multi_currency"/>
index de9c47e..8d5df04 100644 (file)
@@ -104,7 +104,7 @@ class payment_order_create(osv.osv_memory):
 #        payment = self.pool.get('payment.order').browse(cr, uid, context['active_id'], context=context)
 
         # Search for move line to pay:
-        domain = [('reconcile_id', '=', False), ('account_id.type', '=', 'payable'), ('amount_residual', '>', 0)]
+        domain = [('reconcile_id', '=', False), ('account_id.type', '=', 'payable'), ('credit', '>', 0), ('account_id.reconcile', '=', True)]
         domain = domain + ['|', ('date_maturity', '<=', search_due_date), ('date_maturity', '=', False)]
         line_ids = line_obj.search(cr, uid, domain, context=context)
         context.update({'line_ids': line_ids})