Merge lp:~vauxoo/addons-vauxoo/truiz-addons-vauxoo into lp:addons-vauxoo

Proposed by Tulio Ruiz (Vauxoo)
Status: Needs review
Proposed branch: lp:~vauxoo/addons-vauxoo/truiz-addons-vauxoo
Merge into: lp:addons-vauxoo
Diff against target: 229 lines (+191/-0)
7 files modified
split_invoice_button/__init__.py (+25/-0)
split_invoice_button/__openerp__.py (+48/-0)
split_invoice_button/i18n/es_VE.po (+23/-0)
split_invoice_button/invoice.py (+61/-0)
split_invoice_button/security/ir.model.access.csv (+4/-0)
split_invoice_button/security/split_invoice_security.xml (+8/-0)
split_invoice_button/view/invoice_view.xml (+22/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/truiz-addons-vauxoo
Reviewer Review Type Date Requested Status
Nhomar - Vauxoo already done in other mp Disapprove
Gabriela Quilarque Pending
Review via email: mp+94809@code.launchpad.net

Description of the change

Botón que permite buscar todas las facturas asociadas a un conjunto de facturas generadas a partir de una orden de compra con más líneas de las que se indican en la configuración

To post a comment you must log in.
128. By Tulio Ruiz (Vauxoo)

[FIX] Arreglada la descripción del componente

Revision history for this message
Nhomar - Vauxoo (nhomar) :
review: Disapprove (already done in other mp)

Unmerged revisions

128. By Tulio Ruiz (Vauxoo)

[FIX] Arreglada la descripción del componente

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'split_invoice_button'
2=== added file 'split_invoice_button/__init__.py'
3--- split_invoice_button/__init__.py 1970-01-01 00:00:00 +0000
4+++ split_invoice_button/__init__.py 2012-02-27 19:55:21 +0000
5@@ -0,0 +1,25 @@
6+ # -*- encoding: utf-8 -*-
7+###########################################################################
8+# Module Writen to OpenERP, Open Source Management Solution
9+# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
10+# All Rights Reserved
11+###############Credits######################################################
12+# Coded by: nhomar@openerp.com.ve
13+# Planified by: Nhomar Hernandez
14+# Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
15+# Audited by: Humberto Arocha humberto@openerp.com.ve
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 published by
19+# the Free Software Foundation, either version 3 of the License, or
20+# (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+import invoice
31
32=== added file 'split_invoice_button/__openerp__.py'
33--- split_invoice_button/__openerp__.py 1970-01-01 00:00:00 +0000
34+++ split_invoice_button/__openerp__.py 2012-02-27 19:55:21 +0000
35@@ -0,0 +1,48 @@
36+# -*- encoding: utf-8 -*-
37+###########################################################################
38+# Module Writen to OpenERP, Open Source Management Solution
39+# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
40+# All Rights Reserved
41+###############Credits######################################################
42+# Coded by: nhomar@openerp.com.ve,
43+# Planified by: Nhomar Hernandez
44+# Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
45+# Audited by: Humberto Arocha humberto@openerp.com.ve
46+#############################################################################
47+# This program is free software: you can redistribute it and/or modify
48+# it under the terms of the GNU Affero General Public License as published by
49+# the Free Software Foundation, either version 3 of the License, or
50+# (at your option) any later version.
51+#
52+# This program is distributed in the hope that it will be useful,
53+# but WITHOUT ANY WARRANTY; without even the implied warranty of
54+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55+# GNU Affero General Public License for more details.
56+#
57+# You should have received a copy of the GNU Affero General Public License
58+# along with this program. If not, see <http://www.gnu.org/licenses/>.
59+##############################################################################
60+
61+{
62+ "name" : "Split Invoice Button",
63+ "version" : "0.1",
64+ "depends" : ["l10n_ve_split_invoice"],
65+ "author" : "Vauxoo",
66+ "description" : """
67+For legal reasons in Venezuela we need just ONE invoice per page,
68+so this button allows the user view all generated invoices with the l10n_ve_split_invoice module
69+ """ ,
70+ "website" : "http://vauxoo.com",
71+ "category" : "Localization",
72+ "init_xml" : [
73+ ],
74+ "demo_xml" : [
75+ ],
76+ "update_xml" : [
77+ "view/invoice_view.xml",
78+ "security/split_invoice_security.xml",
79+ "security/ir.model.access.csv",
80+ ],
81+ "active": False,
82+ "installable": True,
83+}
84
85=== added directory 'split_invoice_button/i18n'
86=== added file 'split_invoice_button/i18n/es_VE.po'
87--- split_invoice_button/i18n/es_VE.po 1970-01-01 00:00:00 +0000
88+++ split_invoice_button/i18n/es_VE.po 2012-02-27 19:55:21 +0000
89@@ -0,0 +1,23 @@
90+# Translation of OpenERP Server.
91+# This file contains the translation of the following modules:
92+# * l10n_ve_split_invoice
93+#
94+msgid ""
95+msgstr ""
96+"Project-Id-Version: OpenERP Server 6.0.3\n"
97+"Report-Msgid-Bugs-To: support@openerp.com\n"
98+"POT-Creation-Date: 2012-02-27 15:15+0000\n"
99+"PO-Revision-Date: 2012-02-27 15:15+0000\n"
100+"Last-Translator: <tulio@vauxoo.com>\n"
101+"Language-Team: Vauxoo\n"
102+"MIME-Version: 1.0\n"
103+"Content-Type: text/plain; charset=UTF-8\n"
104+"Content-Transfer-Encoding: \n"
105+"Plural-Forms: \n"
106+
107+
108+#. module: l10n_ve_split_invoice
109+#: view:account.invoice:0
110+msgid "Search asociated"
111+msgstr "Buscar asociadas"
112+
113
114=== added file 'split_invoice_button/invoice.py'
115--- split_invoice_button/invoice.py 1970-01-01 00:00:00 +0000
116+++ split_invoice_button/invoice.py 2012-02-27 19:55:21 +0000
117@@ -0,0 +1,61 @@
118+# -*- encoding: utf-8 -*-
119+###########################################################################
120+# Module Writen to OpenERP, Open Source Management Solution
121+# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
122+# All Rights Reserved
123+###############Credits######################################################
124+# Coded by: nhomar@openerp.com.ve,
125+# Planified by: Nhomar Hernandez
126+# Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
127+# Audited by: Humberto Arocha humberto@openerp.com.ve
128+#############################################################################
129+# This program is free software: you can redistribute it and/or modify
130+# it under the terms of the GNU Affero General Public License as published by
131+# the Free Software Foundation, either version 3 of the License, or
132+# (at your option) any later version.
133+#
134+# This program is distributed in the hope that it will be useful,
135+# but WITHOUT ANY WARRANTY; without even the implied warranty of
136+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
137+# GNU Affero General Public License for more details.
138+#
139+# You should have received a copy of the GNU Affero General Public License
140+# along with this program. If not, see <http://www.gnu.org/licenses/>.
141+##############################################################################
142+from osv import osv
143+from osv import fields
144+from tools.translate import _
145+import netsvc
146+
147+class account_invoice(osv.osv):
148+ _inherit = 'account.invoice'
149+
150+ def search_asociated_invoice(self, cr, uid, ids, context=None):
151+ if context is None:
152+ context = {}
153+ data_pool = self.pool.get('ir.model.data')
154+ inv_type = self.read(cr, uid, ids[0], ['type', 'name'])
155+ name = inv_type['name']
156+ inv_type = inv_type['type']
157+ invoice_ids = self.search(cr, uid, [('name', '=', name)])
158+ # inv_type = context.get('inv_type', False)
159+ action_model = False
160+ action = {}
161+ if not invoice_ids:
162+ raise osv.except_osv(_('Error'), _('No Invoices were created'))
163+ if inv_type == "out_invoice":
164+ action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree1")
165+ elif inv_type == "in_invoice":
166+ action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree2")
167+ elif inv_type == "out_refund":
168+ action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree3")
169+ elif inv_type == "in_refund":
170+ action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree4")
171+ if action_model:
172+ action_pool = self.pool.get(action_model)
173+ action = action_pool.read(cr, uid, action_id, context=context)
174+ action['domain'] = "[('id','in', ["+','.join(map(str,invoice_ids))+"])]"
175+ action.update({'nodestroy': True})
176+ return action
177+
178+account_invoice()
179
180=== added directory 'split_invoice_button/security'
181=== added file 'split_invoice_button/security/ir.model.access.csv'
182--- split_invoice_button/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
183+++ split_invoice_button/security/ir.model.access.csv 2012-02-27 19:55:21 +0000
184@@ -0,0 +1,4 @@
185+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
186+"access_account_split_invoice_button_manager","account.invoice","model_account_invoice","split_invoice_button.group_account_split_invoice_button_manager",1,0,0,0
187+
188+
189
190=== added file 'split_invoice_button/security/split_invoice_security.xml'
191--- split_invoice_button/security/split_invoice_security.xml 1970-01-01 00:00:00 +0000
192+++ split_invoice_button/security/split_invoice_security.xml 2012-02-27 19:55:21 +0000
193@@ -0,0 +1,8 @@
194+<?xml version="1.0" encoding="utf-8"?>
195+<openerp>
196+ <data noupdate="1">
197+ <record id="group_account_split_invoice_button_manager" model="res.groups">
198+ <field name="name">Split Search Button / Manager</field>
199+ </record>
200+ </data>
201+</openerp>
202
203=== added directory 'split_invoice_button/view'
204=== added file 'split_invoice_button/view/invoice_view.xml'
205--- split_invoice_button/view/invoice_view.xml 1970-01-01 00:00:00 +0000
206+++ split_invoice_button/view/invoice_view.xml 2012-02-27 19:55:21 +0000
207@@ -0,0 +1,22 @@
208+<?xml version="1.0" encoding="utf-8"?>
209+<openerp>
210+ <data>
211+ <record id="search_asociated_invoices" model="ir.ui.view">
212+ <field name="name">account.invoice.search</field>
213+ <field name="model">account.invoice</field>
214+ <field name="type">form</field>
215+ <field name="inherit_id" ref="account.invoice_form"/>
216+ <field name="arch" type="xml">
217+ <xpath expr='//button[@name="invoice_cancel"]' position='after'>
218+ <button
219+ string="Search asociated"
220+ name="search_asociated_invoice"
221+ type="object"
222+ icon="gtk-new"
223+ groups="split_invoice_button.group_account_split_invoice_button_manager"/>
224+ </xpath>
225+ </field>
226+ </record>
227+ </data>
228+</openerp>
229+