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

Proposed by Pedro Manuel Baeza on 2014-03-21
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp on 2014-05-23
Approved revision: 111
Merged at revision: 113
Proposed branch: lp:~pedro.baeza/account-payment/7.0-account_payment_extension-v7-conv
Merge into: lp:~account-payment-team/account-payment/7.0
Diff against target: 85 lines (+10/-21)
2 files modified
account_payment_extension/res_partner_view.xml (+0/-1)
account_payment_extension/wizard/account_payment_order.py (+10/-20)
To merge this branch: bzr merge lp:~pedro.baeza/account-payment/7.0-account_payment_extension-v7-conv
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp code review, no test 2014-03-21 Approve on 2014-05-02
Romain Deheele - Camptocamp (community) code review Approve on 2014-03-26
Review via email: mp+212078@code.launchpad.net

Description of the change

Some minor changes to adhere to v7 standards and be compatible with current trunk

To post a comment you must log in.

Hi,

LGTM,

Romain

review: Approve (code review)

LGTM

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
58 <record model="ir.ui.view" id="view_payment_type_res_partner_form1">58 <record model="ir.ui.view" id="view_payment_type_res_partner_form1">
59 <field name="name">res.partner.form.payment_type1</field>59 <field name="name">res.partner.form.payment_type1</field>
60 <field name="model">res.partner</field>60 <field name="model">res.partner</field>
61 <field name="type">form</field>
62 <field name="inherit_id" ref="account.view_partner_property_form"/>61 <field name="inherit_id" ref="account.view_partner_property_form"/>
63 <field name="priority" eval="20"/>62 <field name="priority" eval="20"/>
64 <field name="arch" type="xml">63 <field name="arch" type="xml">
6564
=== 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 @@
22#22#
23##############################################################################23##############################################################################
2424
25import time25from openerp.osv import orm, fields
26from lxml import etree26
27from osv import osv, fields27class payment_order_create(orm.TransientModel):
28
29import pooler
30
31
32
33class payment_order_create(osv.osv_memory):
34 """28 """
35 Create a payment object with lines corresponding to the account move line29 Create a payment object with lines corresponding to the account move line
36 to pay according to the date provided by the user and the mode-type payment of the order.30 to pay according to the date provided by the user and the mode-type payment of the order.
@@ -41,17 +35,16 @@
41 If a type is given, unsuitable account move lines are ignored.35 If a type is given, unsuitable account move lines are ignored.
42 """36 """
43 _inherit = 'payment.order.create'37 _inherit = 'payment.order.create'
44 _description = ''
4538
46 _columns={39 _columns={
47 'communication2':fields.char ('Communication 2',size = 64, help ='The successor message of payment communication.'),40 'communication2':fields.char ('Communication 2',size = 64, help ='The successor message of payment communication.'),
48 '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.'),41 '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.'),
49 'show_refunds':fields.boolean('Show Refunds', help = 'Indicates if search should include refunds.'),42 'show_refunds':fields.boolean('Show Refunds', help = 'Indicates if search should include refunds.'),
50 }43 }
5144
52 _defaults={45 _defaults={
53 'show_refunds': lambda *a: False,46 'show_refunds': False,
54 }47 }
5548
56 def default_get(self, cr, uid, fields, context=None):49 def default_get(self, cr, uid, fields, context=None):
57 """50 """
@@ -73,10 +66,9 @@
73 return res66 return res
7467
75 def search_entries(self, cr, uid, ids, context):68 def search_entries(self, cr, uid, ids, context):
76 pool = pooler.get_pool(cr.dbname)69 order_obj = self.pool['payment.order']
77 order_obj = self.pool.get('payment.order')70 line_obj = self.pool['account.move.line']
78 line_obj = self.pool.get('account.move.line')71 mod_obj = self.pool['ir.model.data']
79 mod_obj = self.pool.get('ir.model.data')
80 if context is None:72 if context is None:
81 context = {}73 context = {}
82 data = self.browse(cr, uid, ids, context=context)[0]74 data = self.browse(cr, uid, ids, context=context)[0]
@@ -105,7 +97,7 @@
105 if amount > 0.0:97 if amount > 0.0:
106 # If user specified an amount, search what moves match the criteria taking into account98 # If user specified an amount, search what moves match the criteria taking into account
107 # if payment mode allows bank account to be null.99 # if payment mode allows bank account to be null.
108 for line in pool.get('account.move.line').browse(cr, uid, line_ids, context):100 for line in line_obj.browse(cr, uid, line_ids, context=context):
109 if abs(line.amount_to_pay) <= amount:101 if abs(line.amount_to_pay) <= amount:
110 amount -= abs(line.amount_to_pay)102 amount -= abs(line.amount_to_pay)
111 selected_ids.append( line.id )103 selected_ids.append( line.id )
@@ -167,6 +159,4 @@
167 }, context=context)159 }, context=context)
168 return {'type': 'ir.actions.act_window_close'}160 return {'type': 'ir.actions.act_window_close'}
169161
170payment_order_create()
171
172# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:162# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: