← Back to team overview

account-payment-team team mailing list archive

[Merge] lp:~pedro.baeza/account-payment/7.0-account_payment_extension-v7-conv into lp:account-payment/7.0

 

Pedro Manuel Baeza has proposed merging lp:~pedro.baeza/account-payment/7.0-account_payment_extension-v7-conv into lp:account-payment/7.0.

Requested reviews:
  Account Payment (account-payment-team)

For more details, see:
https://code.launchpad.net/~pedro.baeza/account-payment/7.0-account_payment_extension-v7-conv/+merge/212078

Some minor changes to adhere to v7 standards and be compatible with current trunk
-- 
https://code.launchpad.net/~pedro.baeza/account-payment/7.0-account_payment_extension-v7-conv/+merge/212078
Your team Account Payment is requested to review the proposed merge of lp:~pedro.baeza/account-payment/7.0-account_payment_extension-v7-conv into lp:account-payment/7.0.
=== modified file 'account_payment_extension/res_partner_view.xml'
--- account_payment_extension/res_partner_view.xml	2013-08-18 21:18:02 +0000
+++ account_payment_extension/res_partner_view.xml	2014-03-21 02:09:37 +0000
@@ -58,7 +58,6 @@
         <record model="ir.ui.view" id="view_payment_type_res_partner_form1">
             <field name="name">res.partner.form.payment_type1</field>
             <field name="model">res.partner</field>
-            <field name="type">form</field>
             <field name="inherit_id" ref="account.view_partner_property_form"/>
             <field name="priority" eval="20"/>
             <field name="arch" type="xml">

=== modified file 'account_payment_extension/wizard/account_payment_order.py'
--- account_payment_extension/wizard/account_payment_order.py	2013-11-20 09:17:16 +0000
+++ account_payment_extension/wizard/account_payment_order.py	2014-03-21 02:09:37 +0000
@@ -22,15 +22,9 @@
 #
 ##############################################################################
 
-import time
-from lxml import etree
-from osv import osv, fields
-
-import pooler
-
-
-
-class payment_order_create(osv.osv_memory):
+from openerp.osv import orm, fields
+
+class payment_order_create(orm.TransientModel):
     """
     Create a payment object with lines corresponding to the account move line
     to pay according to the date provided by the user and the mode-type payment of the order.
@@ -41,17 +35,16 @@
     If a type is given, unsuitable account move lines are ignored.
     """
     _inherit = 'payment.order.create'
-    _description = ''
 
     _columns={
         'communication2':fields.char ('Communication 2',size = 64, help ='The successor message of payment communication.'),
         'amount':fields.float ('Amount', help ='Next step will automatically select payments up to this amount as long as account moves have bank account if that is required by the selected payment mode.'),
         'show_refunds':fields.boolean('Show Refunds', help = 'Indicates if search should include refunds.'),
-              }
+    }
 
     _defaults={
-               'show_refunds': lambda *a: False,
-               }
+        'show_refunds': False,
+    }
 
     def default_get(self, cr, uid, fields, context=None):
         """
@@ -73,10 +66,9 @@
         return res
 
     def search_entries(self, cr, uid, ids, context):
-        pool = pooler.get_pool(cr.dbname)
-        order_obj = self.pool.get('payment.order')
-        line_obj = self.pool.get('account.move.line')
-        mod_obj = self.pool.get('ir.model.data')
+        order_obj = self.pool['payment.order']
+        line_obj = self.pool['account.move.line']
+        mod_obj = self.pool['ir.model.data']
         if context is None:
             context = {}
         data = self.browse(cr, uid, ids, context=context)[0]
@@ -105,7 +97,7 @@
         if amount > 0.0:
             # If user specified an amount, search what moves match the criteria taking into account
             # if payment mode allows bank account to be null.
-            for line in pool.get('account.move.line').browse(cr, uid, line_ids, context):
+            for line in line_obj.browse(cr, uid, line_ids, context=context):
                 if abs(line.amount_to_pay) <= amount:
                     amount -= abs(line.amount_to_pay)
                     selected_ids.append( line.id )
@@ -167,6 +159,4 @@
                 }, context=context)
         return {'type': 'ir.actions.act_window_close'}
 
-payment_order_create()
-
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:


Follow ups