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
=== added directory 'account_invoice_tax'
=== added file 'account_invoice_tax/__init__.py'
--- account_invoice_tax/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_tax/__init__.py 2012-08-03 19:40:37 +0000
@@ -0,0 +1,1 @@
1import account_invoice_tax
02
=== added file 'account_invoice_tax/__openerp__.py'
--- account_invoice_tax/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_tax/__openerp__.py 2012-08-03 19:40:37 +0000
@@ -0,0 +1,43 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8############################################################################
9# Coded by: el_rodo_1 (rodo@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26
27{
28 "name" : "account_invoice_tax",
29 "version" : "1.0",
30 "author" : "Vauxoo",
31 "category" : "Localization/Mexico",
32 "description" : """This module add relation tax in account_invoice_tax
33 -You will need to apply the patch patch/account_invoice.patch,
34 that is located in this module ( use:patch -b file.py file.patch )""",
35 "website" : "http://www.vauxoo.com/",
36 "license" : "AGPL-3",
37 "depends" : ["account"],
38 "init_xml" : [],
39 "demo_xml" : [],
40 "update_xml" : [],
41 "installable" : True,
42 "active" : False,
43}
044
=== added file 'account_invoice_tax/account_invoice_tax.py'
--- account_invoice_tax/account_invoice_tax.py 1970-01-01 00:00:00 +0000
+++ account_invoice_tax/account_invoice_tax.py 2012-08-03 19:40:37 +0000
@@ -0,0 +1,35 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
6# All Rights Reserved.
7# info@vauxoo.com
8############################################################################
9# Coded by: El Rodo (rodo@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26
27from osv import fields, osv
28
29class account_invoice_tax(osv.osv):
30 _inherit = 'account.invoice.tax'
31 _columns = {
32 'tax_id': fields.many2one('account.tax', 'Tax', help="Tax"),
33 }
34
35account_invoice_tax()
0\ No newline at end of file36\ No newline at end of file
137
=== added directory 'account_invoice_tax/patch'
=== added file 'account_invoice_tax/patch/account_invoice.patch'
--- account_invoice_tax/patch/account_invoice.patch 1970-01-01 00:00:00 +0000
+++ account_invoice_tax/patch/account_invoice.patch 2012-08-03 19:40:37 +0000
@@ -0,0 +1,11 @@
1--- account/account_invoice.py 2012-03-29 15:43:31 +0000
2+++ account/account_invoice.py 2012-06-26 16:09:15 +0000
3@@ -1585,6 +1585,7 @@
4 val['manual'] = False
5 val['sequence'] = tax['sequence']
6 val['base'] = tax['price_unit'] * line['quantity']
7+ val['tax_id']=tax['id']
8
9 if inv.type in ('out_invoice','in_invoice'):
10 val['base_code_id'] = tax['base_code_id']
11
012
=== added directory 'account_tax_category'
=== added file 'account_tax_category/__init__.py'
--- account_tax_category/__init__.py 1970-01-01 00:00:00 +0000
+++ account_tax_category/__init__.py 2012-08-03 19:40:37 +0000
@@ -0,0 +1,24 @@
1#!/usr/bin/python
2# -*- encoding: utf-8 -*-
3###########################################################################
4# Module Writen to OpenERP, Open Source Management Solution
5# Copyright (C) Vauxoo (<http://vauxoo.com>).
6# All Rights Reserved
7###############Credits######################################################
8# Coded by: carlos(juan@vauxoo.com)
9#############################################################################
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Affero General Public License for more details.
19#
20# You should have received a copy of the GNU Affero General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22################################################################################
23
24import account_tax_category
025
=== added file 'account_tax_category/__openerp__.py'
--- account_tax_category/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_tax_category/__openerp__.py 2012-08-03 19:40:37 +0000
@@ -0,0 +1,47 @@
1#!/usr/bin/python
2# -*- encoding: utf-8 -*-
3###########################################################################
4# Module Writen to OpenERP, Open Source Management Solution
5# Copyright (C) Vauxoo (<http://vauxoo.com>).
6# All Rights Reserved
7###############Credits######################################################
8# Coded by: carlos(juan@vauxoo.com)
9#############################################################################
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Affero General Public License for more details.
19#
20# You should have received a copy of the GNU Affero General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22################################################################################
23{
24 "name" : "Add category to taxes",
25 "version" : "1.0",
26 "depends" : ["account"],
27 "author" : "Vauxoo",
28 "license" : "AGPL-3",
29 "description" : """This module add to the taxes category
30 """,
31 "website" : "http://vauxoo.com",
32 "category" : "Generic Modules",
33 "init_xml" : [],
34 "demo_xml" : [],
35 "test": [],
36 "update_xml" : [
37 'security/account_tax_category_security.xml',
38 'security/ir.model.access.csv',
39 'account_tax_category_view.xml',
40 'data/account_tax_category.xml'
41
42
43 ],
44 "active": False,
45 "installable": True,
46}
47
048
=== added file 'account_tax_category/account_tax_category.py'
--- account_tax_category/account_tax_category.py 1970-01-01 00:00:00 +0000
+++ account_tax_category/account_tax_category.py 2012-08-03 19:40:37 +0000
@@ -0,0 +1,52 @@
1#!/usr/bin/python
2# -*- encoding: utf-8 -*-
3###########################################################################
4# Module Writen to OpenERP, Open Source Management Solution
5# Copyright (C) Vauxoo (<http://vauxoo.com>).
6# All Rights Reserved
7###############Credits######################################################
8# Coded by: Carlos Funes(juan@vauxoo.com)
9#############################################################################
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Affero General Public License for more details.
19#
20# You should have received a copy of the GNU Affero General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22################################################################################
23from osv import fields, osv, orm
24
25class account_tax_category(osv.osv):
26 _name='account.tax.category'
27
28 _columns = {
29 'company_id': fields.many2one('res.company', 'Company', required=True),
30 'name': fields.char('Name', size=64, required=True),
31 'code': fields.char('Code', size=32, required=True),
32 'active': fields.boolean('Active'),
33 'sign': fields.integer('Sign'),
34 'category_ids': fields.one2many('account.tax', 'tax_category_id', 'Category'),
35
36 }
37
38 _defaults = {
39 'active': 1,
40 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.tax.category', context=c),
41 }
42
43account_tax_category()
44
45class account_tax(osv.osv):
46 _inherit = 'account.tax'
47
48 _columns = {
49 'tax_category_id': fields.many2one('account.tax.category','Tax Category',required=False),
50 }
51
52account_tax()
053
=== added file 'account_tax_category/account_tax_category_view.xml'
--- account_tax_category/account_tax_category_view.xml 1970-01-01 00:00:00 +0000
+++ account_tax_category/account_tax_category_view.xml 2012-08-03 19:40:37 +0000
@@ -0,0 +1,77 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_account_tax_category_form" model="ir.ui.view">
5 <field name="name">view.account.tax.category.form</field>
6 <field name="model">account.tax.category</field>
7 <field name="type">form</field>
8 <field name="arch" type="xml">
9 <form string="Categories">
10 <separator string="Categories" colspan="4"/>
11 <field name="name" colspan="2"/>
12 <field name="code" colspan="2"/>
13 <newline/>
14 <field name="active" colspan="2"/>
15 <field name="sign" colspan="2"/>
16 <newline/>
17 <field name="company_id" widget="selection"/>
18 </form>
19 </field>
20 </record>
21
22
23 <record id="view_account_tax_category_tree" model="ir.ui.view">
24 <field name="name">view.account.tax.category.tree</field>
25 <field name="model">account.tax.category</field>
26 <field name="type">tree</field>
27 <field name="arch" type="xml">
28 <tree string="Categories">
29 <field name="name" />
30 <field name="code" />
31 <field name="active"/>
32 <field name="sign" />
33 </tree>
34 </field>
35 </record>
36
37 <record id="action_account_tax_category_tree" model="ir.actions.act_window">
38 <field name="name">Tax Category</field>
39 <field name="res_model">account.tax.category</field>
40 <field name="type">ir.actions.act_window</field>
41 <field name="view_type">form</field>
42 <field name="view_id" ref="view_account_tax_category_tree"/>
43 </record>
44
45 <menuitem action="action_account_tax_category_tree"
46 id="menu_account_tax_category" sequence="50"
47 parent="account.next_id_27"
48 />
49
50 <record id="view_account_tax_category_search" model="ir.ui.view">
51 <field name="name">view.account.tax.category.search</field>
52 <field name="model">account.tax.category</field>
53 <field name="type">search</field>
54 <field name="arch" type="xml">
55 <search string="Categories">
56 <filter string="Inactive" icon="terp-personal+" domain="[('active','=',False)]"/>
57 <field name="name"/>
58 <field name="code"/>
59 </search>
60 </field>
61 </record>
62
63
64 <record model="ir.ui.view" id="view_account_tax_category_form_inh">
65 <field name="name">view.account.tax.category.form.inh</field>
66 <field name="inherit_id" ref="account.view_tax_form"/>
67 <field name="model">account.tax</field>
68 <field name="type">form</field>
69 <field name="arch" type="xml">
70 <xpath expr='/form[@string="Account Tax"]/group/field[@name="company_id"]' position="after">
71 <field name='tax_category_id' widget="selection"/>
72 </xpath>
73 </field>
74 </record>
75
76 </data>
77</openerp>
078
=== added directory 'account_tax_category/data'
=== added file 'account_tax_category/data/account_tax_category.xml'
--- account_tax_category/data/account_tax_category.xml 1970-01-01 00:00:00 +0000
+++ account_tax_category/data/account_tax_category.xml 2012-08-03 19:40:37 +0000
@@ -0,0 +1,57 @@
1<?xml version="1.0" ?>
2<openerp>
3 <data noupdate="1">
4 <record id="tax_category_iva_ret" model="account.tax.category">
5 <field name="name">IVA-RET</field>
6 <field name="code">IVA</field>
7 <field name="active">1</field>
8 <field name="sign">-1</field>
9 </record>
10 </data>
11
12 <data>
13 <record id="tax_category_iva" model="account.tax.category">
14 <field name="name">IVA</field>
15 <field name="code">IVA</field>
16 <field name="active">1</field>
17 <field name="sign">1</field>
18 </record>
19 </data>
20
21 <data>
22 <record id="tax_category_isr" model="account.tax.category">
23 <field name="name">ISR</field>
24 <field name="code">ISR</field>
25 <field name="active">1</field>
26 <field name="sign">1</field>
27 </record>
28 </data>
29
30 <data>
31 <record id="tax_category_isr_ret" model="account.tax.category">
32 <field name="name">ISR-RET</field>
33 <field name="code">ISR</field>
34 <field name="active">1</field>
35 <field name="sign">-1</field>
36 </record>
37 </data>
38
39 <data>
40 <record id="tax_category_ieps" model="account.tax.category">
41 <field name="name">IEPS</field>
42 <field name="code">IEPS</field>
43 <field name="active">1</field>
44 <field name="sign">1</field>
45 </record>
46 </data>
47
48 <data>
49 <record id="tax_category_ietu" model="account.tax.category">
50 <field name="name">IETU</field>
51 <field name="code">IETU</field>
52 <field name="active">1</field>
53 <field name="sign">1</field>
54 </record>
55 </data>
56
57</openerp>
058
=== added directory 'account_tax_category/security'
=== added file 'account_tax_category/security/account_tax_category_security.xml'
--- account_tax_category/security/account_tax_category_security.xml 1970-01-01 00:00:00 +0000
+++ account_tax_category/security/account_tax_category_security.xml 2012-08-03 19:40:37 +0000
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record model="res.groups" id="group_account_tax_category_manager">
6 <field name="name">Account Tax Category / Manager</field>
7 </record>
8
9 <record model="res.groups" id="group_account_tax_category_user">
10 <field name="name">Account Tax Category / User</field>
11 </record>
12
13 </data>
14</openerp>
015
=== added file 'account_tax_category/security/ir.model.access.csv'
--- account_tax_category/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ account_tax_category/security/ir.model.access.csv 2012-08-03 19:40:37 +0000
@@ -0,0 +1,3 @@
1id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2access_account_tax_category_manager,account.tax.category.manager,model_account_tax_category,,1,1,1,1
3access_account_tax_category_user,account.tax.category.user,model_account_tax_category,,1,0,0,0
04
=== modified file 'l10n_mx_invoice_tax_ref/invoice.py'
--- l10n_mx_invoice_tax_ref/invoice.py 2012-07-05 16:51:07 +0000
+++ l10n_mx_invoice_tax_ref/invoice.py 2012-08-03 19:40:37 +0000
@@ -35,24 +35,22 @@
3535
36class account_invoice_tax(osv.osv):36class account_invoice_tax(osv.osv):
37 _inherit= "account.invoice.tax"37 _inherit= "account.invoice.tax"
38 38
39 def _get_tax_data(self, cr, uid, ids, field_names=None, arg=False, context={}):39 def _get_tax_data(self, cr, uid, ids, field_names=None, arg=False, context={}):
40 if not context:40 if not context:
41 context = {}41 context = {}
42 res = {}42 res = {}
43 for invoice_tax in self.browse(cr, uid, ids, context=context):43 for invoice_tax in self.browse(cr, uid, ids, context=context):
44 res[invoice_tax.id] = {}44 res[invoice_tax.id] = {}
45 tax_name = invoice_tax.name.lower().replace('.','').replace(' ', '').replace('-', '')45 code = invoice_tax.tax_id.tax_category_id.code.replace('.','').replace(' ', '').replace('-', '')
46 tax_percent = invoice_tax.amount and invoice_tax.base and invoice_tax.amount*100.0 / abs( invoice_tax.base ) or 0.046 type_tax = invoice_tax.tax_id.type
47 if 'iva' in tax_name:47 if type_tax=='percent':
48 tax_name = 'IVA'48 tax_percent = invoice_tax.tax_id.amount
49 if tax_percent > 0:49 if tax_percent > 0:
50 tax_percent = round(tax_percent, 0)#Hay problemas de decimales al calcular el iva, y hasta ahora el iva no tiene decimales50 tax_percent = tax_percent
51 elif 'isr' in tax_name:51 else:
52 tax_name = 'ISR'52 break
53 elif 'ieps' in tax_name:53 res[invoice_tax.id]['name2'] = code
54 tax_name = 'IEPS'
55 res[invoice_tax.id]['name2'] = tax_name
56 res[invoice_tax.id]['tax_percent'] = tax_percent54 res[invoice_tax.id]['tax_percent'] = tax_percent
57 #res[invoice_tax.id]['amount'] = invoice_tax.amount55 #res[invoice_tax.id]['amount'] = invoice_tax.amount
58 return res56 return res