Merge lp:~vauxoo/openerp-mexico-localization/account_tax_category_2parte_dev_juan_carlos into lp:openerp-mexico-localization

Proposed by Isaac López Zúñiga
Status: Rejected
Rejected by: Moisés López - http://www.vauxoo.com
Proposed branch: lp:~vauxoo/openerp-mexico-localization/account_tax_category_2parte_dev_juan_carlos
Merge into: lp:openerp-mexico-localization
Diff against target: 462 lines (+373/-11)
12 files modified
account_invoice_tax/__init__.py (+1/-0)
account_invoice_tax/__openerp__.py (+43/-0)
account_invoice_tax/account_invoice_tax.py (+35/-0)
account_invoice_tax/patch/account_invoice.patch (+11/-0)
account_tax_category/__init__.py (+24/-0)
account_tax_category/__openerp__.py (+47/-0)
account_tax_category/account_tax_category.py (+52/-0)
account_tax_category/account_tax_category_view.xml (+77/-0)
account_tax_category/data/account_tax_category.xml (+57/-0)
account_tax_category/security/account_tax_category_security.xml (+14/-0)
account_tax_category/security/ir.model.access.csv (+3/-0)
l10n_mx_invoice_tax_ref/invoice.py (+9/-11)
To merge this branch: bzr merge lp:~vauxoo/openerp-mexico-localization/account_tax_category_2parte_dev_juan_carlos
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Disapprove
Juan Carlos Hernandez (community) Needs Resubmitting
Isaac López Zúñiga Needs Fixing
Review via email: mp+118186@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Isaac López Zúñiga (isaako34) wrote :

Carlos,

Ahora el módulo l10n_mx_invoice_tax_ref debe depender de:
account_invoice_tax y account_invoice_tax, sin embargo:

En esta propuesta de merge solo se deben proponer los cambios en el módulo: l10n_mx_invoice_tax_ref

Ya tienes una propuesta previa en donde se agrega el módulo: account_tax_category, por lo que en esta propuesta dicho módulo no debe aparecer para ser agregado a l10n_mx.

Para agregar el módulo: account_invoice_tax a la l10n_mx se debe hacer otra propuesta de merge, por lo tanto no debe aparecer en esta propuesta de merge.

Saludos.

review: Needs Fixing
Revision history for this message
Juan Carlos Hernandez (openerp1) wrote :
review: Needs Resubmitting
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

mp applied in other mp

review: Disapprove

Unmerged revisions

188. By Juan Carlos Hernandez

[IMP][l10n_mx_invoice_tax_ref] quit print y correct percent

187. By Juan Carlos Hernandez

[IMP][l10n_mx_invoice_tax_ref]quit print

186. By Juan Carlos Hernandez

[IMP][l10n_mx_invoice_tax_ref] change name of percent

185. By Juan Carlos Hernandez

[IMP][l10n_mx_invoice_tax_ref] quit line comment

184. By Juan Carlos Hernandez

[IMP][l10n_mx_invoice_tax_ref] quit line

183. By Juan Carlos Hernandez

[IMP][l10n_mx_invoice_tax_ref] quit print

182. By Juan Carlos Hernandez

[IMP][l10n_mx_invoice_tax_ref] change code and porcentaje

181. By Juan Carlos Hernandez

[IMP][l10n_mx_invoice_tax_ref] change code value

180. By Juan Carlos Hernandez

[ADD][modules account_inovice_tax and account_tax_cayegory]add module

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_invoice_tax'
2=== added file 'account_invoice_tax/__init__.py'
3--- account_invoice_tax/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_invoice_tax/__init__.py 2012-08-03 19:40:37 +0000
5@@ -0,0 +1,1 @@
6+import account_invoice_tax
7
8=== added file 'account_invoice_tax/__openerp__.py'
9--- account_invoice_tax/__openerp__.py 1970-01-01 00:00:00 +0000
10+++ account_invoice_tax/__openerp__.py 2012-08-03 19:40:37 +0000
11@@ -0,0 +1,43 @@
12+# -*- encoding: utf-8 -*-
13+###########################################################################
14+# Module Writen to OpenERP, Open Source Management Solution
15+#
16+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com/
17+# All Rights Reserved.
18+# info Vauxoo (info@vauxoo.com)
19+############################################################################
20+# Coded by: el_rodo_1 (rodo@vauxoo.com)
21+############################################################################
22+#
23+# This program is free software: you can redistribute it and/or modify
24+# it under the terms of the GNU Affero General Public License as
25+# published by the Free Software Foundation, either version 3 of the
26+# License, or (at your option) any later version.
27+#
28+# This program is distributed in the hope that it will be useful,
29+# but WITHOUT ANY WARRANTY; without even the implied warranty of
30+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31+# GNU Affero General Public License for more details.
32+#
33+# You should have received a copy of the GNU Affero General Public License
34+# along with this program. If not, see <http://www.gnu.org/licenses/>.
35+#
36+##############################################################################
37+
38+{
39+ "name" : "account_invoice_tax",
40+ "version" : "1.0",
41+ "author" : "Vauxoo",
42+ "category" : "Localization/Mexico",
43+ "description" : """This module add relation tax in account_invoice_tax
44+ -You will need to apply the patch patch/account_invoice.patch,
45+ that is located in this module ( use:patch -b file.py file.patch )""",
46+ "website" : "http://www.vauxoo.com/",
47+ "license" : "AGPL-3",
48+ "depends" : ["account"],
49+ "init_xml" : [],
50+ "demo_xml" : [],
51+ "update_xml" : [],
52+ "installable" : True,
53+ "active" : False,
54+}
55
56=== added file 'account_invoice_tax/account_invoice_tax.py'
57--- account_invoice_tax/account_invoice_tax.py 1970-01-01 00:00:00 +0000
58+++ account_invoice_tax/account_invoice_tax.py 2012-08-03 19:40:37 +0000
59@@ -0,0 +1,35 @@
60+# -*- encoding: utf-8 -*-
61+###########################################################################
62+# Module Writen to OpenERP, Open Source Management Solution
63+#
64+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
65+# All Rights Reserved.
66+# info@vauxoo.com
67+############################################################################
68+# Coded by: El Rodo (rodo@vauxoo.com)
69+############################################################################
70+#
71+# This program is free software: you can redistribute it and/or modify
72+# it under the terms of the GNU Affero General Public License as
73+# published by the Free Software Foundation, either version 3 of the
74+# License, or (at your option) any later version.
75+#
76+# This program is distributed in the hope that it will be useful,
77+# but WITHOUT ANY WARRANTY; without even the implied warranty of
78+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
79+# GNU Affero General Public License for more details.
80+#
81+# You should have received a copy of the GNU Affero General Public License
82+# along with this program. If not, see <http://www.gnu.org/licenses/>.
83+#
84+##############################################################################
85+
86+from osv import fields, osv
87+
88+class account_invoice_tax(osv.osv):
89+ _inherit = 'account.invoice.tax'
90+ _columns = {
91+ 'tax_id': fields.many2one('account.tax', 'Tax', help="Tax"),
92+ }
93+
94+account_invoice_tax()
95\ No newline at end of file
96
97=== added directory 'account_invoice_tax/patch'
98=== added file 'account_invoice_tax/patch/account_invoice.patch'
99--- account_invoice_tax/patch/account_invoice.patch 1970-01-01 00:00:00 +0000
100+++ account_invoice_tax/patch/account_invoice.patch 2012-08-03 19:40:37 +0000
101@@ -0,0 +1,11 @@
102+--- account/account_invoice.py 2012-03-29 15:43:31 +0000
103++++ account/account_invoice.py 2012-06-26 16:09:15 +0000
104+@@ -1585,6 +1585,7 @@
105+ val['manual'] = False
106+ val['sequence'] = tax['sequence']
107+ val['base'] = tax['price_unit'] * line['quantity']
108++ val['tax_id']=tax['id']
109+
110+ if inv.type in ('out_invoice','in_invoice'):
111+ val['base_code_id'] = tax['base_code_id']
112+
113
114=== added directory 'account_tax_category'
115=== added file 'account_tax_category/__init__.py'
116--- account_tax_category/__init__.py 1970-01-01 00:00:00 +0000
117+++ account_tax_category/__init__.py 2012-08-03 19:40:37 +0000
118@@ -0,0 +1,24 @@
119+#!/usr/bin/python
120+# -*- encoding: utf-8 -*-
121+###########################################################################
122+# Module Writen to OpenERP, Open Source Management Solution
123+# Copyright (C) Vauxoo (<http://vauxoo.com>).
124+# All Rights Reserved
125+###############Credits######################################################
126+# Coded by: carlos(juan@vauxoo.com)
127+#############################################################################
128+# This program is free software: you can redistribute it and/or modify
129+# it under the terms of the GNU Affero General Public License as published by
130+# the Free Software Foundation, either version 3 of the License, or
131+# (at your option) any later version.
132+#
133+# This program is distributed in the hope that it will be useful,
134+# but WITHOUT ANY WARRANTY; without even the implied warranty of
135+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
136+# GNU Affero General Public License for more details.
137+#
138+# You should have received a copy of the GNU Affero General Public License
139+# along with this program. If not, see <http://www.gnu.org/licenses/>.
140+################################################################################
141+
142+import account_tax_category
143
144=== added file 'account_tax_category/__openerp__.py'
145--- account_tax_category/__openerp__.py 1970-01-01 00:00:00 +0000
146+++ account_tax_category/__openerp__.py 2012-08-03 19:40:37 +0000
147@@ -0,0 +1,47 @@
148+#!/usr/bin/python
149+# -*- encoding: utf-8 -*-
150+###########################################################################
151+# Module Writen to OpenERP, Open Source Management Solution
152+# Copyright (C) Vauxoo (<http://vauxoo.com>).
153+# All Rights Reserved
154+###############Credits######################################################
155+# Coded by: carlos(juan@vauxoo.com)
156+#############################################################################
157+# This program is free software: you can redistribute it and/or modify
158+# it under the terms of the GNU Affero General Public License as published by
159+# the Free Software Foundation, either version 3 of the License, or
160+# (at your option) any later version.
161+#
162+# This program is distributed in the hope that it will be useful,
163+# but WITHOUT ANY WARRANTY; without even the implied warranty of
164+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
165+# GNU Affero General Public License for more details.
166+#
167+# You should have received a copy of the GNU Affero General Public License
168+# along with this program. If not, see <http://www.gnu.org/licenses/>.
169+################################################################################
170+{
171+ "name" : "Add category to taxes",
172+ "version" : "1.0",
173+ "depends" : ["account"],
174+ "author" : "Vauxoo",
175+ "license" : "AGPL-3",
176+ "description" : """This module add to the taxes category
177+ """,
178+ "website" : "http://vauxoo.com",
179+ "category" : "Generic Modules",
180+ "init_xml" : [],
181+ "demo_xml" : [],
182+ "test": [],
183+ "update_xml" : [
184+ 'security/account_tax_category_security.xml',
185+ 'security/ir.model.access.csv',
186+ 'account_tax_category_view.xml',
187+ 'data/account_tax_category.xml'
188+
189+
190+ ],
191+ "active": False,
192+ "installable": True,
193+}
194+
195
196=== added file 'account_tax_category/account_tax_category.py'
197--- account_tax_category/account_tax_category.py 1970-01-01 00:00:00 +0000
198+++ account_tax_category/account_tax_category.py 2012-08-03 19:40:37 +0000
199@@ -0,0 +1,52 @@
200+#!/usr/bin/python
201+# -*- encoding: utf-8 -*-
202+###########################################################################
203+# Module Writen to OpenERP, Open Source Management Solution
204+# Copyright (C) Vauxoo (<http://vauxoo.com>).
205+# All Rights Reserved
206+###############Credits######################################################
207+# Coded by: Carlos Funes(juan@vauxoo.com)
208+#############################################################################
209+# This program is free software: you can redistribute it and/or modify
210+# it under the terms of the GNU Affero General Public License as published by
211+# the Free Software Foundation, either version 3 of the License, or
212+# (at your option) any later version.
213+#
214+# This program is distributed in the hope that it will be useful,
215+# but WITHOUT ANY WARRANTY; without even the implied warranty of
216+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
217+# GNU Affero General Public License for more details.
218+#
219+# You should have received a copy of the GNU Affero General Public License
220+# along with this program. If not, see <http://www.gnu.org/licenses/>.
221+################################################################################
222+from osv import fields, osv, orm
223+
224+class account_tax_category(osv.osv):
225+ _name='account.tax.category'
226+
227+ _columns = {
228+ 'company_id': fields.many2one('res.company', 'Company', required=True),
229+ 'name': fields.char('Name', size=64, required=True),
230+ 'code': fields.char('Code', size=32, required=True),
231+ 'active': fields.boolean('Active'),
232+ 'sign': fields.integer('Sign'),
233+ 'category_ids': fields.one2many('account.tax', 'tax_category_id', 'Category'),
234+
235+ }
236+
237+ _defaults = {
238+ 'active': 1,
239+ 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.tax.category', context=c),
240+ }
241+
242+account_tax_category()
243+
244+class account_tax(osv.osv):
245+ _inherit = 'account.tax'
246+
247+ _columns = {
248+ 'tax_category_id': fields.many2one('account.tax.category','Tax Category',required=False),
249+ }
250+
251+account_tax()
252
253=== added file 'account_tax_category/account_tax_category_view.xml'
254--- account_tax_category/account_tax_category_view.xml 1970-01-01 00:00:00 +0000
255+++ account_tax_category/account_tax_category_view.xml 2012-08-03 19:40:37 +0000
256@@ -0,0 +1,77 @@
257+<?xml version="1.0" encoding="utf-8"?>
258+<openerp>
259+ <data>
260+ <record id="view_account_tax_category_form" model="ir.ui.view">
261+ <field name="name">view.account.tax.category.form</field>
262+ <field name="model">account.tax.category</field>
263+ <field name="type">form</field>
264+ <field name="arch" type="xml">
265+ <form string="Categories">
266+ <separator string="Categories" colspan="4"/>
267+ <field name="name" colspan="2"/>
268+ <field name="code" colspan="2"/>
269+ <newline/>
270+ <field name="active" colspan="2"/>
271+ <field name="sign" colspan="2"/>
272+ <newline/>
273+ <field name="company_id" widget="selection"/>
274+ </form>
275+ </field>
276+ </record>
277+
278+
279+ <record id="view_account_tax_category_tree" model="ir.ui.view">
280+ <field name="name">view.account.tax.category.tree</field>
281+ <field name="model">account.tax.category</field>
282+ <field name="type">tree</field>
283+ <field name="arch" type="xml">
284+ <tree string="Categories">
285+ <field name="name" />
286+ <field name="code" />
287+ <field name="active"/>
288+ <field name="sign" />
289+ </tree>
290+ </field>
291+ </record>
292+
293+ <record id="action_account_tax_category_tree" model="ir.actions.act_window">
294+ <field name="name">Tax Category</field>
295+ <field name="res_model">account.tax.category</field>
296+ <field name="type">ir.actions.act_window</field>
297+ <field name="view_type">form</field>
298+ <field name="view_id" ref="view_account_tax_category_tree"/>
299+ </record>
300+
301+ <menuitem action="action_account_tax_category_tree"
302+ id="menu_account_tax_category" sequence="50"
303+ parent="account.next_id_27"
304+ />
305+
306+ <record id="view_account_tax_category_search" model="ir.ui.view">
307+ <field name="name">view.account.tax.category.search</field>
308+ <field name="model">account.tax.category</field>
309+ <field name="type">search</field>
310+ <field name="arch" type="xml">
311+ <search string="Categories">
312+ <filter string="Inactive" icon="terp-personal+" domain="[('active','=',False)]"/>
313+ <field name="name"/>
314+ <field name="code"/>
315+ </search>
316+ </field>
317+ </record>
318+
319+
320+ <record model="ir.ui.view" id="view_account_tax_category_form_inh">
321+ <field name="name">view.account.tax.category.form.inh</field>
322+ <field name="inherit_id" ref="account.view_tax_form"/>
323+ <field name="model">account.tax</field>
324+ <field name="type">form</field>
325+ <field name="arch" type="xml">
326+ <xpath expr='/form[@string="Account Tax"]/group/field[@name="company_id"]' position="after">
327+ <field name='tax_category_id' widget="selection"/>
328+ </xpath>
329+ </field>
330+ </record>
331+
332+ </data>
333+</openerp>
334
335=== added directory 'account_tax_category/data'
336=== added file 'account_tax_category/data/account_tax_category.xml'
337--- account_tax_category/data/account_tax_category.xml 1970-01-01 00:00:00 +0000
338+++ account_tax_category/data/account_tax_category.xml 2012-08-03 19:40:37 +0000
339@@ -0,0 +1,57 @@
340+<?xml version="1.0" ?>
341+<openerp>
342+ <data noupdate="1">
343+ <record id="tax_category_iva_ret" model="account.tax.category">
344+ <field name="name">IVA-RET</field>
345+ <field name="code">IVA</field>
346+ <field name="active">1</field>
347+ <field name="sign">-1</field>
348+ </record>
349+ </data>
350+
351+ <data>
352+ <record id="tax_category_iva" model="account.tax.category">
353+ <field name="name">IVA</field>
354+ <field name="code">IVA</field>
355+ <field name="active">1</field>
356+ <field name="sign">1</field>
357+ </record>
358+ </data>
359+
360+ <data>
361+ <record id="tax_category_isr" model="account.tax.category">
362+ <field name="name">ISR</field>
363+ <field name="code">ISR</field>
364+ <field name="active">1</field>
365+ <field name="sign">1</field>
366+ </record>
367+ </data>
368+
369+ <data>
370+ <record id="tax_category_isr_ret" model="account.tax.category">
371+ <field name="name">ISR-RET</field>
372+ <field name="code">ISR</field>
373+ <field name="active">1</field>
374+ <field name="sign">-1</field>
375+ </record>
376+ </data>
377+
378+ <data>
379+ <record id="tax_category_ieps" model="account.tax.category">
380+ <field name="name">IEPS</field>
381+ <field name="code">IEPS</field>
382+ <field name="active">1</field>
383+ <field name="sign">1</field>
384+ </record>
385+ </data>
386+
387+ <data>
388+ <record id="tax_category_ietu" model="account.tax.category">
389+ <field name="name">IETU</field>
390+ <field name="code">IETU</field>
391+ <field name="active">1</field>
392+ <field name="sign">1</field>
393+ </record>
394+ </data>
395+
396+</openerp>
397
398=== added directory 'account_tax_category/security'
399=== added file 'account_tax_category/security/account_tax_category_security.xml'
400--- account_tax_category/security/account_tax_category_security.xml 1970-01-01 00:00:00 +0000
401+++ account_tax_category/security/account_tax_category_security.xml 2012-08-03 19:40:37 +0000
402@@ -0,0 +1,14 @@
403+<?xml version="1.0" encoding="utf-8"?>
404+<openerp>
405+ <data>
406+
407+ <record model="res.groups" id="group_account_tax_category_manager">
408+ <field name="name">Account Tax Category / Manager</field>
409+ </record>
410+
411+ <record model="res.groups" id="group_account_tax_category_user">
412+ <field name="name">Account Tax Category / User</field>
413+ </record>
414+
415+ </data>
416+</openerp>
417
418=== added file 'account_tax_category/security/ir.model.access.csv'
419--- account_tax_category/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
420+++ account_tax_category/security/ir.model.access.csv 2012-08-03 19:40:37 +0000
421@@ -0,0 +1,3 @@
422+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
423+access_account_tax_category_manager,account.tax.category.manager,model_account_tax_category,,1,1,1,1
424+access_account_tax_category_user,account.tax.category.user,model_account_tax_category,,1,0,0,0
425
426=== modified file 'l10n_mx_invoice_tax_ref/invoice.py'
427--- l10n_mx_invoice_tax_ref/invoice.py 2012-07-05 16:51:07 +0000
428+++ l10n_mx_invoice_tax_ref/invoice.py 2012-08-03 19:40:37 +0000
429@@ -35,24 +35,22 @@
430
431 class account_invoice_tax(osv.osv):
432 _inherit= "account.invoice.tax"
433-
434+
435 def _get_tax_data(self, cr, uid, ids, field_names=None, arg=False, context={}):
436 if not context:
437 context = {}
438 res = {}
439 for invoice_tax in self.browse(cr, uid, ids, context=context):
440 res[invoice_tax.id] = {}
441- tax_name = invoice_tax.name.lower().replace('.','').replace(' ', '').replace('-', '')
442- tax_percent = invoice_tax.amount and invoice_tax.base and invoice_tax.amount*100.0 / abs( invoice_tax.base ) or 0.0
443- if 'iva' in tax_name:
444- tax_name = 'IVA'
445+ code = invoice_tax.tax_id.tax_category_id.code.replace('.','').replace(' ', '').replace('-', '')
446+ type_tax = invoice_tax.tax_id.type
447+ if type_tax=='percent':
448+ tax_percent = invoice_tax.tax_id.amount
449 if tax_percent > 0:
450- tax_percent = round(tax_percent, 0)#Hay problemas de decimales al calcular el iva, y hasta ahora el iva no tiene decimales
451- elif 'isr' in tax_name:
452- tax_name = 'ISR'
453- elif 'ieps' in tax_name:
454- tax_name = 'IEPS'
455- res[invoice_tax.id]['name2'] = tax_name
456+ tax_percent = tax_percent
457+ else:
458+ break
459+ res[invoice_tax.id]['name2'] = code
460 res[invoice_tax.id]['tax_percent'] = tax_percent
461 #res[invoice_tax.id]['amount'] = invoice_tax.amount
462 return res