Merge lp:~akretion-team/banking-addons/bank-statement-reconcile-61-internal-account into lp:banking-addons/bank-statement-reconcile-61

Proposed by Benoit Guillot - http://www.akretion.com
Status: Merged
Merged at revision: 78
Proposed branch: lp:~akretion-team/banking-addons/bank-statement-reconcile-61-internal-account
Merge into: lp:banking-addons/bank-statement-reconcile-61
Diff against target: 143 lines (+22/-17)
2 files modified
account_statement_ext/statement.py (+9/-5)
account_statement_ext/statement_view.xml (+13/-12)
To merge this branch: bzr merge lp:~akretion-team/banking-addons/bank-statement-reconcile-61-internal-account
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
Alexandre Fayolle - camptocamp code review, no test Approve
Review via email: mp+158877@code.launchpad.net

Description of the change

This proposal fix a name of a class and add a field in the class account_statement_profile.
With this field : internal_account_transfer_id, you can define a default account on the profile for the internal transfers. For instance from your paypal account to your main bank account.

Sorry for the diff, my IDE also automaticaly remove space at the end of the lines.

To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_statement_ext/statement.py'
2--- account_statement_ext/statement.py 2012-10-25 07:38:31 +0000
3+++ account_statement_ext/statement.py 2013-04-15 10:18:27 +0000
4@@ -66,6 +66,10 @@
5 ),
6 'bank_statement_prefix': fields.char('Bank Statement Prefix', size=32),
7 'bank_statement_ids': fields.one2many('account.bank.statement', 'profile_id', 'Bank Statement Imported'),
8+ 'internal_account_transfer_id': fields.many2one('account.account',
9+ 'Internal Account Transfer',
10+ help="Choose the default account for internal\
11+ bank transfer")
12
13
14 }
15@@ -81,7 +85,7 @@
16 ]
17
18
19-class AccountBankSatement(Model):
20+class AccountBankStatement(Model):
21 """
22 We improve the bank statement class mostly for :
23 - Removing the period and compute it from the date of each line.
24@@ -132,7 +136,7 @@
25 profile_obj = self.pool.get('account.statement.profile')
26 profile = profile_obj.browse(cr,uid,vals['profile_id'],context)
27 vals['journal_id'] = profile.journal_id.id
28- return super(AccountBankSatement, self).create(cr, uid, vals, context=context)
29+ return super(AccountBankStatement, self).create(cr, uid, vals, context=context)
30
31 def _get_period(self, cursor, uid, date, context=None):
32 """
33@@ -476,7 +480,7 @@
34 """
35 st = self.browse(cr, uid, st_id, context=context)
36 if st.balance_check:
37- return super(AccountBankSatement,self).balance_check(cr, uid, st_id, journal_type, context)
38+ return super(AccountBankStatement,self).balance_check(cr, uid, st_id, journal_type, context)
39 else:
40 return True
41
42@@ -499,7 +503,7 @@
43 }}
44
45
46-class AccountBankSatementLine(Model):
47+class AccountBankStatementLine(Model):
48 """
49 Override to compute the period from the date of the line, add a method to retrieve
50 the values for a line from the profile. Override the on_change method to take care of
51@@ -625,7 +629,7 @@
52 """
53 if context is None:
54 context = {}
55- res = super(AccountBankSatementLine,self).onchange_type(cr, uid, line_id, partner_id, type, context)
56+ res = super(AccountBankStatementLine,self).onchange_type(cr, uid, line_id, partner_id, type, context)
57 if 'account_id' in res['value']:
58 result = self.get_values_for_line(cr, uid, profile_id = profile_id,
59 partner_id = partner_id, line_type = type, context = context)
60
61=== modified file 'account_statement_ext/statement_view.xml'
62--- account_statement_ext/statement_view.xml 2012-08-02 12:46:12 +0000
63+++ account_statement_ext/statement_view.xml 2013-04-15 10:18:27 +0000
64@@ -26,7 +26,7 @@
65 </field>
66 </field>
67 </record>
68-
69+
70 <record id="statement_importer_view_form" model="ir.ui.view">
71 <field name="name">account.statement.profile.view</field>
72 <field name="model">account.statement.profile</field>
73@@ -40,6 +40,7 @@
74 <field name="commission_account_id" />
75 <field name="commission_analytic_id" />
76 <field name="receivable_account_id" />
77+ <field name="internal_account_transfer_id"/>
78 <field name="force_partner_on_bank"/>
79 <field name="balance_check"/>
80 <field name="bank_statement_prefix"/>
81@@ -71,7 +72,7 @@
82 <field name="view_mode">tree,form</field>
83 </record>
84
85- <menuitem string="Bank Statements Profile" action="action_treasury_statement_profile_tree" id="menu_treasury_statement_profile_tree" parent="account.menu_configuration_misc" sequence="30"/>
86+ <menuitem string="Bank Statements Profile" action="action_treasury_statement_profile_tree" id="menu_treasury_statement_profile_tree" parent="account.menu_configuration_misc" sequence="30"/>
87
88 <record model="ir.ui.view" id="id_in_statement_line">
89 <field name="name">account.bank.statement.line.inherit</field>
90@@ -84,8 +85,8 @@
91 </xpath>
92 </field>
93 </record>
94-
95-
96+
97+
98 <record id="view_treasury_statement_search" model="ir.ui.view">
99 <field name="name">account.bank.statement.search</field>
100 <field name="model">account.bank.statement</field>
101@@ -124,7 +125,7 @@
102 </field>
103 </record>
104
105-
106+
107 <record id="view_treasury_statement_form" model="ir.ui.view">
108 <field name="name">account.bank.statement.form</field>
109 <field name="model">account.bank.statement</field>
110@@ -160,7 +161,7 @@
111 <xpath expr="/form/group/field[@name='balance_end']" position="replace">
112 <field name="balance_end"/>
113 </xpath>
114-
115+
116 <xpath expr="/form/group/field[@name='journal_id']" position="attributes">
117 <attribute name="widget"></attribute>
118 </xpath>
119@@ -191,18 +192,18 @@
120 <xpath expr="/form/notebook/page/field/tree/field[@name='type']" position="replace">
121 <field name="type" on_change="onchange_type(partner_id, type, parent.profile_id)"/>
122 </xpath>
123-
124+
125 </field>
126 </record>
127
128-
129+
130 <act_window id="act_bank_statement_from_profile"
131- name="Open Statements"
132- res_model="account.bank.statement"
133- src_model="account.statement.profile"
134+ name="Open Statements"
135+ res_model="account.bank.statement"
136+ src_model="account.statement.profile"
137 domain="[('profile_id','=',active_id),]"
138 view_type="form"/>
139-
140+
141
142 </data>
143 </openerp>

Subscribers

People subscribed via source and target branches