Merge lp:~therp-nl/banking-addons/ba7.0-MIG-recent_fixes into lp:banking-addons

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 167
Proposed branch: lp:~therp-nl/banking-addons/ba7.0-MIG-recent_fixes
Merge into: lp:banking-addons
Prerequisite: lp:~therp-nl/banking-addons/7.0-link_partner_wizard
Diff against target: 125 lines (+19/-17)
5 files modified
account_banking/banking_import_transaction.py (+8/-8)
account_banking_nl_abnamro/abnamro.py (+1/-1)
account_banking_nl_clieop/wizard/clieop.py (+6/-1)
account_banking_payment/model/banking_import_transaction.py (+2/-1)
account_banking_payment/view/account_payment.xml (+2/-6)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/ba7.0-MIG-recent_fixes
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review, no test Approve
Guewen Baconnier @ Camptocamp code review, no test Approve
Review via email: mp+161833@code.launchpad.net

Description of the change

[MIG] Forward ported fixes of 6.1 branch

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

This branch contains fixes that are already reviewed and merged into 6.1

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
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_banking/banking_import_transaction.py'
2--- account_banking/banking_import_transaction.py 2013-05-01 14:50:31 +0000
3+++ account_banking/banking_import_transaction.py 2013-05-01 14:50:32 +0000
4@@ -181,7 +181,7 @@
5 Match on ID of invoice (reference, name or number, whatever
6 available and sensible)
7 '''
8- if invoice.reference:
9+ if invoice.reference and len(invoice.reference) > 2:
10 # Reference always comes first, as it is manually set for a
11 # reason.
12 iref = invoice.reference.upper()
13@@ -189,7 +189,7 @@
14 return True
15 if invoice.type.startswith('in_'):
16 # Internal numbering, no likely match on number
17- if invoice.name:
18+ if invoice.name and len(invoice.name) > 2:
19 iname = invoice.name.upper()
20 if iname in ref or iname in msg:
21 return True
22@@ -334,7 +334,7 @@
23 move_line = False
24 partial = False
25
26- elif len(candidates) == 1:
27+ elif len(candidates) == 1 and candidates[0].invoice:
28 # Mismatch in amounts
29 move_line = candidates[0]
30 invoice = move_line.invoice
31@@ -382,10 +382,10 @@
32 if x.partner_id.id == move_line.partner_id.id
33 ]
34
35- return (trans, self._get_move_info(
36- cr, uid, [move_line.id],
37- account_ids and account_ids[0] or False),
38- trans2)
39+ return (trans, self._get_move_info(
40+ cr, uid, [move_line.id],
41+ account_ids and account_ids[0] or False),
42+ trans2)
43
44 return trans, False, False
45
46@@ -791,7 +791,7 @@
47 if move_lines and len(move_lines) == 1:
48 retval['reference'] = move_lines[0].ref
49 if retval['match_type'] == 'invoice':
50- retval['invoice_ids'] = [x.invoice.id for x in move_lines]
51+ retval['invoice_ids'] = list(set([x.invoice.id for x in move_lines]))
52 retval['type'] = type_map[move_lines[0].invoice.type]
53 return retval
54
55
56=== modified file 'account_banking_nl_abnamro/abnamro.py'
57--- account_banking_nl_abnamro/abnamro.py 2013-05-01 14:50:31 +0000
58+++ account_banking_nl_abnamro/abnamro.py 2013-05-01 14:50:32 +0000
59@@ -295,7 +295,7 @@
60 if fields[2].startswith('/'):
61 self.remote_account = fields[2][1:].strip()
62 else:
63- self.message += ' ' + fields[2].strip()
64+ self.remote_account = fields[2].strip()
65 # fourth column contains remote owner
66 self.remote_owner = (len(fields) > 3 and fields[3].strip() or
67 False)
68
69=== modified file 'account_banking_nl_clieop/wizard/clieop.py'
70--- account_banking_nl_clieop/wizard/clieop.py 2013-05-01 14:50:31 +0000
71+++ account_banking_nl_clieop/wizard/clieop.py 2013-05-01 14:50:32 +0000
72@@ -43,6 +43,11 @@
73 #def format(self, value):
74 # return convert.to_swift(super(SWIFTField, self).format(value))
75
76+class SWIFTFieldNoLeadingWhitespace(SWIFTField):
77+ def format(self, value):
78+ return super(SWIFTFieldNoLeadingWhitespace, self).format(
79+ self.cast(value).lstrip())
80+
81 def eleven_test(s):
82 '''
83 Dutch eleven-test for validating 9-long local bank account numbers.
84@@ -161,7 +166,7 @@
85 _fields = [
86 record.Filler('recordcode', 4, '0150'),
87 record.Filler('variantcode', 1, 'A'),
88- SWIFTField('paymentreference', 16),
89+ SWIFTFieldNoLeadingWhitespace('paymentreference', 16),
90 record.Filler('filler', 29),
91 ]
92
93
94=== modified file 'account_banking_payment/model/banking_import_transaction.py'
95--- account_banking_payment/model/banking_import_transaction.py 2013-05-01 14:50:31 +0000
96+++ account_banking_payment/model/banking_import_transaction.py 2013-05-01 14:50:32 +0000
97@@ -49,7 +49,8 @@
98 limit=0, context=context)
99 orders = payment_order_obj.browse(cr, uid, order_ids, context)
100 candidates = [x for x in orders if
101- is_zero(x.total - trans.transferred_amount)]
102+ is_zero(x.total - trans.transferred_amount) and
103+ x.line_ids and x.line_ids[0].debit_move_line_id]
104 if len(candidates) > 0:
105 # retrieve the common account_id, if any
106 account_id = False
107
108=== modified file 'account_banking_payment/view/account_payment.xml'
109--- account_banking_payment/view/account_payment.xml 2013-05-01 14:50:31 +0000
110+++ account_banking_payment/view/account_payment.xml 2013-05-01 14:50:32 +0000
111@@ -13,12 +13,8 @@
112 <field name="arch" type="xml">
113 <data>
114 <xpath expr="/form/group/button[@string='Select Invoices to Pay']"
115- position="replace">
116- <button colspan="2" name="%(account_payment.action_create_payment_order)s"
117- string="Select Invoices to Pay" type="action"
118- attrs="{'invisible':[('state','!=','draft')]}"
119- icon="gtk-find"
120- />
121+ position="attributes">
122+ <attribute name="attrs">{'invisible':[('state','!=','draft')]}</attribute>
123 </xpath>
124 <xpath expr="/form/group/button[@string='Make Payments']"
125 position="replace">

Subscribers

People subscribed via source and target branches

to status/vote changes: