Merge lp:~vauxoo/addons-vauxoo/8.0-tariff_import_tax-dev-ernesto into lp:~vauxoo/addons-vauxoo/8.0-tariff_import_tax-dev-yanina

Status: Merged
Merged at revision: 1163
Proposed branch: lp:~vauxoo/addons-vauxoo/8.0-tariff_import_tax-dev-ernesto
Merge into: lp:~vauxoo/addons-vauxoo/8.0-tariff_import_tax-dev-yanina
Diff against target: 220 lines (+109/-27)
6 files modified
import_tax_tariff/__openerp__.py (+2/-2)
import_tax_tariff/model/__init__.py (+1/-0)
import_tax_tariff/model/import_tax.py (+15/-19)
import_tax_tariff/model/product_template.py (+30/-0)
import_tax_tariff/view/import_tax_view.xml (+17/-6)
import_tax_tariff/view/tariff_tariff_view.xml (+44/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/8.0-tariff_import_tax-dev-ernesto
Reviewer Review Type Date Requested Status
Yanina Aular (Vauxoo) Approve
Luis Ernesto García Medina - http://www.vauxoo.com Pending
Review via email: mp+241474@code.launchpad.net
To post a comment you must log in.
1167. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF][import_tax_tariff] remove string of fields

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

[ADD][import_tax_tariff] add file product_template.py

1169. By Yanina Aular (Vauxoo)

[IMP] in view and dependence added

Revision history for this message
Yanina Aular (Vauxoo) (yanina-aular) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'import_tax_tariff/__openerp__.py'
2--- import_tax_tariff/__openerp__.py 2014-11-07 15:42:39 +0000
3+++ import_tax_tariff/__openerp__.py 2014-11-14 00:36:42 +0000
4@@ -27,7 +27,7 @@
5 "summary": "Import Tax and Tariff",
6 "depends": [
7 "account_accountant",
8- "product",],
9+ "stock"],
10 "author": "Vauxoo",
11 "description": """
12 Import Tax and Tariff
13@@ -37,7 +37,7 @@
14 "category": "Accounting",
15 "data": [
16 "view/import_tax_view.xml",
17- ],
18+ "view/tariff_tariff_view.xml"],
19 "demo": [],
20 "test": [],
21 "active": False,
22
23=== modified file 'import_tax_tariff/model/__init__.py'
24--- import_tax_tariff/model/__init__.py 2014-11-07 15:42:39 +0000
25+++ import_tax_tariff/model/__init__.py 2014-11-14 00:36:42 +0000
26@@ -22,3 +22,4 @@
27 # along with this program. If not, see <http://www.gnu.org/licenses/>.
28
29 from . import import_tax
30+from . import product_template
31
32=== modified file 'import_tax_tariff/model/import_tax.py'
33--- import_tax_tariff/model/import_tax.py 2014-11-11 14:36:06 +0000
34+++ import_tax_tariff/model/import_tax.py 2014-11-14 00:36:42 +0000
35@@ -21,8 +21,8 @@
36 # You should have received a copy of the GNU Affero General Public License
37 # along with this program. If not, see <http://www.gnu.org/licenses/>.
38
39-from openerp import models, fields, api, _
40-from openerp.exceptions import except_orm, Warning, RedirectWarning
41+from openerp import models, fields
42+
43
44 class import_tax_tariff(models.Model):
45 _name = "import.tax.tariff"
46@@ -32,29 +32,25 @@
47 tariff_ids = fields.One2many('tariff.tariff',
48 'import_tax_id',
49 string='Tariff')
50- product_id = fields.Many2one('product.category',
51- string = 'Product Category',)
52+ product_category_id = fields.Many2one('product.category',
53+ string='Product Category',)
54 description = fields.Text()
55
56+
57 class tariff_tariff(models.Model):
58 _name = "tariff.tariff"
59
60 name = fields.Char(required=True)
61 description = fields.Text()
62 code = fields.Char()
63- unit_value = fields.Float(digits=(6, 2),
64- help="Tariff per Unit of Product")
65- tax_percentage = fields.Float(digits=(6, 2),
66- help="Tax Percentage")
67- minimum = fields.Float(digits=(6, 2),
68- help="Amount Minimun")
69+ unit_value = fields.Float(digits=(6, 2), help="Tariff per Unit of Product")
70+ tax_percentage = fields.Float(digits=(6, 2), help="Tax Percentage")
71+ minimum = fields.Float(digits=(6, 2), help="Amount Minimun")
72 import_tax_id = fields.Many2one('import.tax.tariff',
73- ondelete = 'set null',
74- string = 'Import Tax',
75- index = True)
76- type_id = fields.Selection([
77- ('ad_valorem', "Ad Valorem"),
78- ('specific', "Specific"),
79- ('mixed', "Mixed"),
80- ], string = 'Type',
81- default='ad_valorem')
82+ ondelete='set null',
83+ string='Import Tax',
84+ index=True)
85+ type_id = fields.Selection([('ad_valorem', "Ad Valorem"),
86+ ('specific', "Specific"),
87+ ('mixed', "Mixed")], string='Type',
88+ default='ad_valorem')
89
90=== added file 'import_tax_tariff/model/product_template.py'
91--- import_tax_tariff/model/product_template.py 1970-01-01 00:00:00 +0000
92+++ import_tax_tariff/model/product_template.py 2014-11-14 00:36:42 +0000
93@@ -0,0 +1,30 @@
94+# -*- encoding: utf-8 -*-
95+# ############################################################################
96+# Module Writen to OpenERP, Open Source Management Solution
97+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
98+# All Rights Reserved
99+# ############ Credits #######################################################
100+# Coded by: Yanina Aular <yani@vauxoo.com>
101+# Planified by: Moises Lopez <moises@vauxoo.com>
102+# Audited by: Humberto Arocha <hbto@vauxoo.com>
103+# ############################################################################
104+# This program is free software: you can redistribute it and/or modify
105+# it under the terms of the GNU Affero General Public License as published
106+# by the Free Software Foundation, either version 3 of the License, or
107+# (at your option) any later version.
108+#
109+# This program is distributed in the hope that it will be useful,
110+# but WITHOUT ANY WARRANTY; without even the implied warranty of
111+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
112+# GNU Affero General Public License for more details.
113+#
114+# You should have received a copy of the GNU Affero General Public License
115+# along with this program. If not, see <http://www.gnu.org/licenses/>.
116+
117+from openerp import models, fields
118+
119+
120+class product_template(models.Model):
121+ _inherit = "product.template"
122+
123+ tariff_id = fields.Many2one("import.tax.tariff", string="Tariff")
124
125=== modified file 'import_tax_tariff/view/import_tax_view.xml'
126--- import_tax_tariff/view/import_tax_view.xml 2014-11-11 14:36:06 +0000
127+++ import_tax_tariff/view/import_tax_view.xml 2014-11-14 00:36:42 +0000
128@@ -19,8 +19,8 @@
129 <sheet>
130 <label for="name"/>
131 <field name="name" nolabel="1"/>
132- <label for="product_id"/>
133- <field name="product_id"/>
134+ <label for="product_category_id"/>
135+ <field name="product_category_id"/>
136 <label for="description"/>
137 <field name="description" nolabel="1"/>
138 <notebook>
139@@ -29,11 +29,11 @@
140 <tree editable="bottom">
141 <field name="name"/>
142 <field name="description"/>
143- <field name="code" required="1"/>
144- <field name="unit_value" required="1"/>
145- <field name="tax_percentage" required="1"/>
146+ <field name="code" required="True"/>
147+ <field name="type_id" required="True"/>
148 <field name="minimum" required="1"/>
149- <field name="type_id"/>
150+ <field name="tax_percentage" attrs="{'required': [('type_id', 'in', ['ad_valorem', 'mixed'])], 'readonly': [('type_id', '=', 'specific')]}"/>
151+ <field name="unit_value" attrs="{'required': [('type_id', 'in', ['specific', 'mixed'])], 'readonly': [('type_id', '=', 'ad_valorem')]}"/>
152 </tree>
153 </field>
154 </page>
155@@ -67,5 +67,16 @@
156 id="menu_action_import_tax_tariff"
157 parent="account.next_id_27"
158 sequence="20" groups="base.group_no_one"/>
159+
160+ <record id="view_import_tax_tariff_inh_product_template" model="ir.ui.view">
161+ <field name="name">import.tax.tariff.product.template</field>
162+ <field name="model">product.template</field>
163+ <field name="inherit_id" ref="product.product_template_only_form_view"/>
164+ <field name="arch" type="xml">
165+ <xpath expr="//field[@name='taxes_id']" position="after">
166+ <field name="tariff_id"/>
167+ </xpath>
168+ </field>
169+ </record>
170 </data>
171 </openerp>
172
173=== added file 'import_tax_tariff/view/tariff_tariff_view.xml'
174--- import_tax_tariff/view/tariff_tariff_view.xml 1970-01-01 00:00:00 +0000
175+++ import_tax_tariff/view/tariff_tariff_view.xml 2014-11-14 00:36:42 +0000
176@@ -0,0 +1,44 @@
177+<?xml version="1.0" encoding="utf-8"?>
178+<openerp>
179+ <data>
180+
181+ <record id="view_tariff_tariff_form" model="ir.ui.view">
182+ <field name="name">view.tariff.tariff</field>
183+ <field name="model">tariff.tariff</field>
184+ <field name="arch" type="xml">
185+ <form string="Import Tax - Tariff" version="7.0">
186+ <sheet>
187+ <label for="name"/>
188+ <field name="name" nolabel="1"/>
189+ <label for="code"/>
190+ <field name="code" required="True"/>
191+ <label for="minimum"/>
192+ <field name="minimum" required="True"/>
193+ <label for="type_id"/>
194+ <field name="type_id" required="True"/>
195+ <label for="tax_percentage"/>
196+ <field name="tax_percentage" attrs="{'required': [('type_id', 'in', ['ad_valorem', 'mixed'])], 'readonly': [('type_id', '=', 'specific')]}"/>
197+ <label for="unit_value"/>
198+ <field name="unit_value" attrs="{'required': [('type_id', 'in', ['specific', 'mixed'])], 'readonly': [('type_id', '=', 'ad_valorem')]}"/>
199+ <label for="description"/>
200+ <field name="description"/>
201+ </sheet>
202+ </form>
203+ </field>
204+ </record>
205+
206+ <record id="action_tariff_tariff" model="ir.actions.act_window">
207+ <field name="name">Tariff Tariff</field>
208+ <field name="res_model">tariff.tariff</field>
209+ <field name="view_type">form</field>
210+ <field name="view_mode">tree,form</field>
211+ <field name="view_id" ref="view_tariff_tariff_form"/>
212+ </record>
213+
214+ <menuitem action="action_tariff_tariff"
215+ id="menu_action_tariff_tariff"
216+ parent="account.next_id_27"
217+ sequence="30" groups="base.group_no_one"/>
218+
219+ </data>
220+</openerp>

Subscribers

People subscribed via source and target branches

to all changes: