Merge lp:~gs.clearcorp/openerp-ccorp-addons/7.0_account_asset_extended_ccorp into lp:openerp-ccorp-addons/7.0
- 7.0_account_asset_extended_ccorp
- Merge into 7.0
Proposed by
Glen Sojo
Status: | Merged |
---|---|
Merged at revision: | 797 |
Proposed branch: | lp:~gs.clearcorp/openerp-ccorp-addons/7.0_account_asset_extended_ccorp |
Merge into: | lp:openerp-ccorp-addons/7.0 |
Diff against target: |
452 lines (+310/-56) 7 files modified
account_asset_extended_ccorp/__init__.py (+1/-0) account_asset_extended_ccorp/__openerp__.py (+4/-1) account_asset_extended_ccorp/i18n/account_asset_extended.pot (+0/-49) account_asset_extended_ccorp/i18n/es_CR.po (+81/-6) account_asset_extended_ccorp/report/__init__.py (+25/-0) account_asset_extended_ccorp/report/extended_asset_report.py (+127/-0) account_asset_extended_ccorp/report/extended_asset_report_view.xml (+72/-0) |
To merge this branch: | bzr merge lp:~gs.clearcorp/openerp-ccorp-addons/7.0_account_asset_extended_ccorp |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ClearCorp drivers | Pending | ||
Review via email: mp+199845@code.launchpad.net |
Commit message
Description of the change
[ADD] Module account_
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'account_asset_extended_ccorp/__init__.py' |
2 | --- account_asset_extended_ccorp/__init__.py 2013-05-16 22:17:03 +0000 |
3 | +++ account_asset_extended_ccorp/__init__.py 2013-12-20 17:52:16 +0000 |
4 | @@ -21,5 +21,6 @@ |
5 | ############################################################################## |
6 | |
7 | import account_asset_extended_ccorp |
8 | +import report |
9 | |
10 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
11 | |
12 | === modified file 'account_asset_extended_ccorp/__openerp__.py' |
13 | --- account_asset_extended_ccorp/__openerp__.py 2013-05-16 22:17:03 +0000 |
14 | +++ account_asset_extended_ccorp/__openerp__.py 2013-12-20 17:52:16 +0000 |
15 | @@ -37,7 +37,10 @@ |
16 | 'depends': ['account_asset'], |
17 | 'init_xml': [], |
18 | 'demo_xml': [], |
19 | - 'data': ['account_asset_extended_ccorp_view.xml'], |
20 | + 'data': [ |
21 | + 'account_asset_extended_ccorp_view.xml', |
22 | + 'report/extended_asset_report_view.xml', |
23 | + ], |
24 | 'license': 'AGPL-3', |
25 | 'installable': True, |
26 | 'active': False, |
27 | |
28 | === removed file 'account_asset_extended_ccorp/i18n/account_asset_extended.pot' |
29 | --- account_asset_extended_ccorp/i18n/account_asset_extended.pot 2013-05-16 22:17:03 +0000 |
30 | +++ account_asset_extended_ccorp/i18n/account_asset_extended.pot 1970-01-01 00:00:00 +0000 |
31 | @@ -1,49 +0,0 @@ |
32 | -# Translation of OpenERP Server. |
33 | -# This file contains the translation of the following modules: |
34 | -# * account_asset_extended_ccorp |
35 | -# |
36 | -msgid "" |
37 | -msgstr "" |
38 | -"Project-Id-Version: OpenERP Server 7.0\n" |
39 | -"Report-Msgid-Bugs-To: \n" |
40 | -"POT-Creation-Date: 2013-05-16 22:09+0000\n" |
41 | -"PO-Revision-Date: 2013-05-16 22:09+0000\n" |
42 | -"Last-Translator: <>\n" |
43 | -"Language-Team: \n" |
44 | -"MIME-Version: 1.0\n" |
45 | -"Content-Type: text/plain; charset=UTF-8\n" |
46 | -"Content-Transfer-Encoding: \n" |
47 | -"Plural-Forms: \n" |
48 | - |
49 | -#. module: account_asset_extended_ccorp |
50 | -#: field:account.asset.asset,responsible:0 |
51 | -msgid "Responsible" |
52 | -msgstr "Responsible" |
53 | - |
54 | -#. module: account_asset_extended_ccorp |
55 | -#: field:account.asset.asset,account_invoice_line_id:0 |
56 | -#: model:ir.model,name:account_asset_extended_ccorp.model_account_invoice_line |
57 | -msgid "Invoice Line" |
58 | -msgstr "Línea factura" |
59 | - |
60 | -#. module: account_asset_extended_ccorp |
61 | -#: field:account.invoice.line,asset_ids:0 |
62 | -#: model:ir.model,name:account_asset_extended_ccorp.model_account_asset_asset |
63 | -msgid "Asset" |
64 | -msgstr "Activo" |
65 | - |
66 | -#. module: account_asset_extended_ccorp |
67 | -#: field:account.asset.asset,account_invoice_id:0 |
68 | -msgid "Invoice" |
69 | -msgstr "Invoice" |
70 | - |
71 | -#. module: account_asset_extended_ccorp |
72 | -#: field:account.asset.asset,asset_number:0 |
73 | -msgid "Asset Number" |
74 | -msgstr "Asset Number" |
75 | - |
76 | -#. module: account_asset_extended_ccorp |
77 | -#: field:account.asset.asset,model:0 |
78 | -msgid "Model" |
79 | -msgstr "Model" |
80 | - |
81 | |
82 | === modified file 'account_asset_extended_ccorp/i18n/es_CR.po' |
83 | --- account_asset_extended_ccorp/i18n/es_CR.po 2013-05-16 22:17:03 +0000 |
84 | +++ account_asset_extended_ccorp/i18n/es_CR.po 2013-12-20 17:52:16 +0000 |
85 | @@ -6,8 +6,8 @@ |
86 | msgstr "" |
87 | "Project-Id-Version: OpenERP Server 7.0\n" |
88 | "Report-Msgid-Bugs-To: \n" |
89 | -"POT-Creation-Date: 2013-05-16 22:09+0000\n" |
90 | -"PO-Revision-Date: 2013-05-16 22:09+0000\n" |
91 | +"POT-Creation-Date: 2013-12-20 17:12+0000\n" |
92 | +"PO-Revision-Date: 2013-12-20 17:12+0000\n" |
93 | "Last-Translator: <>\n" |
94 | "Language-Team: \n" |
95 | "MIME-Version: 1.0\n" |
96 | @@ -16,34 +16,109 @@ |
97 | "Plural-Forms: \n" |
98 | |
99 | #. module: account_asset_extended_ccorp |
100 | +#: model:ir.actions.act_window,help:account_asset_extended_ccorp.action_asset_report_extended |
101 | +msgid "<p>\n" |
102 | +" From this report, you can have an overview on all depreciation. The\n" |
103 | +" tool search can also be used to personalise your Assets reports and\n" |
104 | +" so, match this analysis to your needs;\n" |
105 | +" </p>\n" |
106 | +" " |
107 | +msgstr "<p>Desde este informe, se puede tener una vista global de todas las depreciaciones. Se puede utilizar también la herramienta de búsqueda para personalizar los informes de activos y, de esa forma, hacer que el análisis case con sus necesidades;</p>\n" |
108 | +" " |
109 | + |
110 | +#. module: account_asset_extended_ccorp |
111 | #: field:account.asset.asset,responsible:0 |
112 | +#: field:asset.asset.report.extended,responsible_id:0 |
113 | msgid "Responsible" |
114 | msgstr "Responsable" |
115 | |
116 | #. module: account_asset_extended_ccorp |
117 | +#: field:account.asset.asset,account_invoice_id:0 |
118 | +#: view:asset.asset.report.extended:0 |
119 | +#: field:asset.asset.report.extended,invoice_id:0 |
120 | +msgid "Invoice" |
121 | +msgstr "Factura" |
122 | + |
123 | +#. module: account_asset_extended_ccorp |
124 | +#: field:asset.asset.report.extended,value_residual:0 |
125 | +msgid "Residual Value" |
126 | +msgstr "Valor residual" |
127 | + |
128 | +#. module: account_asset_extended_ccorp |
129 | +#: view:asset.asset.report.extended:0 |
130 | +#: model:ir.actions.act_window,name:account_asset_extended_ccorp.action_asset_report_extended |
131 | +#: model:ir.ui.menu,name:account_asset_extended_ccorp.menu_action_asset_report_extended |
132 | +msgid "Assets Analysis Extended" |
133 | +msgstr "Análisis de activos extendido" |
134 | + |
135 | +#. module: account_asset_extended_ccorp |
136 | +#: field:asset.asset.report.extended,depreciation:0 |
137 | +msgid "Depreciation" |
138 | +msgstr "Depreciación" |
139 | + |
140 | +#. module: account_asset_extended_ccorp |
141 | #: field:account.asset.asset,account_invoice_line_id:0 |
142 | #: model:ir.model,name:account_asset_extended_ccorp.model_account_invoice_line |
143 | msgid "Invoice Line" |
144 | msgstr "Línea factura" |
145 | |
146 | #. module: account_asset_extended_ccorp |
147 | +#: view:asset.asset.report.extended:0 |
148 | +msgid "Assets Analysis" |
149 | +msgstr "Análisis de activos" |
150 | + |
151 | +#. module: account_asset_extended_ccorp |
152 | +#: view:asset.asset.report.extended:0 |
153 | +msgid "Group By..." |
154 | +msgstr "Agrupar por..." |
155 | + |
156 | +#. module: account_asset_extended_ccorp |
157 | +#: field:asset.asset.report.extended,salvage_value:0 |
158 | +msgid "Salvage Amount" |
159 | +msgstr "Valor de salvaguarda" |
160 | + |
161 | +#. module: account_asset_extended_ccorp |
162 | +#: field:asset.asset.report.extended,gross_value:0 |
163 | +msgid "Gross Amount" |
164 | +msgstr "Valor bruto" |
165 | + |
166 | +#. module: account_asset_extended_ccorp |
167 | #: field:account.invoice.line,asset_ids:0 |
168 | +#: field:asset.asset.report.extended,asset_id:0 |
169 | #: model:ir.model,name:account_asset_extended_ccorp.model_account_asset_asset |
170 | msgid "Asset" |
171 | msgstr "Activo" |
172 | |
173 | #. module: account_asset_extended_ccorp |
174 | -#: field:account.asset.asset,account_invoice_id:0 |
175 | -msgid "Invoice" |
176 | -msgstr "Factura" |
177 | +#: view:asset.asset.report.extended:0 |
178 | +#: field:asset.asset.report.extended,asset_category_id:0 |
179 | +msgid "Asset Category" |
180 | +msgstr "Categoría de activo" |
181 | |
182 | #. module: account_asset_extended_ccorp |
183 | #: field:account.asset.asset,asset_number:0 |
184 | +#: field:asset.asset.report.extended,asset_number:0 |
185 | msgid "Asset Number" |
186 | -msgstr "Número de Activo" |
187 | +msgstr "Número de activo" |
188 | + |
189 | +#. module: account_asset_extended_ccorp |
190 | +#: view:asset.asset.report.extended:0 |
191 | +#: field:asset.asset.report.extended,supplier_id:0 |
192 | +msgid "Supplier" |
193 | +msgstr "Proveedor" |
194 | |
195 | #. module: account_asset_extended_ccorp |
196 | #: field:account.asset.asset,model:0 |
197 | +#: field:asset.asset.report.extended,model:0 |
198 | msgid "Model" |
199 | msgstr "Modelo" |
200 | |
201 | +#. module: account_asset_extended_ccorp |
202 | +#: field:asset.asset.report.extended,name:0 |
203 | +msgid "Asset Name" |
204 | +msgstr "Nombre de activo" |
205 | + |
206 | +#. module: account_asset_extended_ccorp |
207 | +#: view:asset.asset.report.extended:0 |
208 | +msgid "Residual Value per Category" |
209 | +msgstr "Valor residual por categoría" |
210 | |
211 | === added directory 'account_asset_extended_ccorp/report' |
212 | === added file 'account_asset_extended_ccorp/report/__init__.py' |
213 | --- account_asset_extended_ccorp/report/__init__.py 1970-01-01 00:00:00 +0000 |
214 | +++ account_asset_extended_ccorp/report/__init__.py 2013-12-20 17:52:16 +0000 |
215 | @@ -0,0 +1,25 @@ |
216 | +# -*- coding: utf-8 -*- |
217 | +############################################################################## |
218 | +# |
219 | +# OpenERP, Open Source Management Solution |
220 | +# Addons modules by CLEARCORP S.A. |
221 | +# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). |
222 | +# |
223 | +# This program is free software: you can redistribute it and/or modify |
224 | +# it under the terms of the GNU Affero General Public License as |
225 | +# published by the Free Software Foundation, either version 3 of the |
226 | +# License, or (at your option) any later version. |
227 | +# |
228 | +# This program is distributed in the hope that it will be useful, |
229 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
230 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
231 | +# GNU Affero General Public License for more details. |
232 | +# |
233 | +# You should have received a copy of the GNU Affero General Public License |
234 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
235 | +# |
236 | +############################################################################## |
237 | + |
238 | +import extended_asset_report |
239 | + |
240 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
241 | \ No newline at end of file |
242 | |
243 | === added file 'account_asset_extended_ccorp/report/extended_asset_report.py' |
244 | --- account_asset_extended_ccorp/report/extended_asset_report.py 1970-01-01 00:00:00 +0000 |
245 | +++ account_asset_extended_ccorp/report/extended_asset_report.py 2013-12-20 17:52:16 +0000 |
246 | @@ -0,0 +1,127 @@ |
247 | +# -*- coding: utf-8 -*- |
248 | +############################################################################## |
249 | +# |
250 | +# OpenERP, Open Source Management Solution |
251 | +# Addons modules by CLEARCORP S.A. |
252 | +# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). |
253 | +# |
254 | +# This program is free software: you can redistribute it and/or modify |
255 | +# it under the terms of the GNU Affero General Public License as |
256 | +# published by the Free Software Foundation, either version 3 of the |
257 | +# License, or (at your option) any later version. |
258 | +# |
259 | +# This program is distributed in the hope that it will be useful, |
260 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
261 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
262 | +# GNU Affero General Public License for more details. |
263 | +# |
264 | +# You should have received a copy of the GNU Affero General Public License |
265 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
266 | +# |
267 | +############################################################################## |
268 | + |
269 | +from openerp.osv import osv, fields |
270 | +from openerp import tools |
271 | + |
272 | +class extendedAssetReport(osv.Model): |
273 | + |
274 | + _name = 'asset.asset.report.extended' |
275 | + _description = 'Asset Analysis Extended ' |
276 | + _auto = False # Do not create table automatically |
277 | + |
278 | + _columns = _columns = { |
279 | + 'invoice_id': fields.many2one('account.invoice', string='Invoice'), |
280 | + 'name': fields.char('Asset Name', size=64), |
281 | + 'asset_id': fields.many2one('account.asset.asset', string='Asset'), |
282 | + 'asset_category_id': fields.many2one('account.asset.category', string='Asset Category'), |
283 | + 'model': fields.char('Model', size=64), |
284 | + 'asset_number': fields.char('Asset Number', size=64), |
285 | + 'supplier_id': fields.many2one('res.partner', string='Supplier'), |
286 | + 'gross_value': fields.float('Gross Amount', readonly=True), |
287 | + 'salvage_value': fields.float('Salvage Amount', readonly=True), |
288 | + 'depreciation': fields.float('Depreciation', readonly=True), |
289 | + 'value_residual': fields.float('Residual Value', readonly=True), |
290 | + 'responsible_id': fields.many2one('res.partner', string='Responsible'), |
291 | + } |
292 | + |
293 | + def init(self, cr): |
294 | + tools.drop_view_if_exists(cr, 'asset_asset_report_extended') |
295 | + cr.execute("""CREATE OR REPLACE VIEW asset_asset_report_extended AS |
296 | +(SELECT |
297 | + asset.id, |
298 | + (CASE WHEN |
299 | + asset.account_invoice_line_id IS NOT NULL |
300 | + THEN |
301 | + (SELECT |
302 | + invoice.id |
303 | + FROM |
304 | + account_invoice AS invoice, |
305 | + account_invoice_line AS line |
306 | + WHERE |
307 | + line.id = asset.account_invoice_line_id AND |
308 | + line.invoice_id = invoice.id |
309 | + ) |
310 | + ELSE |
311 | + NULL |
312 | + END |
313 | + ) AS invoice_id, |
314 | + asset.name, |
315 | + asset.id AS asset_id, |
316 | + asset.category_id AS asset_category_id, |
317 | + asset.model, |
318 | + asset.asset_number, |
319 | + (CASE WHEN |
320 | + asset.account_invoice_line_id IS NOT NULL |
321 | + THEN |
322 | + (SELECT |
323 | + b.partner_id |
324 | + FROM |
325 | + account_asset_asset AS a, |
326 | + account_invoice_line AS b |
327 | + WHERE |
328 | + a.account_invoice_line_id = b.id AND |
329 | + a.id = asset.id |
330 | + ) |
331 | + ELSE |
332 | + NULL |
333 | + END |
334 | + ) AS supplier_id, |
335 | + (CASE WHEN |
336 | + (SELECT |
337 | + dp.remaining_value |
338 | + FROM |
339 | + account_asset_depreciation_line AS dp |
340 | + WHERE |
341 | + dp.asset_id = asset.id AND |
342 | + dp.move_check = TRUE |
343 | + ORDER BY |
344 | + dp.sequence DESC |
345 | + LIMIT 1) IS NOT NULL |
346 | + THEN |
347 | + (SELECT |
348 | + dp.remaining_value |
349 | + FROM |
350 | + account_asset_depreciation_line AS dp |
351 | + WHERE |
352 | + dp.asset_id = asset.id AND |
353 | + dp.move_check = TRUE |
354 | + ORDER BY |
355 | + dp.sequence DESC |
356 | + LIMIT 1) |
357 | + ELSE |
358 | + asset.purchase_value |
359 | + END) AS value_residual, |
360 | + asset.purchase_value AS gross_value, |
361 | + asset.salvage_value, |
362 | + (SELECT |
363 | + SUM(dp.amount) |
364 | + FROM |
365 | + account_asset_depreciation_line as dp |
366 | + WHERE |
367 | + dp.asset_id = asset.id AND |
368 | + dp.move_check = TRUE) AS depreciation, |
369 | + asset.responsible AS responsible_id |
370 | +FROM |
371 | + account_asset_asset AS asset)""") |
372 | + |
373 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
374 | \ No newline at end of file |
375 | |
376 | === added file 'account_asset_extended_ccorp/report/extended_asset_report_view.xml' |
377 | --- account_asset_extended_ccorp/report/extended_asset_report_view.xml 1970-01-01 00:00:00 +0000 |
378 | +++ account_asset_extended_ccorp/report/extended_asset_report_view.xml 2013-12-20 17:52:16 +0000 |
379 | @@ -0,0 +1,72 @@ |
380 | +<?xml version="1.0" encoding="utf-8"?> |
381 | +<openerp> |
382 | +<data> |
383 | + |
384 | + <record model="ir.ui.view" id="view_asset_asset_report_extended_tree"> |
385 | + <field name="name">asset.asset.report.extended.tree</field> |
386 | + <field name="model">asset.asset.report.extended</field> |
387 | + <field name="arch" type="xml"> |
388 | + <tree string="Assets Analysis" create="false"> |
389 | + <field name="asset_category_id"/> |
390 | + <field name="asset_id"/> |
391 | + <field name="invoice_id"/> |
392 | + <field name="supplier_id"/> |
393 | + <field name="model"/> |
394 | + <field name="asset_number"/> |
395 | + <field name="gross_value"/> |
396 | + <field name="salvage_value"/> |
397 | + <field name="depreciation"/> |
398 | + <field name="value_residual"/> |
399 | + <field name="responsible_id"/> |
400 | + </tree> |
401 | + </field> |
402 | + </record> |
403 | + |
404 | + <record model="ir.ui.view" id="view_asset_report_extended"> |
405 | + <field name="name">asset.report.extended.graph</field> |
406 | + <field name="model">asset.asset.report.extended</field> |
407 | + <field name="arch" type="xml"> |
408 | + <graph string="Residual Value per Category" type="pie"> |
409 | + <field name="asset_category_id"/> |
410 | + <field name="value_residual"/> |
411 | + </graph> |
412 | + </field> |
413 | + </record> |
414 | + |
415 | + <record id="view_asset_report_extended_search" model="ir.ui.view"> |
416 | + <field name="name">asset.report.extended.search</field> |
417 | + <field name="model">asset.asset.report.extended</field> |
418 | + <field name="arch" type="xml"> |
419 | + <search string="Assets Analysis Extended"> |
420 | + <field name="asset_id"/> |
421 | + <field name="asset_category_id"/> |
422 | + <group expand="1" string="Group By..."> |
423 | + <filter string="Asset Category" name="asset_category" icon="terp-stock_symbol-selection" context="{'group_by':'asset_category_id'}"/> |
424 | + <filter string="Supplier" name="supplier" icon="terp-go-home" context="{'group_by':'supplier_id'}"/> |
425 | + <filter string="Invoice" name="invoice" icon="terp-stock_symbol-selection" context="{'group_by':'invoice_id'}"/> |
426 | + </group> |
427 | + </search> |
428 | + </field> |
429 | + </record> |
430 | + |
431 | + <record model="ir.actions.act_window" id="action_asset_report_extended"> |
432 | + <field name="name">Assets Analysis Extended</field> |
433 | + <field name="res_model">asset.asset.report.extended</field> |
434 | + <field name="view_type">form</field> |
435 | + <field name="view_mode">tree,form,graph</field> |
436 | + <field name="search_view_id" ref="view_asset_report_extended_search"/> |
437 | + <field name="context">{ 'search_default_asset_category':1}</field> |
438 | + <field name="help" type="html"> |
439 | + <p> |
440 | + From this report, you can have an overview on all depreciation. The |
441 | + tool search can also be used to personalise your Assets reports and |
442 | + so, match this analysis to your needs; |
443 | + </p> |
444 | + </field> |
445 | + </record> |
446 | + |
447 | + <menuitem action="action_asset_report_extended" |
448 | + id="menu_action_asset_report_extended" |
449 | + parent="account.menu_finance_reporting"/> |
450 | +</data> |
451 | +</openerp> |
452 | \ No newline at end of file |