Merge lp:~unifield-team/unifield-wm/UF_2164 into lp:unifield-wm
- UF_2164
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 1837 |
Proposed branch: | lp:~unifield-team/unifield-wm/UF_2164 |
Merge into: | lp:unifield-wm |
Diff against target: |
830 lines (+434/-37) 22 files modified
account_corrections/__init__.py (+2/-0) account_corrections/account_analytic_line.py (+149/-0) account_corrections/account_invoice.py (+85/-0) account_corrections/account_move_line.py (+16/-5) account_corrections/account_wizard_view.xml (+10/-9) account_corrections/wizard/analytic_distribution_wizard.py (+8/-6) account_hq_entries/hq_entries.py (+4/-2) account_mcdb/account_view.xml (+36/-2) account_msf/invoice.py (+1/-1) account_msf/invoice_view.xml (+4/-0) account_override/account_analytic_line.py (+1/-0) account_override/account_view.xml (+2/-0) analytic_distribution/analytic_distribution_wizard_view.xml (+1/-1) analytic_distribution/analytic_line.py (+3/-2) analytic_distribution/analytic_line_view.xml (+0/-5) analytic_distribution_invoice/account_invoice_view.xml (+5/-1) analytic_distribution_invoice/invoice.py (+6/-3) msf_instance/msf_instance_view.xml (+15/-0) register_accounting/account_bank_statement.py (+57/-0) register_accounting/account_invoice_view.xml (+2/-0) register_accounting/account_view.xml (+10/-0) register_accounting/account_wizard.xml (+17/-0) |
To merge this branch: | bzr merge lp:~unifield-team/unifield-wm/UF_2164 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Dev Team | Pending | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
- 1837. By jftempo
-
UF-2164 [IMP] Correction handling
lp:~unifield-team/unifield-wm/UF_2164 - 1838. By jftempo
-
UF-2164 [IMP] Code simplification
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'account_corrections/__init__.py' | |||
2 | --- account_corrections/__init__.py 2013-09-13 13:57:37 +0000 | |||
3 | +++ account_corrections/__init__.py 2013-11-06 10:36:19 +0000 | |||
4 | @@ -23,5 +23,7 @@ | |||
5 | 23 | 23 | ||
6 | 24 | import account_move_line | 24 | import account_move_line |
7 | 25 | import wizard | 25 | import wizard |
8 | 26 | import account_analytic_line | ||
9 | 27 | import account_invoice | ||
10 | 26 | 28 | ||
11 | 27 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 29 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
12 | 28 | 30 | ||
13 | === added file 'account_corrections/account_analytic_line.py' | |||
14 | --- account_corrections/account_analytic_line.py 1970-01-01 00:00:00 +0000 | |||
15 | +++ account_corrections/account_analytic_line.py 2013-11-06 10:36:19 +0000 | |||
16 | @@ -0,0 +1,149 @@ | |||
17 | 1 | #!/usr/bin/env python | ||
18 | 2 | #-*- encoding:utf-8 -*- | ||
19 | 3 | ############################################################################## | ||
20 | 4 | # | ||
21 | 5 | # OpenERP, Open Source Management Solution | ||
22 | 6 | # Copyright (C) 2011 TeMPO Consulting, MSF. All Rights Reserved | ||
23 | 7 | # Developer: Olivier DOSSMANN | ||
24 | 8 | # | ||
25 | 9 | # This program is free software: you can redistribute it and/or modify | ||
26 | 10 | # it under the terms of the GNU Affero General Public License as | ||
27 | 11 | # published by the Free Software Foundation, either version 3 of the | ||
28 | 12 | # License, or (at your option) any later version. | ||
29 | 13 | # | ||
30 | 14 | # This program is distributed in the hope that it will be useful, | ||
31 | 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
32 | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
33 | 17 | # GNU Affero General Public License for more details. | ||
34 | 18 | # | ||
35 | 19 | # You should have received a copy of the GNU Affero General Public License | ||
36 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
37 | 21 | # | ||
38 | 22 | ############################################################################## | ||
39 | 23 | |||
40 | 24 | from osv import osv | ||
41 | 25 | from osv import fields | ||
42 | 26 | from tools.translate import _ | ||
43 | 27 | |||
44 | 28 | class account_analytic_line(osv.osv): | ||
45 | 29 | _name = 'account.analytic.line' | ||
46 | 30 | _inherit = 'account.analytic.line' | ||
47 | 31 | |||
48 | 32 | _columns = { | ||
49 | 33 | 'is_corrigible': fields.related('move_id', 'is_corrigible', string='Is correctible?', type="boolean", readonly=True), | ||
50 | 34 | 'last_corrected_id': fields.many2one('account.analytic.line', string="Last corrected entry", readonly=True), | ||
51 | 35 | } | ||
52 | 36 | |||
53 | 37 | def button_corrections(self, cr, uid, ids, context=None): | ||
54 | 38 | """ | ||
55 | 39 | Launch accounting correction wizard to do reverse or correction on selected analytic line. | ||
56 | 40 | """ | ||
57 | 41 | # Verification | ||
58 | 42 | if not context: | ||
59 | 43 | context={} | ||
60 | 44 | if isinstance(ids, (int, long)): | ||
61 | 45 | ids = [ids] | ||
62 | 46 | # Retrieve some values | ||
63 | 47 | wiz_obj = self.pool.get('wizard.journal.items.corrections') | ||
64 | 48 | al = self.browse(cr, uid, ids[0]) | ||
65 | 49 | if not al.move_id: | ||
66 | 50 | raise osv.except_osv(_('Warning'), _('No link to a journal item found!')) | ||
67 | 51 | if not al.move_id.is_corrigible: | ||
68 | 52 | raise osv.except_osv(_('Error'), _('The journal item linked to this analytic line is not correctible!')) | ||
69 | 53 | # Create wizard | ||
70 | 54 | wizard = wiz_obj.create(cr, uid, {'move_line_id': al.move_id.id}, context=context) | ||
71 | 55 | # Change wizard state in order to change date requirement on wizard | ||
72 | 56 | wiz_obj.write(cr, uid, [wizard], {'state': 'open'}, context=context) | ||
73 | 57 | # Update context | ||
74 | 58 | context.update({ | ||
75 | 59 | 'active_id': al.move_id.id, | ||
76 | 60 | 'active_ids': [al.move_id.id], | ||
77 | 61 | }) | ||
78 | 62 | # Change context if account special type is "donation" | ||
79 | 63 | if al.move_id.account_id and al.move_id.account_id.type_for_register and al.move_id.account_id.type_for_register == 'donation': | ||
80 | 64 | wiz_obj.write(cr, uid, [wizard], {'from_donation': True}, context=context) | ||
81 | 65 | # Update context to inform wizard we come from a correction wizard | ||
82 | 66 | context.update({'from_correction': True,}) | ||
83 | 67 | return { | ||
84 | 68 | 'name': _("Accounting Corrections Wizard (from Analytic Journal Items)"), | ||
85 | 69 | 'type': 'ir.actions.act_window', | ||
86 | 70 | 'res_model': 'wizard.journal.items.corrections', | ||
87 | 71 | 'target': 'new', | ||
88 | 72 | 'view_mode': 'form,tree', | ||
89 | 73 | 'view_type': 'form', | ||
90 | 74 | 'res_id': [wizard], | ||
91 | 75 | 'context': context, | ||
92 | 76 | } | ||
93 | 77 | |||
94 | 78 | def get_corrections_history(self, cr, uid, ids, context=None): | ||
95 | 79 | """ | ||
96 | 80 | Give for each line their history by using "move_id and reversal_origin" field to browse lines | ||
97 | 81 | Return something like that: | ||
98 | 82 | {id1: [line_id, another_line_id], id2: [a_line_id, other_line_id]} | ||
99 | 83 | """ | ||
100 | 84 | # Verifications | ||
101 | 85 | if not context: | ||
102 | 86 | context = {} | ||
103 | 87 | if isinstance(ids, (int, long)): | ||
104 | 88 | ids = [ids] | ||
105 | 89 | # Prepare some values | ||
106 | 90 | res = {} | ||
107 | 91 | upstream_line_ids = [] | ||
108 | 92 | downstream_line_ids = [] | ||
109 | 93 | # Browse all given lines | ||
110 | 94 | for aml in self.browse(cr, uid, ids, context=context): | ||
111 | 95 | # Get upstream move lines | ||
112 | 96 | line = aml | ||
113 | 97 | while line: | ||
114 | 98 | # Add line to result | ||
115 | 99 | upstream_line_ids.append(line.id) | ||
116 | 100 | # Add reversal line to result | ||
117 | 101 | upstream_line_ids += self.search(cr, uid, [('reversal_origin', '=', line.id), ('is_reversal', '=', True)], context=context) | ||
118 | 102 | line = line.last_corrected_id | ||
119 | 103 | # Get downstream move lines | ||
120 | 104 | sline_ids = [aml.id] | ||
121 | 105 | while sline_ids: | ||
122 | 106 | sline_ids = self.search(cr, uid, [('last_corrected_id', 'in', sline_ids)], context=context) | ||
123 | 107 | if sline_ids: | ||
124 | 108 | # Add line to result | ||
125 | 109 | downstream_line_ids += sline_ids | ||
126 | 110 | # Add reversal line to result | ||
127 | 111 | downstream_line_ids += self.search(cr, uid, [('reversal_origin', 'in', sline_ids), ('is_reversal', '=', True)], context=context) | ||
128 | 112 | |||
129 | 113 | return list(set(upstream_line_ids + downstream_line_ids)) | ||
130 | 114 | |||
131 | 115 | def button_open_analytic_corrections(self, cr, uid, ids, context=None): | ||
132 | 116 | """ | ||
133 | 117 | Open a wizard that contains all analytic lines linked to this one. | ||
134 | 118 | """ | ||
135 | 119 | # Verification | ||
136 | 120 | if not context: | ||
137 | 121 | context={} | ||
138 | 122 | if isinstance(ids, (int, long)): | ||
139 | 123 | ids = [ids] | ||
140 | 124 | |||
141 | 125 | # Search ids to be open | ||
142 | 126 | domain_ids = self.get_corrections_history(cr, uid, ids, context=context) | ||
143 | 127 | # Create domain | ||
144 | 128 | domain = [('id', 'in', domain_ids)] | ||
145 | 129 | # Update context | ||
146 | 130 | context.update({ | ||
147 | 131 | 'active_id': ids[0], | ||
148 | 132 | 'active_ids': ids, | ||
149 | 133 | 'display_fp': True, | ||
150 | 134 | }) | ||
151 | 135 | # Display the result | ||
152 | 136 | return { | ||
153 | 137 | 'name': "History Analytic Line", | ||
154 | 138 | 'type': 'ir.actions.act_window', | ||
155 | 139 | 'res_model': 'account.analytic.line', | ||
156 | 140 | 'target': 'new', | ||
157 | 141 | 'view_type': 'form', | ||
158 | 142 | 'view_mode': 'tree', | ||
159 | 143 | 'context': context, | ||
160 | 144 | 'domain': domain, | ||
161 | 145 | } | ||
162 | 146 | return True | ||
163 | 147 | |||
164 | 148 | account_analytic_line() | ||
165 | 149 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
166 | 0 | 150 | ||
167 | === added file 'account_corrections/account_invoice.py' | |||
168 | --- account_corrections/account_invoice.py 1970-01-01 00:00:00 +0000 | |||
169 | +++ account_corrections/account_invoice.py 2013-11-06 10:36:19 +0000 | |||
170 | @@ -0,0 +1,85 @@ | |||
171 | 1 | #!/usr/bin/env python | ||
172 | 2 | #-*- encoding:utf-8 -*- | ||
173 | 3 | ############################################################################## | ||
174 | 4 | # | ||
175 | 5 | # OpenERP, Open Source Management Solution | ||
176 | 6 | # Copyright (C) 2013 TeMPO Consulting, MSF. All Rights Reserved | ||
177 | 7 | # Developer: Olivier DOSSMANN | ||
178 | 8 | # | ||
179 | 9 | # This program is free software: you can redistribute it and/or modify | ||
180 | 10 | # it under the terms of the GNU Affero General Public License as | ||
181 | 11 | # published by the Free Software Foundation, either version 3 of the | ||
182 | 12 | # License, or (at your option) any later version. | ||
183 | 13 | # | ||
184 | 14 | # This program is distributed in the hope that it will be useful, | ||
185 | 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
186 | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
187 | 17 | # GNU Affero General Public License for more details. | ||
188 | 18 | # | ||
189 | 19 | # You should have received a copy of the GNU Affero General Public License | ||
190 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
191 | 21 | # | ||
192 | 22 | ############################################################################## | ||
193 | 23 | |||
194 | 24 | from osv import osv | ||
195 | 25 | from osv import fields | ||
196 | 26 | from tools.translate import _ | ||
197 | 27 | from time import strftime | ||
198 | 28 | |||
199 | 29 | class account_invoice_line(osv.osv): | ||
200 | 30 | _name = 'account.invoice.line' | ||
201 | 31 | _inherit = 'account.invoice.line' | ||
202 | 32 | |||
203 | 33 | def _have_been_corrected(self, cr, uid, ids, name, args, context=None): | ||
204 | 34 | """ | ||
205 | 35 | Return True if ALL elements are OK: | ||
206 | 36 | - a journal items is linked to this invoice line | ||
207 | 37 | - the journal items is linked to an analytic line that have been reallocated | ||
208 | 38 | """ | ||
209 | 39 | if context is None: | ||
210 | 40 | context = {} | ||
211 | 41 | res = {} | ||
212 | 42 | |||
213 | 43 | def has_ana_reallocated(move): | ||
214 | 44 | for ml in move.move_lines or []: | ||
215 | 45 | for al in ml.analytic_lines or []: | ||
216 | 46 | if al.is_reallocated: | ||
217 | 47 | return True | ||
218 | 48 | return False | ||
219 | 49 | |||
220 | 50 | for il in self.browse(cr, uid, ids, context=context): | ||
221 | 51 | res[il.id] = has_ana_reallocated(il) | ||
222 | 52 | return res | ||
223 | 53 | |||
224 | 54 | _columns = { | ||
225 | 55 | 'is_corrected': fields.function(_have_been_corrected, method=True, string="Have been corrected?", type='boolean', | ||
226 | 56 | readonly=True, help="This informs system if this item have been corrected in analytic lines. Criteria: the invoice line is linked to a journal items that have analytic item which is reallocated.", | ||
227 | 57 | store=False), | ||
228 | 58 | } | ||
229 | 59 | |||
230 | 60 | _defaults = { | ||
231 | 61 | 'is_corrected': lambda *a: False, | ||
232 | 62 | } | ||
233 | 63 | |||
234 | 64 | def button_open_analytic_lines(self, cr, uid, ids, context=None): | ||
235 | 65 | """ | ||
236 | 66 | Return analytic lines linked to this invoice line. | ||
237 | 67 | First we takes all journal items that are linked to this invoice line. | ||
238 | 68 | Then for all journal items, we take all analytic journal items. | ||
239 | 69 | Finally we display the result for "button_open_analytic_corrections" of analytic lines | ||
240 | 70 | """ | ||
241 | 71 | # Some checks | ||
242 | 72 | if not context: | ||
243 | 73 | context = {} | ||
244 | 74 | # Prepare some values | ||
245 | 75 | al_ids = [] | ||
246 | 76 | # Browse give invoice lines | ||
247 | 77 | for il in self.browse(cr, uid, ids, context=context): | ||
248 | 78 | if il.move_lines: | ||
249 | 79 | for ml in il.move_lines: | ||
250 | 80 | if ml.analytic_lines: | ||
251 | 81 | al_ids += [x.id for x in ml.analytic_lines] | ||
252 | 82 | return self.pool.get('account.analytic.line').button_open_analytic_corrections(cr, uid, al_ids, context=context) | ||
253 | 83 | |||
254 | 84 | account_invoice_line() | ||
255 | 85 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
256 | 0 | 86 | ||
257 | === modified file 'account_corrections/account_move_line.py' | |||
258 | --- account_corrections/account_move_line.py 2013-09-13 13:57:37 +0000 | |||
259 | +++ account_corrections/account_move_line.py 2013-11-06 10:36:19 +0000 | |||
260 | @@ -256,7 +256,7 @@ | |||
261 | 256 | # Update context to inform wizard we come from a correction wizard | 256 | # Update context to inform wizard we come from a correction wizard |
262 | 257 | context.update({'from_correction': True,}) | 257 | context.update({'from_correction': True,}) |
263 | 258 | return { | 258 | return { |
265 | 259 | 'name': "Accounting Corrections Wizard", | 259 | 'name': _("Accounting Corrections Wizard (from Journal Items)"), |
266 | 260 | 'type': 'ir.actions.act_window', | 260 | 'type': 'ir.actions.act_window', |
267 | 261 | 'res_model': 'wizard.journal.items.corrections', | 261 | 'res_model': 'wizard.journal.items.corrections', |
268 | 262 | 'target': 'new', | 262 | 'target': 'new', |
269 | @@ -600,6 +600,13 @@ | |||
270 | 600 | # Abort process if this move line was corrected before | 600 | # Abort process if this move line was corrected before |
271 | 601 | if ml.corrected: | 601 | if ml.corrected: |
272 | 602 | continue | 602 | continue |
273 | 603 | # If this line was already been corrected, check the first analytic line ID (but not the first first analytic line) | ||
274 | 604 | first_analytic_line_id = False | ||
275 | 605 | first_ana_ids = self.pool.get('account.analytic.line').search(cr, uid, [('move_id', '=', ml.id)]) | ||
276 | 606 | if first_ana_ids: | ||
277 | 607 | first_ana = self.pool.get('account.analytic.line').browse(cr, uid, first_ana_ids)[0] | ||
278 | 608 | if first_ana.last_corrected_id: | ||
279 | 609 | first_analytic_line_id = first_ana.last_corrected_id.id | ||
280 | 603 | # Retrieve right journal | 610 | # Retrieve right journal |
281 | 604 | journal_id = j_corr_id | 611 | journal_id = j_corr_id |
282 | 605 | 612 | ||
283 | @@ -681,19 +688,23 @@ | |||
284 | 681 | move_obj.post(cr, uid, [move_id], context=context) | 688 | move_obj.post(cr, uid, [move_id], context=context) |
285 | 682 | # Change analytic lines that come from: | 689 | # Change analytic lines that come from: |
286 | 683 | #- initial move line: is_reallocated is True | 690 | #- initial move line: is_reallocated is True |
288 | 684 | #- reversal move line: is_reversal is True | 691 | #- reversal move line: is_reversal is True + initial analytic line |
289 | 685 | #- correction line: change is_reallocated and is_reversal to False | 692 | #- correction line: change is_reallocated and is_reversal to False |
290 | 686 | #- old reversal line: reset is_reversal to True (lost previously in validate()) | 693 | #- old reversal line: reset is_reversal to True (lost previously in validate()) |
291 | 694 | initial_al_ids = al_obj.search(cr, uid, [('move_id', '=', ml.id)]) | ||
292 | 687 | search_datas = [(ml.id, {'is_reallocated': True}), | 695 | search_datas = [(ml.id, {'is_reallocated': True}), |
295 | 688 | (rev_line_id, {'is_reversal': True}), | 696 | (rev_line_id, {'is_reversal': True, 'reversal_origin': initial_al_ids[0]}), |
296 | 689 | (correction_line_id, {'is_reallocated': False, 'is_reversal': False})] | 697 | (correction_line_id, {'is_reallocated': False, 'is_reversal': False, 'last_corrected_id': initial_al_ids[0]})] |
297 | 690 | # If line is already a correction, take the previous reversal move line id | 698 | # If line is already a correction, take the previous reversal move line id |
298 | 691 | # (UF_1234: otherwise, the reversal is not set correctly) | 699 | # (UF_1234: otherwise, the reversal is not set correctly) |
299 | 692 | if ml.corrected_line_id: | 700 | if ml.corrected_line_id: |
300 | 693 | old_reverse_ids = self.search(cr, uid, [('reversal_line_id', '=', ml.corrected_line_id.id)]) | 701 | old_reverse_ids = self.search(cr, uid, [('reversal_line_id', '=', ml.corrected_line_id.id)]) |
301 | 694 | if len(old_reverse_ids) > 0: | 702 | if len(old_reverse_ids) > 0: |
303 | 695 | search_datas += [(old_reverse_ids[0], {'is_reversal': True})] | 703 | search_datas += [(old_reverse_ids[0], {'is_reversal': True, 'reversal_origin': first_analytic_line_id})] |
304 | 696 | for search_data in search_datas: | 704 | for search_data in search_datas: |
305 | 705 | # keep initial analytic line as corrected line if it the 2nd or more correction on this line | ||
306 | 706 | if ml.corrected_line_id and search_data[0] == ml.id and first_analytic_line_id: | ||
307 | 707 | search_data[1].update({'last_corrected_id': first_analytic_line_id}) | ||
308 | 697 | search_ids = al_obj.search(cr, uid, [('move_id', '=', search_data[0])]) | 708 | search_ids = al_obj.search(cr, uid, [('move_id', '=', search_data[0])]) |
309 | 698 | if search_ids: | 709 | if search_ids: |
310 | 699 | al_obj.write(cr, uid, search_ids, search_data[1]) | 710 | al_obj.write(cr, uid, search_ids, search_data[1]) |
311 | 700 | 711 | ||
312 | === modified file 'account_corrections/account_wizard_view.xml' | |||
313 | --- account_corrections/account_wizard_view.xml 2013-07-30 12:08:55 +0000 | |||
314 | +++ account_corrections/account_wizard_view.xml 2013-11-06 10:36:19 +0000 | |||
315 | @@ -9,11 +9,9 @@ | |||
316 | 9 | <field name="type">tree</field> | 9 | <field name="type">tree</field> |
317 | 10 | <field name="arch" type="xml"> | 10 | <field name="arch" type="xml"> |
318 | 11 | <tree hide_new_button="1" hide_delete_button="1" editable="bottom" colors="blue:analytic_distribution_state in ('valid');red:analytic_distribution_state in ('invalid');black:analytic_distribution_state in ('none')"> | 11 | <tree hide_new_button="1" hide_delete_button="1" editable="bottom" colors="blue:analytic_distribution_state in ('valid');red:analytic_distribution_state in ('invalid');black:analytic_distribution_state in ('none')"> |
319 | 12 | <field name="journal_id"/> | ||
320 | 13 | <field name="move_id"/> | 12 | <field name="move_id"/> |
321 | 14 | <field name="ref"/> | 13 | <field name="ref"/> |
322 | 15 | <field name="date"/> | 14 | <field name="date"/> |
323 | 16 | <field name="period_id"/> | ||
324 | 17 | <field name="account_id" domain="[('type', '<>', 'view')]"/> | 15 | <field name="account_id" domain="[('type', '<>', 'view')]"/> |
325 | 18 | <button name="button_analytic_distribution" type="object" icon="terp-stock_symbol-selection" string="Ana. Distri."/> | 16 | <button name="button_analytic_distribution" type="object" icon="terp-stock_symbol-selection" string="Ana. Distri."/> |
326 | 19 | <field name="analytic_distribution_state"/> | 17 | <field name="analytic_distribution_state"/> |
327 | @@ -32,13 +30,13 @@ | |||
328 | 32 | <field name="type">form</field> | 30 | <field name="type">form</field> |
329 | 33 | <field name="arch" type="xml"> | 31 | <field name="arch" type="xml"> |
330 | 34 | <form string="Journal items corrections Wizard"> | 32 | <form string="Journal items corrections Wizard"> |
333 | 35 | <field name="move_line_id" invisible="1" colspan="1"/> | 33 | <separator string="Correction"/> |
334 | 36 | <field name="date" on_change="onchange_date(date)"/> | 34 | <field name="date" on_change="onchange_date(date)" colspan="2"/> |
335 | 35 | <label string="" colspan="2"/> | ||
336 | 37 | <field name="from_donation" invisible="1"/> | 36 | <field name="from_donation" invisible="1"/> |
337 | 38 | <newline/> | 37 | <newline/> |
339 | 39 | <field name="to_be_corrected_ids" colspan="6" context="{'from_donation_account': from_donation}" /> | 38 | <field name="to_be_corrected_ids" colspan="6" context="{'from_donation_account': from_donation}" nolabel="1"/> |
340 | 40 | <newline/> | 39 | <newline/> |
341 | 41 | <label string="" colspan="6"/> | ||
342 | 42 | <group colspan="4" col="6"> | 40 | <group colspan="4" col="6"> |
343 | 43 | <label string ="" colspan="1"/> | 41 | <label string ="" colspan="1"/> |
344 | 44 | <button icon="gtk-cancel" special="cancel" string="Cancel"/> | 42 | <button icon="gtk-cancel" special="cancel" string="Cancel"/> |
345 | @@ -63,9 +61,12 @@ | |||
346 | 63 | attrs="{'invisible': [('state', '!=', 'correction')], 'required': [('state', '=', 'correction')]}"/> | 61 | attrs="{'invisible': [('state', '!=', 'correction')], 'required': [('state', '=', 'correction')]}"/> |
347 | 64 | <newline/> | 62 | <newline/> |
348 | 65 | </xpath> | 63 | </xpath> |
352 | 66 | <xpath expr="/form//button[@name='button_confirm']" position="replace"> | 64 | <xpath expr="/form//field[@name='state']" position="before"> |
353 | 67 | <button name="button_confirm" string="Save" type="object" icon="gtk-ok" colspan="1" attrs="{'invisible': [('state', '=', 'correction')], 'readonly': [('is_writable', '=', False)]}"/> | 65 | <group colspan="4" attrs="{'invisible': [('state', '!=', 'correction')]}"> |
354 | 68 | <button name="button_confirm" string="Correct it!" type="object" icon="gtk-edit" colspan="1" attrs="{'invisible': [('state', '!=', 'correction')]}"/> | 66 | <label string="" colspan="2"/> |
355 | 67 | <button name="button_cancel" string='Cancel' type='object' icon='gtk-cancel' colspan="1"/> | ||
356 | 68 | <button name="button_confirm" string="Correct it" type="object" icon="gtk-edit" colspan="1" attrs="{'readonly': [('is_writable', '=', False)]}"/> | ||
357 | 69 | </group> | ||
358 | 69 | </xpath> | 70 | </xpath> |
359 | 70 | </data> | 71 | </data> |
360 | 71 | </field> | 72 | </field> |
361 | 72 | 73 | ||
362 | === modified file 'account_corrections/wizard/analytic_distribution_wizard.py' | |||
363 | --- account_corrections/wizard/analytic_distribution_wizard.py 2013-11-05 09:23:49 +0000 | |||
364 | +++ account_corrections/wizard/analytic_distribution_wizard.py 2013-11-06 10:36:19 +0000 | |||
365 | @@ -204,11 +204,12 @@ | |||
366 | 204 | # reverse the line | 204 | # reverse the line |
367 | 205 | to_reverse_ids = self.pool.get('account.analytic.line').search(cr, uid, [('distrib_line_id', '=', 'funding.pool.distribution.line,%d'%line.distribution_line_id.id), ('is_reversal', '=', False), ('is_reallocated', '=', False)]) | 205 | to_reverse_ids = self.pool.get('account.analytic.line').search(cr, uid, [('distrib_line_id', '=', 'funding.pool.distribution.line,%d'%line.distribution_line_id.id), ('is_reversal', '=', False), ('is_reallocated', '=', False)]) |
368 | 206 | # UTP-943: Set wizard date as date for REVERSAL AND CORRECTION lines | 206 | # UTP-943: Set wizard date as date for REVERSAL AND CORRECTION lines |
370 | 207 | rev_ids = self.pool.get('account.analytic.line').reverse(cr, uid, to_reverse_ids, posting_date=wizard.date) | 207 | reversed_ids = self.pool.get('account.analytic.line').reverse(cr, uid, to_reverse_ids[0], posting_date=wizard.date) |
371 | 208 | # Add reversal origin link (to not loose it). last_corrected_id is to prevent case where you do a reverse a line that have been already corrected | ||
372 | 208 | # UTP-943: Add correction journal on it | 209 | # UTP-943: Add correction journal on it |
374 | 209 | self.pool.get('account.analytic.line').write(cr, uid, rev_ids, {'journal_id': correction_journal_id}) | 210 | self.pool.get('account.analytic.line').write(cr, uid, [reversed_ids[0]], {'reversal_origin': to_reverse_ids[0], 'last_corrected_id': False, 'journal_id': correction_journal_id}) |
375 | 210 | # Mark old lines as non reallocatable (ana_ids): why reverse() don't set this flag ? | 211 | # Mark old lines as non reallocatable (ana_ids): why reverse() don't set this flag ? |
377 | 211 | self.pool.get('account.analytic.line').write(cr, uid, to_reverse_ids, {'is_reallocated': True,}) | 212 | self.pool.get('account.analytic.line').write(cr, uid, [to_reverse_ids[0]], {'is_reallocated': True,}) |
378 | 212 | # update the distrib line | 213 | # update the distrib line |
379 | 213 | name = False | 214 | name = False |
380 | 214 | if to_reverse_ids: | 215 | if to_reverse_ids: |
381 | @@ -228,9 +229,10 @@ | |||
382 | 228 | if cp.state != 'draft': | 229 | if cp.state != 'draft': |
383 | 229 | raise osv.except_osv(_('Error'), _('Period (%s) is not open.') % (cp.name,)) | 230 | raise osv.except_osv(_('Error'), _('Period (%s) is not open.') % (cp.name,)) |
384 | 230 | # Create the new ana line | 231 | # Create the new ana line |
388 | 231 | cor_ids = self.pool.get('funding.pool.distribution.line').create_analytic_lines(cr, uid, line.distribution_line_id.id, ml.id, date=wizard.date, document_date=orig_document_date, source_date=orig_date, name=name) | 232 | ret = self.pool.get('funding.pool.distribution.line').create_analytic_lines(cr, uid, line.distribution_line_id.id, ml.id, date=wizard.date, document_date=orig_document_date, source_date=orig_date, name=name) |
389 | 232 | for distrib_id in cor_ids: | 233 | # Add link to first analytic lines |
390 | 233 | self.pool.get('account.analytic.line').write(cr, uid, [cor_ids[distrib_id]], {'journal_id': correction_journal_id}) | 234 | for ret_id in ret: |
391 | 235 | self.pool.get('account.analytic.line').write(cr, uid, [ret[ret_id]], {'last_corrected_id': to_reverse_ids[0], 'journal_id': correction_journal_id}) | ||
392 | 234 | 236 | ||
393 | 235 | for line in to_override: | 237 | for line in to_override: |
394 | 236 | # update the ana line | 238 | # update the ana line |
395 | 237 | 239 | ||
396 | === modified file 'account_hq_entries/hq_entries.py' | |||
397 | --- account_hq_entries/hq_entries.py 2013-10-31 13:55:38 +0000 | |||
398 | +++ account_hq_entries/hq_entries.py 2013-11-06 10:36:19 +0000 | |||
399 | @@ -255,8 +255,10 @@ | |||
400 | 255 | # create new lines | 255 | # create new lines |
401 | 256 | if not fp_old_lines: # UTP-546 - this have been added because of sync that break analytic lines generation | 256 | if not fp_old_lines: # UTP-546 - this have been added because of sync that break analytic lines generation |
402 | 257 | continue | 257 | continue |
405 | 258 | ana_line_obj.copy(cr, uid, fp_old_lines[0], {'date': current_date, 'source_date': line.date, 'cost_center_id': line.cost_center_id.id, | 258 | cor_ids = ana_line_obj.copy(cr, uid, fp_old_lines[0], {'date': current_date, 'source_date': line.date, 'cost_center_id': line.cost_center_id.id, |
406 | 259 | 'account_id': line.analytic_id.id, 'destination_id': line.destination_id.id, 'journal_id': acor_journal_id}) | 259 | 'account_id': line.analytic_id.id, 'destination_id': line.destination_id.id, 'journal_id': acor_journal_id, 'last_correction_id': fp_old_lines[0]}) |
407 | 260 | # update new ana line | ||
408 | 261 | ana_line_obj.write(cr, uid, cor_ids, {'last_corrected_id': fp_old_lines[0]}) | ||
409 | 260 | # update old ana lines | 262 | # update old ana lines |
410 | 261 | ana_line_obj.write(cr, uid, fp_old_lines, {'is_reallocated': True}) | 263 | ana_line_obj.write(cr, uid, fp_old_lines, {'is_reallocated': True}) |
411 | 262 | 264 | ||
412 | 263 | 265 | ||
413 | === modified file 'account_mcdb/account_view.xml' | |||
414 | --- account_mcdb/account_view.xml 2013-04-16 15:08:18 +0000 | |||
415 | +++ account_mcdb/account_view.xml 2013-11-06 10:36:19 +0000 | |||
416 | @@ -10,6 +10,12 @@ | |||
417 | 10 | <field name="arch" type="xml"> | 10 | <field name="arch" type="xml"> |
418 | 11 | <tree string="Account Entries" min_rows="100" hide_new_button="1"> | 11 | <tree string="Account Entries" min_rows="100" hide_new_button="1"> |
419 | 12 | <field name="instance_id"/> | 12 | <field name="instance_id"/> |
420 | 13 | <field name="is_corrigible" invisible="1"/> | ||
421 | 14 | <field name="have_an_historic" invisible="1"/> | ||
422 | 15 | <button name="button_do_accounting_corrections" type="object" string="Open Accounting Correction Wizard" | ||
423 | 16 | attrs="{'invisible': [('is_corrigible', '=', False)]}" icon="terp-mail-message-new"/> | ||
424 | 17 | <button name="button_open_corrections" type="object" string="Open corrections history" | ||
425 | 18 | attrs="{'invisible': [('have_an_historic', '=', False)]}" icon="terp-mail-"/> | ||
426 | 13 | <field name="journal_id"/> | 19 | <field name="journal_id"/> |
427 | 14 | <field name="move_id"/> | 20 | <field name="move_id"/> |
428 | 15 | <field name="name"/> | 21 | <field name="name"/> |
429 | @@ -47,10 +53,15 @@ | |||
430 | 47 | <field name="model">account.analytic.line</field> | 53 | <field name="model">account.analytic.line</field> |
431 | 48 | <field name="type">tree</field> | 54 | <field name="type">tree</field> |
432 | 49 | <field name="arch" type="xml"> | 55 | <field name="arch" type="xml"> |
434 | 50 | <tree string="Analytic Line" min_rows="100" editable="bottom" noteditable="1" hide_delete_button="1" hide_new_button="1"> | 56 | <tree string="Analytic Journal Items" min_rows="100" editable="bottom" noteditable="1" hide_delete_button="1" hide_new_button="1"> |
435 | 51 | <field name="is_reallocated" invisible="1"/> | 57 | <field name="is_reallocated" invisible="1"/> |
436 | 52 | <button string="Have been reallocated" attrs="{'invisible': [('is_reallocated', '=', False)]}" icon="terp-mail-" colspan="2"/> | ||
437 | 53 | <field name="instance_id"/> | 58 | <field name="instance_id"/> |
438 | 59 | <field name="is_reversal" invisible="1"/> | ||
439 | 60 | <field name="journal_type" invisible="1"/> | ||
440 | 61 | <field name="is_corrigible" invisible="1"/> | ||
441 | 62 | <button name="button_corrections" type="object" string="Accounting info/correction" | ||
442 | 63 | attrs="{'invisible': ['|', '|', '|', ('is_reallocated', '=', True), ('is_reversal', '=', True), ('journal_type', '=', 'engagement'), ('is_corrigible', '=', False)]}" icon="terp-mail-message-new"/> | ||
443 | 64 | <button string="Have been reallocated?" attrs="{'invisible': [('is_reallocated', '=', False)]}" icon="terp-mail-" colspan="2" name="button_open_analytic_corrections" type="object"/> | ||
444 | 54 | <field name="journal_id"/> | 65 | <field name="journal_id"/> |
445 | 55 | <field name="entry_sequence"/> | 66 | <field name="entry_sequence"/> |
446 | 56 | <field name="name"/> | 67 | <field name="name"/> |
447 | @@ -75,6 +86,29 @@ | |||
448 | 75 | </field> | 86 | </field> |
449 | 76 | </record> | 87 | </record> |
450 | 77 | 88 | ||
451 | 89 | <!-- Account analytic line tree view --> | ||
452 | 90 | <record model="ir.ui.view" id="account_analytic_line_default"> | ||
453 | 91 | <field name="name">account.analytic.line.default</field> | ||
454 | 92 | <field name="model">account.analytic.line</field> | ||
455 | 93 | <field name="type">tree</field> | ||
456 | 94 | <field name="inherit_id" ref="account.view_account_analytic_line_tree"/> | ||
457 | 95 | <field name="priority" eval="40"/> | ||
458 | 96 | <field name="arch" type="xml"> | ||
459 | 97 | <data> | ||
460 | 98 | <xpath expr="/tree/field[@name='journal_id']" position="before"> | ||
461 | 99 | <field name="is_reversal" invisible="1"/> | ||
462 | 100 | <field name="journal_type" invisible="1"/> | ||
463 | 101 | <field name="is_corrigible" invisible="1"/> | ||
464 | 102 | <button name="button_corrections" type="object" string="Accounting info/correction" | ||
465 | 103 | attrs="{'invisible': ['|', '|', '|', ('is_reallocated', '=', True), ('is_reversal', '=', True), ('journal_type', '=', 'engagement'), ('is_corrigible', '=', False)]}" icon="terp-mail-message-new"/> | ||
466 | 104 | <field name="is_reallocated" invisible="1"/> | ||
467 | 105 | <field name="last_corrected_id" invisible="1"/> | ||
468 | 106 | <button string="Have been reallocated" attrs="{'invisible': [('is_reallocated', '=', False), ('last_corrected_id', '=', False)]}" icon="terp-mail-" colspan="2" name="button_open_analytic_corrections" type="object"/> | ||
469 | 107 | </xpath> | ||
470 | 108 | </data> | ||
471 | 109 | </field> | ||
472 | 110 | </record> | ||
473 | 111 | |||
474 | 78 | <!-- Account move line search view --> | 112 | <!-- Account move line search view --> |
475 | 79 | <record id="mcdb_view_account_move_line_filter" model="ir.ui.view"> | 113 | <record id="mcdb_view_account_move_line_filter" model="ir.ui.view"> |
476 | 80 | <field name="name">Journal Items</field> | 114 | <field name="name">Journal Items</field> |
477 | 81 | 115 | ||
478 | === modified file 'account_msf/invoice.py' | |||
479 | --- account_msf/invoice.py 2013-03-11 10:50:12 +0000 | |||
480 | +++ account_msf/invoice.py 2013-11-06 10:36:19 +0000 | |||
481 | @@ -250,7 +250,7 @@ | |||
482 | 250 | if inv.type != 'out_invoice' or inv.is_debit_note == False: | 250 | if inv.type != 'out_invoice' or inv.is_debit_note == False: |
483 | 251 | raise osv.except_osv(_('Error'), _('You can only do import invoice on a Debit Note!')) | 251 | raise osv.except_osv(_('Error'), _('You can only do import invoice on a Debit Note!')) |
484 | 252 | w_id = self.pool.get('debit.note.import.invoice').create(cr, uid, {'invoice_id': inv.id, 'currency_id': inv.currency_id.id, | 252 | w_id = self.pool.get('debit.note.import.invoice').create(cr, uid, {'invoice_id': inv.id, 'currency_id': inv.currency_id.id, |
486 | 253 | 'partner_id': inv.partner_id.id}) | 253 | 'partner_id': inv.partner_id.id}, context=context) |
487 | 254 | context.update({ | 254 | context.update({ |
488 | 255 | 'active_id': inv.id, | 255 | 'active_id': inv.id, |
489 | 256 | 'active_ids': ids, | 256 | 'active_ids': ids, |
490 | 257 | 257 | ||
491 | === modified file 'account_msf/invoice_view.xml' | |||
492 | --- account_msf/invoice_view.xml 2013-09-09 13:14:25 +0000 | |||
493 | +++ account_msf/invoice_view.xml 2013-11-06 10:36:19 +0000 | |||
494 | @@ -185,6 +185,8 @@ | |||
495 | 185 | <field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list"> | 185 | <field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list"> |
496 | 186 | <tree editable="top" string="Donation Lines" noteditable="1" hide_new_button="1" colors="red: inactive_product == True"> | 186 | <tree editable="top" string="Donation Lines" noteditable="1" hide_new_button="1" colors="red: inactive_product == True"> |
497 | 187 | <field name="line_number"/> | 187 | <field name="line_number"/> |
498 | 188 | <field name="is_corrected" invisible="1"/> | ||
499 | 189 | <button name="button_open_analytic_lines" string="Have been corrected" type="object" icon="terp-mail-" attrs="{'invisible': [('is_corrected', '=', False)]}"/> | ||
500 | 188 | <field name="product_id"/> | 190 | <field name="product_id"/> |
501 | 189 | <field name="account_id" /> | 191 | <field name="account_id" /> |
502 | 190 | <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" | 192 | <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" |
503 | @@ -282,6 +284,8 @@ | |||
504 | 282 | <newline/> | 284 | <newline/> |
505 | 283 | <field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list"> | 285 | <field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list"> |
506 | 284 | <tree editable="top" string="Intermission Voucher Lines" hide_new_button="1" colors="red: inactive_product == True"> | 286 | <tree editable="top" string="Intermission Voucher Lines" hide_new_button="1" colors="red: inactive_product == True"> |
507 | 287 | <field name="is_corrected" invisible="1"/> | ||
508 | 288 | <button name="button_open_analytic_lines" string="Have been corrected" type="object" icon="terp-mail-" attrs="{'invisible': [('is_corrected', '=', False)]}"/> | ||
509 | 285 | <field name="name"/> | 289 | <field name="name"/> |
510 | 286 | <field name="account_id" /> | 290 | <field name="account_id" /> |
511 | 287 | <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" | 291 | <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection" |
512 | 288 | 292 | ||
513 | === modified file 'account_override/account_analytic_line.py' | |||
514 | --- account_override/account_analytic_line.py 2013-10-31 13:55:38 +0000 | |||
515 | +++ account_override/account_analytic_line.py 2013-11-06 10:36:19 +0000 | |||
516 | @@ -54,6 +54,7 @@ | |||
517 | 54 | 'is_reversal': fields.boolean('Reversal?'), | 54 | 'is_reversal': fields.boolean('Reversal?'), |
518 | 55 | 'is_reallocated': fields.boolean('Reallocated?'), | 55 | 'is_reallocated': fields.boolean('Reallocated?'), |
519 | 56 | 'journal_id': fields.many2one('account.analytic.journal', 'Journal Code', required=True, ondelete='restrict', select=True, readonly=True), | 56 | 'journal_id': fields.many2one('account.analytic.journal', 'Journal Code', required=True, ondelete='restrict', select=True, readonly=True), |
520 | 57 | 'journal_type': fields.related('journal_id', 'type', 'Journal type', readonly=True), | ||
521 | 57 | 'date': fields.date('Posting Date', required=True, select=True, readonly=True), | 58 | 'date': fields.date('Posting Date', required=True, select=True, readonly=True), |
522 | 58 | 'document_date': fields.date('Document Date', readonly=True, required=True), | 59 | 'document_date': fields.date('Document Date', readonly=True, required=True), |
523 | 59 | 'move_id': fields.many2one('account.move.line', 'Entry Sequence', ondelete='restrict', select=True, readonly=True, domain="[('account_id.user_type.code', 'in', ['expense', 'income'])]"), # UF-1719: Domain added for search view | 60 | 'move_id': fields.many2one('account.move.line', 'Entry Sequence', ondelete='restrict', select=True, readonly=True, domain="[('account_id.user_type.code', 'in', ['expense', 'income'])]"), # UF-1719: Domain added for search view |
524 | 60 | 61 | ||
525 | === modified file 'account_override/account_view.xml' | |||
526 | --- account_override/account_view.xml 2013-10-21 12:02:45 +0000 | |||
527 | +++ account_override/account_view.xml 2013-11-06 10:36:19 +0000 | |||
528 | @@ -14,6 +14,8 @@ | |||
529 | 14 | <data> | 14 | <data> |
530 | 15 | <xpath expr="/tree/field[@name='name']" position="before"> | 15 | <xpath expr="/tree/field[@name='name']" position="before"> |
531 | 16 | <field name="line_number"/> | 16 | <field name="line_number"/> |
532 | 17 | <field name="is_corrected" invisible="1"/> | ||
533 | 18 | <button name="button_open_analytic_lines" string="Have been corrected" type="object" icon="terp-mail-" attrs="{'invisible': [('is_corrected', '=', False)]}"/> | ||
534 | 17 | </xpath> | 19 | </xpath> |
535 | 18 | </data> | 20 | </data> |
536 | 19 | </field> | 21 | </field> |
537 | 20 | 22 | ||
538 | === modified file 'analytic_distribution/analytic_distribution_wizard_view.xml' | |||
539 | --- analytic_distribution/analytic_distribution_wizard_view.xml 2013-10-30 11:00:44 +0000 | |||
540 | +++ analytic_distribution/analytic_distribution_wizard_view.xml 2013-11-06 10:36:19 +0000 | |||
541 | @@ -109,7 +109,7 @@ | |||
542 | 109 | <field colspan="4" name="f2_line_ids" nolabel="1" widget="one2many_list" context="{'mode': entry_mode, 'parent_id':active_id}" attrs="{'readonly': [('is_writable', '=', False)]}"/> | 109 | <field colspan="4" name="f2_line_ids" nolabel="1" widget="one2many_list" context="{'mode': entry_mode, 'parent_id':active_id}" attrs="{'readonly': [('is_writable', '=', False)]}"/> |
543 | 110 | </group> | 110 | </group> |
544 | 111 | </group> | 111 | </group> |
546 | 112 | <group colspan="4"> | 112 | <group colspan="4" attrs="{'invisible': [('state', '=', 'correction')]}"> |
547 | 113 | <label string="" colspan="2"/> | 113 | <label string="" colspan="2"/> |
548 | 114 | <button name="button_cancel" string='Cancel' type='object' icon='gtk-cancel' colspan="1"/> | 114 | <button name="button_cancel" string='Cancel' type='object' icon='gtk-cancel' colspan="1"/> |
549 | 115 | <button name="button_confirm" string="Save" type="object" icon="gtk-ok" colspan="1" attrs="{'readonly': [('is_writable', '=', False)]}"/> | 115 | <button name="button_confirm" string="Save" type="object" icon="gtk-ok" colspan="1" attrs="{'readonly': [('is_writable', '=', False)]}"/> |
550 | 116 | 116 | ||
551 | === modified file 'analytic_distribution/analytic_line.py' | |||
552 | --- analytic_distribution/analytic_line.py 2013-11-05 09:23:49 +0000 | |||
553 | +++ analytic_distribution/analytic_line.py 2013-11-06 10:36:19 +0000 | |||
554 | @@ -324,7 +324,7 @@ | |||
555 | 324 | # First reverse line | 324 | # First reverse line |
556 | 325 | rev_ids = self.pool.get('account.analytic.line').reverse(cr, uid, [aline.id], posting_date=date) | 325 | rev_ids = self.pool.get('account.analytic.line').reverse(cr, uid, [aline.id], posting_date=date) |
557 | 326 | # UTP-943: Shoud have a correction journal on these lines | 326 | # UTP-943: Shoud have a correction journal on these lines |
559 | 327 | self.pool.get('account.analytic.line').write(cr, uid, rev_ids, {'journal_id': correction_journal_id}) | 327 | self.pool.get('account.analytic.line').write(cr, uid, rev_ids, {'journal_id': correction_journal_id, 'is_reversal': True, 'reversal_origin': aline.id, 'last_corrected_id': False}) |
560 | 328 | # UTP-943: Check that period is open | 328 | # UTP-943: Check that period is open |
561 | 329 | correction_period_ids = self.pool.get('account.period').get_period_from_date(cr, uid, date, context=context) | 329 | correction_period_ids = self.pool.get('account.period').get_period_from_date(cr, uid, date, context=context) |
562 | 330 | if not correction_period_ids: | 330 | if not correction_period_ids: |
563 | @@ -333,8 +333,9 @@ | |||
564 | 333 | if p.state != 'draft': | 333 | if p.state != 'draft': |
565 | 334 | raise osv.except_osv(_('Error'), _('Period (%s) is not open.') % (p.name,)) | 334 | raise osv.except_osv(_('Error'), _('Period (%s) is not open.') % (p.name,)) |
566 | 335 | # then create new lines | 335 | # then create new lines |
568 | 336 | self.pool.get('account.analytic.line').copy(cr, uid, aline.id, {fieldname: account_id, 'date': date, | 336 | cor_ids = self.pool.get('account.analytic.line').copy(cr, uid, aline.id, {fieldname: account_id, 'date': date, |
569 | 337 | 'source_date': aline.source_date or aline.date, 'journal_id': correction_journal_id}, context=context) | 337 | 'source_date': aline.source_date or aline.date, 'journal_id': correction_journal_id}, context=context) |
570 | 338 | self.pool.get('account.analytic.line').write(cr, uid, cor_ids, {'last_corrected_id': aline.id}) | ||
571 | 338 | # finally flag analytic line as reallocated | 339 | # finally flag analytic line as reallocated |
572 | 339 | self.pool.get('account.analytic.line').write(cr, uid, [aline.id], {'is_reallocated': True}) | 340 | self.pool.get('account.analytic.line').write(cr, uid, [aline.id], {'is_reallocated': True}) |
573 | 340 | else: | 341 | else: |
574 | 341 | 342 | ||
575 | === modified file 'analytic_distribution/analytic_line_view.xml' | |||
576 | --- analytic_distribution/analytic_line_view.xml 2013-07-08 16:03:00 +0000 | |||
577 | +++ analytic_distribution/analytic_line_view.xml 2013-11-06 10:36:19 +0000 | |||
578 | @@ -11,11 +11,6 @@ | |||
579 | 11 | <field name="priority" eval="11"/> | 11 | <field name="priority" eval="11"/> |
580 | 12 | <field name="arch" type="xml"> | 12 | <field name="arch" type="xml"> |
581 | 13 | <data> | 13 | <data> |
582 | 14 | <xpath expr="/tree/field[@name='journal_id']" position='before'> | ||
583 | 15 | <field name="is_reallocated" invisible="1"/> | ||
584 | 16 | <button string="Have been reallocated" attrs="{'invisible': [('is_reallocated', '=', False)]}" | ||
585 | 17 | icon="terp-mail-" colspan="2"/> | ||
586 | 18 | </xpath> | ||
587 | 19 | <xpath expr="/tree/field[@name='move_id']" position='replace'> | 14 | <xpath expr="/tree/field[@name='move_id']" position='replace'> |
588 | 20 | <field name="entry_sequence"/> | 15 | <field name="entry_sequence"/> |
589 | 21 | </xpath> | 16 | </xpath> |
590 | 22 | 17 | ||
591 | === modified file 'analytic_distribution_invoice/account_invoice_view.xml' | |||
592 | --- analytic_distribution_invoice/account_invoice_view.xml 2013-03-26 17:07:53 +0000 | |||
593 | +++ analytic_distribution_invoice/account_invoice_view.xml 2013-11-06 10:36:19 +0000 | |||
594 | @@ -26,7 +26,11 @@ | |||
595 | 26 | <field name="is_allocatable" invisible="1"/> | 26 | <field name="is_allocatable" invisible="1"/> |
596 | 27 | </xpath> | 27 | </xpath> |
597 | 28 | <xpath expr="//tree[@string='Invoice lines']" position="attributes"> | 28 | <xpath expr="//tree[@string='Invoice lines']" position="attributes"> |
599 | 29 | <attribute name="colors">red:analytic_distribution_state in ('invalid') or inactive_product == True;blue:analytic_distribution_state in ('valid') and inactive_product == False;black:analytic_distribution_state in ('none') and inactive_product = False</attribute> | 29 | <attribute name="colors">red:analytic_distribution_state in ('invalid') or inactive_product == True;blue:analytic_distribution_state in ('valid') and inactive_product == False;black:analytic_distribution_state in ('none') and inactive_product == False</attribute> |
600 | 30 | </xpath> | ||
601 | 31 | <xpath expr="//tree[@string='Invoice lines']/field[@name='product_id']" position="before"> | ||
602 | 32 | <field name="is_corrected" invisible="1"/> | ||
603 | 33 | <button name="button_open_analytic_lines" string="Have been corrected" type="object" icon="terp-mail-" attrs="{'invisible': [('is_corrected', '=', False)]}"/> | ||
604 | 30 | </xpath> | 34 | </xpath> |
605 | 31 | </data> | 35 | </data> |
606 | 32 | </field> | 36 | </field> |
607 | 33 | 37 | ||
608 | === modified file 'analytic_distribution_invoice/invoice.py' | |||
609 | --- analytic_distribution_invoice/invoice.py 2013-07-19 13:23:03 +0000 | |||
610 | +++ analytic_distribution_invoice/invoice.py 2013-11-06 10:36:19 +0000 | |||
611 | @@ -128,9 +128,12 @@ | |||
612 | 128 | # Give false analytic lines for 'line' in order not to give an error | 128 | # Give false analytic lines for 'line' in order not to give an error |
613 | 129 | if 'analytic_line_ids' in el[2]: | 129 | if 'analytic_line_ids' in el[2]: |
614 | 130 | el[2]['analytic_line_ids'] = False | 130 | el[2]['analytic_line_ids'] = False |
618 | 131 | # Give false order_line_id in order not to give an error | 131 | # Give false for (because not needed): |
619 | 132 | if 'order_line_id' in el[2]: | 132 | # - order_line_id |
620 | 133 | el[2]['order_line_id'] = el[2].get('order_line_id', False) and el[2]['order_line_id'][0] or False | 133 | # - sale_order_line_id |
621 | 134 | for field in ['order_line_id', 'sale_order_line_id']: | ||
622 | 135 | if field in el[2]: | ||
623 | 136 | el[2][field] = el[2].get(field, False) and el[2][field][0] or False | ||
624 | 134 | return res | 137 | return res |
625 | 135 | 138 | ||
626 | 136 | def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None, document_date=None): | 139 | def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None, document_date=None): |
627 | 137 | 140 | ||
628 | === modified file 'msf_instance/msf_instance_view.xml' | |||
629 | --- msf_instance/msf_instance_view.xml 2013-10-31 21:48:37 +0000 | |||
630 | +++ msf_instance/msf_instance_view.xml 2013-11-06 10:36:19 +0000 | |||
631 | @@ -125,6 +125,7 @@ | |||
632 | 125 | <field name="model">account.analytic.line</field> | 125 | <field name="model">account.analytic.line</field> |
633 | 126 | <field name="type">tree</field> | 126 | <field name="type">tree</field> |
634 | 127 | <field name="inherit_id" ref="account.view_account_analytic_line_tree"/> | 127 | <field name="inherit_id" ref="account.view_account_analytic_line_tree"/> |
635 | 128 | <field name="priority" eval="18"/> | ||
636 | 128 | <field name="arch" type="xml"> | 129 | <field name="arch" type="xml"> |
637 | 129 | <field name="journal_id" position="before"> | 130 | <field name="journal_id" position="before"> |
638 | 130 | <field name="instance_id" readonly="1"/> | 131 | <field name="instance_id" readonly="1"/> |
639 | @@ -297,6 +298,20 @@ | |||
640 | 297 | </field> | 298 | </field> |
641 | 298 | </record> | 299 | </record> |
642 | 299 | 300 | ||
643 | 301 | <record id="view_move_line_tree_from_move_inherit" model="ir.ui.view"> | ||
644 | 302 | <field name="name">account.move.line.tree.from.move.inherit</field> | ||
645 | 303 | <field name="model">account.move.line</field> | ||
646 | 304 | <field name="type">tree</field> | ||
647 | 305 | <field name="inherit_id" ref="register_accounting.view_move_line_tree_from_move"/> | ||
648 | 306 | <field name="arch" type="xml"> | ||
649 | 307 | <data> | ||
650 | 308 | <xpath expr="/tree/field[@name='is_corrigible']" position="before"> | ||
651 | 309 | <field name="instance_id" readonly="1"/> | ||
652 | 310 | </xpath> | ||
653 | 311 | </data> | ||
654 | 312 | </field> | ||
655 | 313 | </record> | ||
656 | 314 | |||
657 | 300 | <record id="view_account_move_line_filter_instance_inherit" model="ir.ui.view"> | 315 | <record id="view_account_move_line_filter_instance_inherit" model="ir.ui.view"> |
658 | 301 | <field name="name">account.move.line.filter.instance.inherit</field> | 316 | <field name="name">account.move.line.filter.instance.inherit</field> |
659 | 302 | <field name="model">account.move.line</field> | 317 | <field name="model">account.move.line</field> |
660 | 303 | 318 | ||
661 | === modified file 'register_accounting/account_bank_statement.py' | |||
662 | --- register_accounting/account_bank_statement.py 2013-10-14 16:04:11 +0000 | |||
663 | +++ register_accounting/account_bank_statement.py 2013-11-06 10:36:19 +0000 | |||
664 | @@ -862,6 +862,52 @@ | |||
665 | 862 | return open_register_view(self, cr, uid, st_line.statement_id.id) | 862 | return open_register_view(self, cr, uid, st_line.statement_id.id) |
666 | 863 | raise osv.except_osv(_('Warning'), _('You have to select some line to return to a register.')) | 863 | raise osv.except_osv(_('Warning'), _('You have to select some line to return to a register.')) |
667 | 864 | 864 | ||
668 | 865 | def get_analytic_lines(self, cr, uid, ids, context=None): | ||
669 | 866 | """ | ||
670 | 867 | Give all analytic lines linked to the given register line(s) | ||
671 | 868 | """ | ||
672 | 869 | # Some verifications | ||
673 | 870 | if not context: | ||
674 | 871 | context = {} | ||
675 | 872 | if not 'active_ids' in context or not context.get('active_ids', False): | ||
676 | 873 | raise osv.except_osv(_('Error'), _('No line selected!')) | ||
677 | 874 | # Use right register line IDS | ||
678 | 875 | ids = context.get('active_ids') | ||
679 | 876 | if isinstance(ids, (int, long)): | ||
680 | 877 | ids = [ids] | ||
681 | 878 | # Check which move_id to use | ||
682 | 879 | move_ids = [] | ||
683 | 880 | for absl in self.browse(cr, uid, ids): | ||
684 | 881 | if absl.move_ids: | ||
685 | 882 | # Default ones (direct link to register lines) | ||
686 | 883 | for m in absl.move_ids: | ||
687 | 884 | if m.id not in move_ids: | ||
688 | 885 | move_ids.append(m.id) | ||
689 | 886 | # Those from cash advance return (we should use the reconciliation to find the return and its expenses) | ||
690 | 887 | for ml in m.line_id: | ||
691 | 888 | if ml.reconcile_id and ml.reconcile_id.line_id: | ||
692 | 889 | for line in ml.reconcile_id.line_id: | ||
693 | 890 | if line.move_id and line.move_id.id and line.move_id.id not in move_ids: | ||
694 | 891 | move_ids.append(line.move_id.id) | ||
695 | 892 | # Those from pending payments (imported_invoice_line_ids are move_line) | ||
696 | 893 | if absl.imported_invoice_line_ids: | ||
697 | 894 | for ml in absl.imported_invoice_line_ids: | ||
698 | 895 | if ml.move_id and ml.move_id.id not in move_ids: | ||
699 | 896 | move_ids.append(ml.move_id.id) | ||
700 | 897 | # Search valid ids | ||
701 | 898 | domain = [('account_id.category', '=', 'FUNDING'), ('move_id.move_id', 'in', move_ids)] | ||
702 | 899 | context.update({'display_fp': True}) # to display "Funding Pool" column name instead of "Analytic account" | ||
703 | 900 | return { | ||
704 | 901 | 'name': _('Analytic Journal Items'), | ||
705 | 902 | 'type': 'ir.actions.act_window', | ||
706 | 903 | 'res_model': 'account.analytic.line', | ||
707 | 904 | 'view_type': 'form', | ||
708 | 905 | 'view_mode': 'tree,form', | ||
709 | 906 | 'context': context, | ||
710 | 907 | 'domain': domain, | ||
711 | 908 | 'target': 'current', | ||
712 | 909 | } | ||
713 | 910 | |||
714 | 865 | def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): | 911 | def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): |
715 | 866 | """ | 912 | """ |
716 | 867 | Create move from the register line | 913 | Create move from the register line |
717 | @@ -1714,6 +1760,17 @@ | |||
718 | 1714 | """ | 1760 | """ |
719 | 1715 | return self.posting(cr, uid, ids, 'temp', context=context) | 1761 | return self.posting(cr, uid, ids, 'temp', context=context) |
720 | 1716 | 1762 | ||
721 | 1763 | def button_analytic_lines(self, cr, uid, ids, context=None): | ||
722 | 1764 | """ | ||
723 | 1765 | Give analytic lines linked to the given register lines | ||
724 | 1766 | """ | ||
725 | 1767 | if not context: | ||
726 | 1768 | context = {} | ||
727 | 1769 | # Update context | ||
728 | 1770 | context.update({'active_ids': ids}) | ||
729 | 1771 | # Return result of action named "Analytic Lines" on register lines | ||
730 | 1772 | return self.get_analytic_lines(cr, uid, ids, context=context) | ||
731 | 1773 | |||
732 | 1717 | def unlink(self, cr, uid, ids, context=None): | 1774 | def unlink(self, cr, uid, ids, context=None): |
733 | 1718 | """ | 1775 | """ |
734 | 1719 | Permit to delete some account_bank_statement_line. But do some treatments on temp posting lines and do nothing for hard posting lines. | 1776 | Permit to delete some account_bank_statement_line. But do some treatments on temp posting lines and do nothing for hard posting lines. |
735 | 1720 | 1777 | ||
736 | === modified file 'register_accounting/account_invoice_view.xml' | |||
737 | --- register_accounting/account_invoice_view.xml 2013-09-11 14:31:05 +0000 | |||
738 | +++ register_accounting/account_invoice_view.xml 2013-11-06 10:36:19 +0000 | |||
739 | @@ -130,6 +130,8 @@ | |||
740 | 130 | address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False}" | 130 | address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False}" |
741 | 131 | name="invoice_line" nolabel="1" attrs="{'readonly': [('state', 'not in', ['draft', 'open']), ('is_direct_invoice', '=', True)]}"> | 131 | name="invoice_line" nolabel="1" attrs="{'readonly': [('state', 'not in', ['draft', 'open']), ('is_direct_invoice', '=', True)]}"> |
742 | 132 | <tree editable="bottom" string="Invoice lines" colors="blue:inactive_product == False and analytic_distribution_state in ('valid');red:analytic_distribution_state in ('invalid') or inactive_product == True;black:inactive_product == False and analytic_distribution_state in ('none')"> | 132 | <tree editable="bottom" string="Invoice lines" colors="blue:inactive_product == False and analytic_distribution_state in ('valid');red:analytic_distribution_state in ('invalid') or inactive_product == True;black:inactive_product == False and analytic_distribution_state in ('none')"> |
743 | 133 | <field name="is_corrected" invisible="1"/> | ||
744 | 134 | <button name="button_open_analytic_lines" string="Have been corrected" type="object" icon="terp-mail-" attrs="{'invisible': [('is_corrected', '=', False)]}"/> | ||
745 | 133 | <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, | 135 | <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, |
746 | 134 | parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, | 136 | parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, |
747 | 135 | {'company_id': parent.company_id})"/> | 137 | {'company_id': parent.company_id})"/> |
748 | 136 | 138 | ||
749 | === modified file 'register_accounting/account_view.xml' | |||
750 | --- register_accounting/account_view.xml 2013-10-14 16:04:11 +0000 | |||
751 | +++ register_accounting/account_view.xml 2013-11-06 10:36:19 +0000 | |||
752 | @@ -55,6 +55,7 @@ | |||
753 | 55 | <field colspan="4" name="line_ids" nolabel="1"> | 55 | <field colspan="4" name="line_ids" nolabel="1"> |
754 | 56 | <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')"> | 56 | <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')"> |
755 | 57 | <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" /> | 57 | <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" /> |
756 | 58 | <button name="button_analytic_lines" string="Analytic lines" type="object" icon="terp-stock_zoom" /> | ||
757 | 58 | <field name="document_date" attrs="{'readonly': [('from_import_cheque_id', '!=', False)]}"/> | 59 | <field name="document_date" attrs="{'readonly': [('from_import_cheque_id', '!=', False)]}"/> |
758 | 59 | <field name="date"/> | 60 | <field name="date"/> |
759 | 60 | <field name="sequence_for_reference" /> | 61 | <field name="sequence_for_reference" /> |
760 | @@ -189,6 +190,7 @@ | |||
761 | 189 | <field colspan="4" name="line_ids" nolabel="1"> | 190 | <field colspan="4" name="line_ids" nolabel="1"> |
762 | 190 | <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')"> | 191 | <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')"> |
763 | 191 | <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" /> | 192 | <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" /> |
764 | 193 | <button name="button_analytic_lines" string="Analytic lines" type="object" icon="terp-stock_zoom" /> | ||
765 | 192 | <field name="from_cash_return" invisible="1"/> | 194 | <field name="from_cash_return" invisible="1"/> |
766 | 193 | <button name="button_advance" states="hard" string="Advance return" type="object" | 195 | <button name="button_advance" states="hard" string="Advance return" type="object" |
767 | 194 | icon="terp-stock_effects-object-colorize" context="context" | 196 | icon="terp-stock_effects-object-colorize" context="context" |
768 | @@ -355,6 +357,7 @@ | |||
769 | 355 | icon="terp-stock_effects-object-colorize" context="context" | 357 | icon="terp-stock_effects-object-colorize" context="context" |
770 | 356 | attrs="{'invisible': ['|', ('from_cash_return', '=', True), '|', ('amount', '>=', 0), | 358 | attrs="{'invisible': ['|', ('from_cash_return', '=', True), '|', ('amount', '>=', 0), |
771 | 357 | ('employee_id', '=', False)]}"/> | 359 | ('employee_id', '=', False)]}"/> |
772 | 360 | <button name="button_analytic_lines" string="Analytic lines" type="object" icon="terp-stock_zoom" /> | ||
773 | 358 | <field name="from_cash_return" invisible="1"/> | 361 | <field name="from_cash_return" invisible="1"/> |
774 | 359 | <field name="amount" invisible="1"/> | 362 | <field name="amount" invisible="1"/> |
775 | 360 | <field name="document_date"/> | 363 | <field name="document_date"/> |
776 | @@ -663,6 +666,7 @@ | |||
777 | 663 | <!-- WARNING: because of UTP-331, in cheque register direct invoice lines should be editable but ONLY for cheque_number FIELD. That's why ALL field must be not editable when "direct_invoice" is True. --> | 666 | <!-- WARNING: because of UTP-331, in cheque register direct invoice lines should be editable but ONLY for cheque_number FIELD. That's why ALL field must be not editable when "direct_invoice" is True. --> |
778 | 664 | <tree editable="bottom" string="Statement lines" noteditable="state=='hard'" colors="red:display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')"> | 667 | <tree editable="bottom" string="Statement lines" noteditable="state=='hard'" colors="red:display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')"> |
779 | 665 | <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" /> | 668 | <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" /> |
780 | 669 | <button name="button_analytic_lines" string="Analytic lines" type="object" icon="terp-stock_zoom" /> | ||
781 | 666 | <field name="document_date" attrs="{'readonly': [('direct_invoice', '=', True)]}"/> | 670 | <field name="document_date" attrs="{'readonly': [('direct_invoice', '=', True)]}"/> |
782 | 667 | <field name="date" attrs="{'readonly': [('direct_invoice', '=', True)]}"/> | 671 | <field name="date" attrs="{'readonly': [('direct_invoice', '=', True)]}"/> |
783 | 668 | <field name="cheque_number" required="1"/> | 672 | <field name="cheque_number" required="1"/> |
784 | @@ -910,6 +914,12 @@ | |||
785 | 910 | <field name="priority" eval="1"/> | 914 | <field name="priority" eval="1"/> |
786 | 911 | <field name="arch" type="xml"> | 915 | <field name="arch" type="xml"> |
787 | 912 | <tree string="Journal Items" editable="bottom" noteditable="1" colors="red:state in ('draft');black:state in ('valid')" hide_new_button="1"> | 916 | <tree string="Journal Items" editable="bottom" noteditable="1" colors="red:state in ('draft');black:state in ('valid')" hide_new_button="1"> |
788 | 917 | <field name="is_corrigible" invisible="1"/> | ||
789 | 918 | <field name="have_an_historic" invisible="1"/> | ||
790 | 919 | <button name="button_do_accounting_corrections" type="object" string="Open Accounting Correction Wizard" | ||
791 | 920 | attrs="{'invisible': [('is_corrigible', '=', False)]}" icon="terp-mail-message-new"/> | ||
792 | 921 | <button name="button_open_corrections" type="object" string="Open corrections history" | ||
793 | 922 | attrs="{'invisible': [('have_an_historic', '=', False)]}" icon="terp-mail-"/> | ||
794 | 913 | <field name="journal_id"/> | 923 | <field name="journal_id"/> |
795 | 914 | <field name="move_id"/> | 924 | <field name="move_id"/> |
796 | 915 | <field name="name"/> | 925 | <field name="name"/> |
797 | 916 | 926 | ||
798 | === modified file 'register_accounting/account_wizard.xml' | |||
799 | --- register_accounting/account_wizard.xml 2013-01-30 15:51:06 +0000 | |||
800 | +++ register_accounting/account_wizard.xml 2013-11-06 10:36:19 +0000 | |||
801 | @@ -42,6 +42,7 @@ | |||
802 | 42 | Account bank statement lines | 42 | Account bank statement lines |
803 | 43 | --> | 43 | --> |
804 | 44 | 44 | ||
805 | 45 | <!-- Return to the register linked to the given line --> | ||
806 | 45 | <record id="action_return_to_register" model="ir.actions.server"> | 46 | <record id="action_return_to_register" model="ir.actions.server"> |
807 | 46 | <field name="name">Return to register</field> | 47 | <field name="name">Return to register</field> |
808 | 47 | <field name="model_id" ref="model_account_bank_statement_line"/> | 48 | <field name="model_id" ref="model_account_bank_statement_line"/> |
809 | @@ -57,5 +58,21 @@ | |||
810 | 57 | <field eval="True" name="object"/> | 58 | <field eval="True" name="object"/> |
811 | 58 | </record> | 59 | </record> |
812 | 59 | 60 | ||
813 | 61 | <!-- Display all Analytic Lines attached to given Register Lines --> | ||
814 | 62 | <record id="action_analytic_register_lines" model="ir.actions.server"> | ||
815 | 63 | <field name="name">Analytic Lines</field> | ||
816 | 64 | <field name="model_id" ref="model_account_bank_statement_line"/> | ||
817 | 65 | <field name="state">code</field> | ||
818 | 66 | <field name="code">action = obj.get_analytic_lines(context=context)</field> | ||
819 | 67 | </record> | ||
820 | 68 | |||
821 | 69 | <record id="ir_open_analytic_register_lines" model="ir.values"> | ||
822 | 70 | <field name="key2">client_action_multi</field> | ||
823 | 71 | <field name="model">account.bank.statement.line</field> | ||
824 | 72 | <field name="name">Analytic Lines</field> | ||
825 | 73 | <field eval="'ir.actions.server,%d'%action_analytic_register_lines" name="value"/> | ||
826 | 74 | <field eval="True" name="object"/> | ||
827 | 75 | </record> | ||
828 | 76 | |||
829 | 60 | </data> | 77 | </data> |
830 | 61 | </openerp> | 78 | </openerp> |