Merge lp:~vauxoo/openerp-venezuela-localization/uanalisis into lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk

Proposed by Javier Duran
Status: Merged
Merged at revision: 487
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/uanalisis
Merge into: lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk
Diff against target: 400 lines (+368/-0)
6 files modified
report_profit/__init__.py (+27/-0)
report_profit/__openerp__.py (+47/-0)
report_profit/i18n/es_VE.po (+117/-0)
report_profit/security/ir.model.access.csv (+7/-0)
report_profit/unit_analisys.py (+80/-0)
report_profit/unit_analisys_view.xml (+90/-0)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/uanalisis
Reviewer Review Type Date Requested Status
Javier Duran (community) Approve
Review via email: mp+85950@code.launchpad.net

Description of the change

Se agrega modulo report profit con la unidad de analisis para las ventas.

To post a comment you must log in.
Revision history for this message
Javier Duran (javieredm) wrote :

Merged en el trunk:

revno: 487 [merge]
revision-id: javier@squezee-vir-20111215203333-xqe42ewdoyoiypn0

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'report_profit'
2=== added file 'report_profit/__init__.py'
3--- report_profit/__init__.py 1970-01-01 00:00:00 +0000
4+++ report_profit/__init__.py 2011-12-15 20:32:36 +0000
5@@ -0,0 +1,27 @@
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: Javier Duran javier@vauxoo.com
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+
31+import unit_analisys
32+
33
34=== added file 'report_profit/__openerp__.py'
35--- report_profit/__openerp__.py 1970-01-01 00:00:00 +0000
36+++ report_profit/__openerp__.py 2011-12-15 20:32:36 +0000
37@@ -0,0 +1,47 @@
38+ # -*- encoding: utf-8 -*-
39+###########################################################################
40+# Module Writen to OpenERP, Open Source Management Solution
41+# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
42+# All Rights Reserved
43+###############Credits######################################################
44+# Coded by: Javier Duran javier@vauxoo.com
45+# Planified by: Nhomar Hernandez
46+# Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
47+# Audited by: Humberto Arocha humberto@openerp.com.ve
48+#############################################################################
49+# This program is free software: you can redistribute it and/or modify
50+# it under the terms of the GNU Affero General Public License as published by
51+# the Free Software Foundation, either version 3 of the License, or
52+# (at your option) any later version.
53+#
54+# This program is distributed in the hope that it will be useful,
55+# but WITHOUT ANY WARRANTY; without even the implied warranty of
56+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57+# GNU Affero General Public License for more details.
58+#
59+# You should have received a copy of the GNU Affero General Public License
60+# along with this program. If not, see <http://www.gnu.org/licenses/>.
61+##############################################################################
62+
63+{
64+ "name" : "Report Profit",
65+ "version" : "0.2",
66+ "depends" : ["base","product", "purchase"],
67+ "author" : "Vauxoo",
68+ "description" : """
69+ Performs the equivalent of a third unit for the analysis of sales.
70+
71+ """,
72+ "website" : "http://vauxoo.com",
73+ "category" : "Localization",
74+ "init_xml" : [
75+ ],
76+ "demo_xml" : [
77+ ],
78+ "update_xml" : [
79+ "security/ir.model.access.csv",
80+ "unit_analisys_view.xml",
81+ ],
82+ "active": False,
83+ "installable": True,
84+}
85
86=== added directory 'report_profit/i18n'
87=== added file 'report_profit/i18n/es_VE.po'
88--- report_profit/i18n/es_VE.po 1970-01-01 00:00:00 +0000
89+++ report_profit/i18n/es_VE.po 2011-12-15 20:32:36 +0000
90@@ -0,0 +1,117 @@
91+# Translation of OpenERP Server.
92+# This file contains the translation of the following modules:
93+# * report_profit
94+#
95+msgid ""
96+msgstr ""
97+"Project-Id-Version: OpenERP Server 6.0.3\n"
98+"Report-Msgid-Bugs-To: support@openerp.com\n"
99+"POT-Creation-Date: 2011-12-15 16:10+0000\n"
100+"PO-Revision-Date: 2011-12-15 16:10+0000\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: \n"
106+"Plural-Forms: \n"
107+
108+#. module: report_profit
109+#: model:ir.ui.menu,name:report_profit.menu_product_unit_analysis
110+msgid "Analisys Unit."
111+msgstr "Unidad de Analisis"
112+
113+#. module: report_profit
114+#: help:product.uom.consol.line,factor_consol:0
115+msgid "The coefficient for the formula:\n"
116+"1 (base unit) = coeff (this unit). Rate = 1 / Factor."
117+msgstr "El coeficiente para la formula:\n"
118+"1 (unidad base ) = coeff (Esta unidad). Tasa = 1 / Factor."
119+
120+#. module: report_profit
121+#: field:product.uom.consol.line,p_uom_c_id:0
122+msgid "Consolidate Unit"
123+msgstr "Unidad consolidada"
124+
125+#. module: report_profit
126+#: field:product.uom.consol,name:0
127+#: field:product.uom.consol.line,name:0
128+msgid "Name"
129+msgstr "Nombre"
130+
131+#. module: report_profit
132+#: field:product.uom.consol.line,factor_inv_consol:0
133+msgid "Factor inv"
134+msgstr "Factor inv"
135+
136+#. module: report_profit
137+#: help:product.uom.consol.line,p_uom_id:0
138+msgid "Unit of Measure used for compute."
139+msgstr "Unidad de medida usada para el calculo."
140+
141+#. module: report_profit
142+#: help:product.uom.consol.line,rounding_consol:0
143+msgid "The computed quantity will be a multiple of this value. Use 1.0 for products that can not be split."
144+msgstr "La cantidad calculada sera multiplicada por este valor. Use 1.0 para productos que no pueden ser divididos."
145+
146+#. module: report_profit
147+#: model:ir.model,name:report_profit.model_product_uom_consol
148+msgid "A third unit to consolidate the sales and purchase."
149+msgstr "Una tercera unidad para consolidar las ventas y compras."
150+
151+#. module: report_profit
152+#: field:product.uom.consol,uom_line_ids:0
153+msgid "Units"
154+msgstr "Unidades"
155+
156+#. module: report_profit
157+#: field:product.uom.consol.line,factor_consol:0
158+msgid "Rate"
159+msgstr "Tasa"
160+
161+#. module: report_profit
162+#: view:product.uom.consol:0
163+msgid "Unit analysis"
164+msgstr "Unidad de Analisis"
165+
166+#. module: report_profit
167+#: field:product.uom.consol.line,rounding_consol:0
168+msgid "Rounding Precision"
169+msgstr "Precision de redondeo"
170+
171+#. module: report_profit
172+#: field:product.uom.consol.line,factor_inv_data_consol:0
173+msgid "Factor"
174+msgstr "Factor"
175+
176+#. module: report_profit
177+#: field:product.uom.consol.line,analysis:0
178+msgid "Active"
179+msgstr "Activo"
180+
181+#. module: report_profit
182+#: model:ir.model,name:report_profit.model_product_uom_consol_line
183+msgid " Elements to control the seconds unit of measure. "
184+msgstr " Elementos para comparar la segunda unidad de medida. "
185+
186+#. module: report_profit
187+#: field:product.uom.consol.line,p_uom_id:0
188+msgid "Unit of measure"
189+msgstr "Unidades de medidas"
190+
191+#. module: report_profit
192+#: model:ir.actions.act_window,name:report_profit.action_product_unit_analysis
193+msgid "Products Unit Analysis"
194+msgstr "Analisis unidades de productos"
195+
196+#. module: report_profit
197+#: help:product.uom.consol.line,factor_inv_consol:0
198+msgid "The coefficient for the formula:\n"
199+"coeff (base unit) = 1 (this unit). Factor = 1 / Rate."
200+msgstr "El coeficiente para la formula:\n"
201+"coeff (Unidad base) = 1 (esta unidad). Factor = 1 / Tasa."
202+
203+#. module: report_profit
204+#: view:product.uom.consol:0
205+msgid "UOM third to Consolidate"
206+msgstr "Tercera UDM a Consolidar"
207+
208
209=== added directory 'report_profit/security'
210=== added file 'report_profit/security/ir.model.access.csv'
211--- report_profit/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
212+++ report_profit/security/ir.model.access.csv 2011-12-15 20:32:36 +0000
213@@ -0,0 +1,7 @@
214+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
215+"access_product_uom_consol_user","product.uom.consol.user","model_product_uom_consol","purchase.group_purchase_user",1,0,0,0
216+"access_product_uom_consol_line_user","product.uom.consol.line.user","model_product_uom_consol_line","purchase.group_purchase_user",1,0,0,0
217+"access_product_uom_consol_manager","product.uom.consol.manager","model_product_uom_consol","purchase.group_purchase_manager",1,1,1,1
218+"access_product_uom_consol_line_manager","product.uom.consol.line.manager","model_product_uom_consol_line","purchase.group_purchase_manager",1,1,1,1
219+
220+
221
222=== added file 'report_profit/unit_analisys.py'
223--- report_profit/unit_analisys.py 1970-01-01 00:00:00 +0000
224+++ report_profit/unit_analisys.py 2011-12-15 20:32:36 +0000
225@@ -0,0 +1,80 @@
226+# -*- encoding: utf-8 -*-
227+##############################################################################
228+#
229+# Copyright (c) 2010 Netquatro C.A. (http://openerp.netquatro.com/) All Rights Reserved.
230+# Javier Duran <javier.duran@netquatro.com>
231+# Nhomar Hernandez <nhomar.hernandez@netquatro.com>
232+#
233+# WARNING: This program as such is intended to be used by professional
234+# programmers who take the whole responsability of assessing all potential
235+# consequences resulting from its eventual inadequacies and bugs
236+# End users who are looking for a ready-to-use solution with commercial
237+# garantees and support are strongly adviced to contract a Free Software
238+# Service Company
239+#
240+# This program is Free Software; you can redistribute it and/or
241+# modify it under the terms of the GNU General Public License
242+# as published by the Free Software Foundation; either version 2
243+# of the License, or (at your option) any later version.
244+#
245+# This program is distributed in the hope that it will be useful,
246+# but WITHOUT ANY WARRANTY; without even the implied warranty of
247+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
248+# GNU General Public License for more details.
249+#
250+# You should have received a copy of the GNU General Public License
251+# along with this program; if not, write to the Free Software
252+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
253+#
254+##############################################################################
255+
256+from osv import osv
257+from osv import fields
258+from tools.translate import _
259+
260+class product_uom_consol(osv.osv):
261+ _name = 'product.uom.consol'
262+ _description = 'A third unit to consolidate the sales and purchase.'
263+ _columns = {
264+ 'name': fields.char('Name', size=64, required=True, translate=True),
265+ 'uom_line_ids':fields.one2many('product.uom.consol.line', 'p_uom_c_id', 'Units', required=False),
266+ }
267+
268+product_uom_consol()
269+
270+class product_uom_consol_line(osv.osv):
271+ """
272+ Third Unit to consolidate sales and purchases!
273+ """
274+ _name = 'product.uom.consol.line'
275+ _description = ''' Elements to control the seconds unit of measure. '''
276+
277+ def _factor(self, cursor, user, ids, name, arg, context):
278+ res = {}
279+ for uom in self.browse(cursor, user, ids, context=context):
280+ if uom.factor_consol:
281+ if uom.factor_inv_data_consol:
282+ res[uom.id] = uom.factor_inv_data_consol
283+ else:
284+ res[uom.id] = round(1 / uom.factor_consol, 6)
285+ else:
286+ res[uom.id] = 0.0
287+ return res
288+ _columns = {
289+ 'p_uom_c_id':fields.many2one('product.uom.consol', 'Consolidate Unit', required=False),
290+ 'factor_consol': fields.float('Rate', digits=(12, 6), required=True,
291+ help='The coefficient for the formula:\n' \
292+ '1 (base unit) = coeff (this unit). Rate = 1 / Factor.'),
293+ 'factor_inv_consol': fields.function(_factor, digits=(12, 6),
294+ method=True, string='Factor inv',
295+ help='The coefficient for the formula:\n' \
296+ 'coeff (base unit) = 1 (this unit). Factor = 1 / Rate.'),
297+ 'factor_inv_data_consol': fields.float('Factor', digits=(12, 6)),
298+ 'rounding_consol': fields.float('Rounding Precision', digits=(16, 3), required=True,
299+ help="The computed quantity will be a multiple of this value. Use 1.0 for products that can not be split."),
300+ 'analysis': fields.boolean('Active'),
301+ 'p_uom_id':fields.many2one('product.uom', 'Unit of measure', required=True, help="Unit of Measure used for compute."),
302+ 'name': fields.char('Name', size=64, required=False),
303+ }
304+
305+product_uom_consol_line()
306
307=== added file 'report_profit/unit_analisys_view.xml'
308--- report_profit/unit_analisys_view.xml 1970-01-01 00:00:00 +0000
309+++ report_profit/unit_analisys_view.xml 2011-12-15 20:32:36 +0000
310@@ -0,0 +1,90 @@
311+<?xml version="1.0"?>
312+<openerp>
313+ <data>
314+
315+ <record id="view_product_uom_consol_filter" model="ir.ui.view">
316+ <field name="name">account.wh.iva.search</field>
317+ <field name="model">product.uom.consol</field>
318+ <field name="type">search</field>
319+ <field name="arch" type="xml">
320+ <search string="Search UOM Consolidate">
321+ <group colspan="4">
322+ <field name="name"/>
323+ </group>
324+ </search>
325+ </field>
326+ </record>
327+
328+ <record model="ir.ui.view" id="view_product_uom_consol_form">
329+ <field name="name">product.uom.consol.form</field>
330+ <field name="model">product.uom.consol</field>
331+ <field name="type">form</field>
332+ <field name="arch" type="xml">
333+ <form string="UOM third to Consolidate">
334+ <group col="6" colspan="4">
335+ <field name="name"/>
336+ </group>
337+ <group col="6" colspan="4">
338+ <field name="uom_line_ids" colspan="4" nolabel="1">
339+ <tree string="Unit analysis" editable="bottom">
340+ <field name="name"/>
341+ <field name="p_uom_id"/>
342+ <field name="factor_consol"/>
343+ <!--<field name="factor_inv_data_consol"/>-->
344+ <field name="factor_inv_consol"/>
345+ <field name="rounding_consol"/>
346+ </tree>
347+ <form>
348+ <field name="name"/>
349+ <field name="p_uom_id"/>
350+ <field name="factor_consol"/>
351+ <!--<field name="factor_inv_data_consol"/>-->
352+ <field name="factor_inv_consol"/>
353+ <field name="rounding_consol"/>
354+ </form>
355+ </field>
356+ </group>
357+ </form>
358+ </field>
359+ </record>
360+ <record model="ir.ui.view" id="view_product_uom_consol_tree">
361+ <field name="name">product.uom.consol.tree</field>
362+ <field name="model">product.uom.consol</field>
363+ <field name="type">tree</field>
364+ <field name="arch" type="xml">
365+ <tree string="UOM third to Consolidate">
366+ <field name="name"/>
367+ </tree>
368+ </field>
369+ </record>
370+
371+ <record id="action_product_unit_analysis" model="ir.actions.act_window">
372+ <field name="name">Products Unit Analysis</field>
373+ <field name="type">ir.actions.act_window</field>
374+ <field name="res_model">product.uom.consol</field>
375+ <field name="view_type">form</field>
376+ <field name="view_mode">tree,form</field>
377+ <field name="search_view_id" ref="view_product_uom_consol_filter"/>
378+ </record>
379+ <record model="ir.actions.act_window.view" id="act_wv_unit_analysis_tree">
380+ <field name="sequence" eval="10"/>
381+ <field name="view_mode">tree</field>
382+ <field name="view_id" ref="view_product_uom_consol_tree"/>
383+ <field name="act_window_id" ref="action_product_unit_analysis"/>
384+ </record>
385+ <record model="ir.actions.act_window.view" id="act_wv_unit_analysis_form">
386+ <field name="sequence" eval="20"/>
387+ <field name="view_mode">form</field>
388+ <field name="view_id" ref="view_product_uom_consol_form"/>
389+ <field name="act_window_id" ref="action_product_unit_analysis"/>
390+ </record>
391+
392+ <menuitem
393+ id="menu_product_unit_analysis"
394+ action="action_product_unit_analysis"
395+ parent="product.next_id_16"
396+ sequence="11"
397+ name="Analisys Unit."/>
398+
399+ </data>
400+</openerp>