Merge lp:~vauxoo/addons-vauxoo/7.0-journal_items_configure_wizard-dev-ernesto into lp:addons-vauxoo/7.0

Status: Needs review
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-journal_items_configure_wizard-dev-ernesto
Merge into: lp:addons-vauxoo/7.0
Diff against target: 265 lines (+232/-0)
6 files modified
journal_items_configure_wizard/__init__.py (+26/-0)
journal_items_configure_wizard/__openerp__.py (+48/-0)
journal_items_configure_wizard/i18n/es.po (+53/-0)
journal_items_configure_wizard/wizard/__init__.py (+26/-0)
journal_items_configure_wizard/wizard/move_lines.py (+45/-0)
journal_items_configure_wizard/wizard/move_lines_wiz_view.xml (+34/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-journal_items_configure_wizard-dev-ernesto
Reviewer Review Type Date Requested Status
Luis Ernesto García Medina - http://www.vauxoo.com Needs Resubmitting
Isaac López Zúñiga Pending
Julio Serna-http://www.vauxoo.com Pending
Moisés López - http://www.vauxoo.com Pending
Review via email: mp+179515@code.launchpad.net

Description of the change

Se creo wizard que busca en los account_move_line el texto "THIS ACCOUNT HAD NEGATIVE VALUES" y cambia los debit por los credit e inversamente después valida las pólizas de estos movimientos

To post a comment you must log in.
719. By Luis Ernesto García Medina - http://www.vauxoo.com

[FIX][journal_items_configure_wizard] changed description of module and fix error with write of account_move_line (needed a list)

Revision history for this message
Luis Ernesto García Medina - http://www.vauxoo.com (ernesto-gm) wrote :

Listo Isaac se soluciono el error al momento de cambiar los debe por los haber y también se agrego la descripción del modulo, hice una pruebas con el respaldo que me pasaste de bioderpac

review: Needs Resubmitting

Unmerged revisions

719. By Luis Ernesto García Medina - http://www.vauxoo.com

[FIX][journal_items_configure_wizard] changed description of module and fix error with write of account_move_line (needed a list)

718. By Luis Ernesto García Medina - http://www.vauxoo.com

[ADD][journal_items_configure_wizard] this module Fix journal items with message "THIS ACCOUNT HAD NEGATIVE VALUES" and invert debit-credit, and validate journal items with this journal items

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'journal_items_configure_wizard'
2=== added file 'journal_items_configure_wizard/__init__.py'
3--- journal_items_configure_wizard/__init__.py 1970-01-01 00:00:00 +0000
4+++ journal_items_configure_wizard/__init__.py 2013-09-03 23:31:15 +0000
5@@ -0,0 +1,26 @@
6+# -*- encoding: utf-8 -*-
7+###########################################################################
8+# Module Writen to OpenERP, Open Source Management Solution
9+#
10+# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
11+# All Rights Reserved.
12+# info Vauxoo (info@vauxoo.com)
13+############################################################################
14+# Coded by: Luis Ernesto García Medina (ernesto_gm@vauxoo.com)
15+############################################################################
16+#
17+# This program is free software: you can redistribute it and/or modify
18+# it under the terms of the GNU Affero General Public License as
19+# published by the Free Software Foundation, either version 3 of the
20+# License, or (at your option) any later version.
21+#
22+# This program is distributed in the hope that it will be useful,
23+# but WITHOUT ANY WARRANTY; without even the implied warranty of
24+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+# GNU Affero General Public License for more details.
26+#
27+# You should have received a copy of the GNU Affero General Public License
28+# along with this program. If not, see <http://www.gnu.org/licenses/>.
29+#
30+##############################################################################
31+import wizard
32
33=== added file 'journal_items_configure_wizard/__openerp__.py'
34--- journal_items_configure_wizard/__openerp__.py 1970-01-01 00:00:00 +0000
35+++ journal_items_configure_wizard/__openerp__.py 2013-09-03 23:31:15 +0000
36@@ -0,0 +1,48 @@
37+# -*- encoding: utf-8 -*-
38+###########################################################################
39+# Module Writen to OpenERP, Open Source Management Solution
40+#
41+# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
42+# All Rights Reserved.
43+# info Vauxoo (info@vauxoo.com)
44+############################################################################
45+# Coded by: Luis Ernesto García Medina (ernesto_gm@vauxoo.com)
46+############################################################################
47+#
48+# This program is free software: you can redistribute it and/or modify
49+# it under the terms of the GNU Affero General Public License as
50+# published by the Free Software Foundation, either version 3 of the
51+# License, or (at your option) any later version.
52+#
53+# This program is distributed in the hope that it will be useful,
54+# but WITHOUT ANY WARRANTY; without even the implied warranty of
55+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56+# GNU Affero General Public License for more details.
57+#
58+# You should have received a copy of the GNU Affero General Public License
59+# along with this program. If not, see <http://www.gnu.org/licenses/>.
60+#
61+##############################################################################
62+
63+{
64+ "name" : "Wizard Configure Journal Items",
65+ "version" : "1.0",
66+ "author" : "Vauxoo",
67+ "category" : "Generic Modules",
68+ "description" : """
69+Configure Journal Items
70+=======================
71+This module checks if the journal items has the text: "THIS ACCOUNT HAD NEGATIVE VALUES"
72+if it is true, inverts the debit amounts of credit for each line, saves the journal entries,
73+validates it and changes the text of in the journal item modified to " FIX THIS ACCOUNT"
74+ """,
75+ "website" : "http://www.vauxoo.com/",
76+ "license" : "AGPL-3",
77+ "depends" : ["account",
78+ ],
79+ "data" : [
80+ "wizard/move_lines_wiz_view.xml",
81+ ],
82+ "installable" : True,
83+ "active" : False,
84+}
85
86=== added directory 'journal_items_configure_wizard/i18n'
87=== added file 'journal_items_configure_wizard/i18n/es.po'
88--- journal_items_configure_wizard/i18n/es.po 1970-01-01 00:00:00 +0000
89+++ journal_items_configure_wizard/i18n/es.po 2013-09-03 23:31:15 +0000
90@@ -0,0 +1,53 @@
91+# Translation of OpenERP Server.
92+# This file contains the translation of the following modules:
93+# * journal_items_configure_wizard
94+#
95+msgid ""
96+msgstr ""
97+"Project-Id-Version: OpenERP Server 7.0\n"
98+"Report-Msgid-Bugs-To: \n"
99+"POT-Creation-Date: 2013-08-09 18:05+0000\n"
100+"PO-Revision-Date: 2013-08-09 13:18-0600\n"
101+"Last-Translator: <>\n"
102+"Language-Team: \n"
103+"MIME-Version: 1.0\n"
104+"Content-Type: text/plain; charset=UTF-8\n"
105+"Content-Transfer-Encoding: 8bit\n"
106+"Plural-Forms: \n"
107+"X-Generator: Poedit 1.5.4\n"
108+
109+#. module: journal_items_configure_wizard
110+#: model:ir.model,name:journal_items_configure_wizard.model_wizard_move_line
111+msgid "wizard.move.line"
112+msgstr "wizard.move.line"
113+
114+#. module: journal_items_configure_wizard
115+#: view:wizard.move.line:0
116+msgid "Fix Journal Items With Negative Values"
117+msgstr "Reaparar Apuntes Contables con Valores Negativos"
118+
119+#. module: journal_items_configure_wizard
120+#: view:wizard.move.line:0
121+msgid "Press button for fix Journal Items with negative values."
122+msgstr "Presiona el Botón para Reparar Apuntes Contables con Valores Negativos"
123+
124+#. module: journal_items_configure_wizard
125+#: view:wizard.move.line:0
126+msgid "Cancel"
127+msgstr "Cancelar"
128+
129+#. module: journal_items_configure_wizard
130+#: view:wizard.move.line:0
131+msgid "Apply"
132+msgstr "Aplicar"
133+
134+#. module: journal_items_configure_wizard
135+#: view:wizard.move.line:0
136+msgid "or"
137+msgstr "o"
138+
139+#. module: journal_items_configure_wizard
140+#: model:ir.actions.act_window,name:journal_items_configure_wizard.action_wizard_configure_move_line
141+#: model:ir.ui.menu,name:journal_items_configure_wizard.menu_action_configure_move_line_wizard
142+msgid "Configure Journal Items"
143+msgstr "Configurar Apuntes Contables"
144
145=== added file 'journal_items_configure_wizard/i18n/es_MX.po'
146=== added directory 'journal_items_configure_wizard/wizard'
147=== added file 'journal_items_configure_wizard/wizard/__init__.py'
148--- journal_items_configure_wizard/wizard/__init__.py 1970-01-01 00:00:00 +0000
149+++ journal_items_configure_wizard/wizard/__init__.py 2013-09-03 23:31:15 +0000
150@@ -0,0 +1,26 @@
151+# -*- encoding: utf-8 -*-
152+###########################################################################
153+# Module Writen to OpenERP, Open Source Management Solution
154+#
155+# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
156+# All Rights Reserved.
157+# info Vauxoo (info@vauxoo.com)
158+############################################################################
159+# Coded by: Luis Ernesto García Medina (ernesto_gm@vauxoo.com)
160+############################################################################
161+#
162+# This program is free software: you can redistribute it and/or modify
163+# it under the terms of the GNU Affero General Public License as
164+# published by the Free Software Foundation, either version 3 of the
165+# License, or (at your option) any later version.
166+#
167+# This program is distributed in the hope that it will be useful,
168+# but WITHOUT ANY WARRANTY; without even the implied warranty of
169+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
170+# GNU Affero General Public License for more details.
171+#
172+# You should have received a copy of the GNU Affero General Public License
173+# along with this program. If not, see <http://www.gnu.org/licenses/>.
174+#
175+##############################################################################
176+import move_lines
177
178=== added file 'journal_items_configure_wizard/wizard/move_lines.py'
179--- journal_items_configure_wizard/wizard/move_lines.py 1970-01-01 00:00:00 +0000
180+++ journal_items_configure_wizard/wizard/move_lines.py 2013-09-03 23:31:15 +0000
181@@ -0,0 +1,45 @@
182+# -*- encoding: utf-8 -*-
183+###########################################################################
184+# Module Writen to OpenERP, Open Source Management Solution
185+#
186+# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
187+# All Rights Reserved.
188+# info Vauxoo (info@vauxoo.com)
189+############################################################################
190+# Coded by: Luis Ernesto García Medina (ernesto_gm@vauxoo.com)
191+############################################################################
192+#
193+# This program is free software: you can redistribute it and/or modify
194+# it under the terms of the GNU Affero General Public License as
195+# published by the Free Software Foundation, either version 3 of the
196+# License, or (at your option) any later version.
197+#
198+# This program is distributed in the hope that it will be useful,
199+# but WITHOUT ANY WARRANTY; without even the implied warranty of
200+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
201+# GNU Affero General Public License for more details.
202+#
203+# You should have received a copy of the GNU Affero General Public License
204+# along with this program. If not, see <http://www.gnu.org/licenses/>.
205+#
206+##############################################################################
207+from openerp.osv import fields, osv
208+from openerp.tools.translate import _
209+
210+class wizard_move_line(osv.osv_memory):
211+ _name = 'wizard.move.line'
212+
213+ def conf_moves_line(self, cr, uid, ids, context=None):
214+ move_line_obj = self.pool.get('account.move.line')
215+ move_line_ids = move_line_obj.search(cr, uid, [('name', 'like', 'THIS ACCOUNT HAD NEGATIVE VALUES%')])
216+ move_ids = []
217+ for line in move_line_obj.browse(cr, uid, move_line_ids):
218+ if line.move_id.period_id.state == 'draft':
219+ move_line_obj.write(cr, uid, [line.id], {'debit' : line.credit, 'credit' : line.debit})
220+ if line.move_id.id not in move_ids:
221+ move_ids.append(line.move_id.id)
222+ self.pool.get('account.move').validate(cr, uid, move_ids, context=context)
223+ for line in move_line_obj.browse(cr, uid, move_line_ids):
224+ if line.state == 'valid':
225+ move_line_obj.write(cr, uid, [line.id], {'name' : line.name.replace('THIS ACCOUNT HAD NEGATIVE VALUES', 'FIX THIS ACCOUNT')})
226+ return True
227
228=== added file 'journal_items_configure_wizard/wizard/move_lines_wiz_view.xml'
229--- journal_items_configure_wizard/wizard/move_lines_wiz_view.xml 1970-01-01 00:00:00 +0000
230+++ journal_items_configure_wizard/wizard/move_lines_wiz_view.xml 2013-09-03 23:31:15 +0000
231@@ -0,0 +1,34 @@
232+<openerp>
233+ <data>
234+ <record model="ir.ui.view" id="view_wizard_configure_move_line">
235+ <field name="name">view.wizard.configure.move.line</field>
236+ <field name="model">wizard.move.line</field>
237+ <field name="arch" type="xml">
238+ <form string="Fix Journal Items With Negative Values" version="7.0">
239+ <footer>
240+ <button name="conf_moves_line" type="object" string="Apply" class="oe_highlight"/>
241+ or
242+ <button type="object" special="cancel" string="Cancel" class="oe_link"/>
243+ </footer>
244+ <separator colspan="4"/>
245+ <p class="oe_grey">
246+ Press button for fix Journal Items with negative values.
247+ </p>
248+ </form>
249+ </field>
250+ </record>
251+
252+ <record id="action_wizard_configure_move_line" model="ir.actions.act_window">
253+ <field name="name">Configure Journal Items</field>
254+ <field name="type">ir.actions.act_window</field>
255+ <field name="res_model">wizard.move.line</field>
256+ <field name="view_type">form</field>
257+ <field name="view_mode">form</field>
258+ <field name="view_id" ref="view_wizard_configure_move_line"/>
259+ <field name="target">new</field>
260+ </record>
261+ <menuitem action="action_wizard_configure_move_line" id="menu_action_configure_move_line_wizard" parent="account.menu_finance_configuration" sequence="120"/>
262+
263+
264+ </data>
265+</openerp>