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
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
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 Approve
Romain Deheele - Camptocamp (community) code review Approve
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.
Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

Hi,

LGTM,

Romain

review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

LGTM

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_payment_extension/res_partner_view.xml'
2--- account_payment_extension/res_partner_view.xml 2013-08-18 21:18:02 +0000
3+++ account_payment_extension/res_partner_view.xml 2014-03-21 02:09:37 +0000
4@@ -58,7 +58,6 @@
5 <record model="ir.ui.view" id="view_payment_type_res_partner_form1">
6 <field name="name">res.partner.form.payment_type1</field>
7 <field name="model">res.partner</field>
8- <field name="type">form</field>
9 <field name="inherit_id" ref="account.view_partner_property_form"/>
10 <field name="priority" eval="20"/>
11 <field name="arch" type="xml">
12
13=== modified file 'account_payment_extension/wizard/account_payment_order.py'
14--- account_payment_extension/wizard/account_payment_order.py 2013-11-20 09:17:16 +0000
15+++ account_payment_extension/wizard/account_payment_order.py 2014-03-21 02:09:37 +0000
16@@ -22,15 +22,9 @@
17 #
18 ##############################################################################
19
20-import time
21-from lxml import etree
22-from osv import osv, fields
23-
24-import pooler
25-
26-
27-
28-class payment_order_create(osv.osv_memory):
29+from openerp.osv import orm, fields
30+
31+class payment_order_create(orm.TransientModel):
32 """
33 Create a payment object with lines corresponding to the account move line
34 to pay according to the date provided by the user and the mode-type payment of the order.
35@@ -41,17 +35,16 @@
36 If a type is given, unsuitable account move lines are ignored.
37 """
38 _inherit = 'payment.order.create'
39- _description = ''
40
41 _columns={
42 'communication2':fields.char ('Communication 2',size = 64, help ='The successor message of payment communication.'),
43 '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.'),
44 'show_refunds':fields.boolean('Show Refunds', help = 'Indicates if search should include refunds.'),
45- }
46+ }
47
48 _defaults={
49- 'show_refunds': lambda *a: False,
50- }
51+ 'show_refunds': False,
52+ }
53
54 def default_get(self, cr, uid, fields, context=None):
55 """
56@@ -73,10 +66,9 @@
57 return res
58
59 def search_entries(self, cr, uid, ids, context):
60- pool = pooler.get_pool(cr.dbname)
61- order_obj = self.pool.get('payment.order')
62- line_obj = self.pool.get('account.move.line')
63- mod_obj = self.pool.get('ir.model.data')
64+ order_obj = self.pool['payment.order']
65+ line_obj = self.pool['account.move.line']
66+ mod_obj = self.pool['ir.model.data']
67 if context is None:
68 context = {}
69 data = self.browse(cr, uid, ids, context=context)[0]
70@@ -105,7 +97,7 @@
71 if amount > 0.0:
72 # If user specified an amount, search what moves match the criteria taking into account
73 # if payment mode allows bank account to be null.
74- for line in pool.get('account.move.line').browse(cr, uid, line_ids, context):
75+ for line in line_obj.browse(cr, uid, line_ids, context=context):
76 if abs(line.amount_to_pay) <= amount:
77 amount -= abs(line.amount_to_pay)
78 selected_ids.append( line.id )
79@@ -167,6 +159,4 @@
80 }, context=context)
81 return {'type': 'ir.actions.act_window_close'}
82
83-payment_order_create()
84-
85 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: