Merge lp:~vauxoo/addons-vauxoo/7.0-account_voucher_category-dev-hbto into lp:addons-vauxoo/7.0

Proposed by hbto [Vauxoo] http://www.vauxoo.com
Status: Merged
Merged at revision: 858
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-account_voucher_category-dev-hbto
Merge into: lp:addons-vauxoo/7.0
Diff against target: 332 lines (+288/-0)
8 files modified
account_voucher_category/__init__.py (+2/-0)
account_voucher_category/__openerp__.py (+31/-0)
account_voucher_category/i18n/account_voucher_category.pot (+111/-0)
account_voucher_category/model/__init__.py (+2/-0)
account_voucher_category/model/account_voucher_category.py (+57/-0)
account_voucher_category/security/ir.model.access.csv (+2/-0)
account_voucher_category/view/menues_and_actions.xml (+22/-0)
account_voucher_category/view/view.xml (+61/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-account_voucher_category-dev-hbto
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Approve
Review via email: mp+190528@code.launchpad.net

Description of the change

Added module account_voucher_category

This module adds a field into account.voucher module that will later be used
to write into the Entry Lines of the account Bank Journal, Afterwards this field
will be used to create a new kind of reports related to Cash Flow.

To post a comment you must log in.
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

@Hbto,
Viendo el módulo luce excelente!

Solo me surgieron 2 dudas:
1) Porque el archivo csv de permisoa tiene 1,0,0,0 para el manager; es decir, solo se podrán crear, no modificar, no leer, no eliminar...?
2) Te parece si el campo en account.voucher lo ponemos readonly en los estados diferente a draft?

Otro tema, que te quería preguntar, es que si te parece buena idea que el campo aparezca en la vista de aml editable para poder modificar o agregar a polizas existente dicho campo directamente desde aml o am

Un favor, lo puedes levantar en runbot, para ver que marque verde y probarlo directamente en linea.

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Sabes, también viendo el campo que se necesita mostrar en ingles, pero operar en español (debido a que los usan no saben inglés) seria bueno agregarle translate=True al name de voucher category

858. By hbto [Vauxoo] http://www.vauxoo.com

[IMP][account_voucher_category] account.voucher.category name is now a Translatable String

Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

Concedido,

Landed into revno 858

Listo!

2013/10/11 Moisés López - http://www.vauxoo.com <email address hidden>

> Sabes, también viendo el campo que se necesita mostrar en ingles, pero
> operar en español (debido a que los usan no saben inglés) seria bueno
> agregarle translate=True al name de voucher category
> --
>
> https://code.launchpad.net/~vauxoo/addons-vauxoo/7.0-account_voucher_category-dev-hbto/+merge/190528
> You proposed
> lp:~vauxoo/addons-vauxoo/7.0-account_voucher_category-dev-hbto for merging.
>

859. By hbto [Vauxoo] http://www.vauxoo.com

[IMP][account_voucher_category] Now this module is multicompany

Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

Y ahora tambien multicompany

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) :
review: Approve
860. By hbto [Vauxoo] http://www.vauxoo.com

[IMP][account_voucher_category] Groups for the company_id in Multicompany Group

861. By hbto [Vauxoo] http://www.vauxoo.com

[IMP][account_voucher_category] I have been a bitch and Was not allowing anybody
doing anything just create, now manager can CRUD everything

Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

ya no soy tan rata y el administrador puede hacer todo el CRUD,

Regards

Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

> @Hbto,
> Viendo el módulo luce excelente!
>
> Solo me surgieron 2 dudas:
> 1) Porque el archivo csv de permisoa tiene 1,0,0,0 para el manager; es decir,
> solo se podrán crear, no modificar, no leer, no eliminar...?

ya no soy tan rata y el administrador puede hacer todo el CRUD,

Regards

Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

> Otro tema, que te quería preguntar, es que si te parece buena idea que el
> campo aparezca en la vista de aml editable para poder modificar o agregar a
> polizas existente dicho campo directamente desde aml o am
>
> Un favor, lo puedes levantar en runbot, para ver que marque verde y probarlo
> directamente en linea.

Lo sentimos mucho lo que Vd pide no esta en menú, le hemos previamente
servido una opcion en la vista en formulario del AML, pues es mucho mas
manejable la "bitch" vista en tree del AML, tu sabes que en tree ella es
muy especial.

http://bazaar.launchpad.net/~vauxoo/addons-vauxoo/7.0-account_voucher_category-dev-hbto/view/head:/account_voucher_category/view/view.xml#L11

me puedes indicar si eso satisface tu necesidad.

Regards

862. By hbto [Vauxoo] http://www.vauxoo.com

[IMP][account_voucher_category] Now the av_cat_id is only writable when in draft state

Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

> 2) Te parece si el campo en account.voucher lo ponemos readonly en los estados
> diferente a draft?

Taa daaa!!!

Concedido!!! en revno 862.

Regards

863. By hbto [Vauxoo] http://www.vauxoo.com

[FIX][account_voucher_category] Changing extension to Translation File it
should be a pot file

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Por mí la MP está aprobada visualmente.
Faltaría ver que dice runbot.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_voucher_category'
2=== added file 'account_voucher_category/__init__.py'
3--- account_voucher_category/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_voucher_category/__init__.py 2013-10-11 06:33:44 +0000
5@@ -0,0 +1,2 @@
6+# -*- encoding: utf-8 -*-
7+import model
8
9=== added file 'account_voucher_category/__openerp__.py'
10--- account_voucher_category/__openerp__.py 1970-01-01 00:00:00 +0000
11+++ account_voucher_category/__openerp__.py 2013-10-11 06:33:44 +0000
12@@ -0,0 +1,31 @@
13+# -*- encoding: utf-8 -*-
14+{
15+ "name": "Account Voucher Category",
16+ "version": "1.0",
17+ "author": "Vauxoo",
18+ "category": "Generic Modules",
19+ "description" : """
20+Account Voucher Category
21+========================
22+
23+This module adds a field into account.voucher module that will later be used
24+to write into the Entry Lines of the account Bank Journal, Afterwards this field
25+will be used to create a new kind of reports related to Cash Flow.
26+ """,
27+ "website": "http://www.vauxoo.com/",
28+ "license": "AGPL-3",
29+ "depends": [
30+ "account_voucher",
31+ ],
32+ "demo": [
33+ ],
34+ "data": [
35+ 'security/ir.model.access.csv',
36+ 'view/view.xml',
37+ 'view/menues_and_actions.xml',
38+ ],
39+ "test" : [
40+ ],
41+ "installable": True,
42+ "active": False,
43+}
44
45=== added directory 'account_voucher_category/i18n'
46=== added file 'account_voucher_category/i18n/account_voucher_category.pot'
47--- account_voucher_category/i18n/account_voucher_category.pot 1970-01-01 00:00:00 +0000
48+++ account_voucher_category/i18n/account_voucher_category.pot 2013-10-11 06:33:44 +0000
49@@ -0,0 +1,111 @@
50+# Translation of OpenERP Server.
51+# This file contains the translation of the following modules:
52+# * account_voucher_category
53+#
54+msgid ""
55+msgstr ""
56+"Project-Id-Version: OpenERP Server 7.0\n"
57+"Report-Msgid-Bugs-To: \n"
58+"POT-Creation-Date: 2013-10-11 04:16+0000\n"
59+"PO-Revision-Date: 2013-10-11 04:16+0000\n"
60+"Last-Translator: <>\n"
61+"Language-Team: \n"
62+"MIME-Version: 1.0\n"
63+"Content-Type: text/plain; charset=UTF-8\n"
64+"Content-Transfer-Encoding: \n"
65+"Plural-Forms: \n"
66+
67+#. module: account_voucher_category
68+#: field:account.voucher.category,parent_left:0
69+msgid "Parent Left"
70+msgstr ""
71+
72+#. module: account_voucher_category
73+#: help:account.voucher.category,code:0
74+msgid "Category Code"
75+msgstr ""
76+
77+#. module: account_voucher_category
78+#: field:account.voucher.category,code:0
79+msgid "Code"
80+msgstr ""
81+
82+#. module: account_voucher_category
83+#: field:account.voucher.category,name:0
84+msgid "Name"
85+msgstr ""
86+
87+#. module: account_voucher_category
88+#: field:account.voucher.category,parent_id:0
89+msgid "Parent Category"
90+msgstr ""
91+
92+#. module: account_voucher_category
93+#: view:account.voucher.category:0
94+msgid "Account Voucher Category Tree"
95+msgstr ""
96+
97+#. module: account_voucher_category
98+#: model:ir.model,name:account_voucher_category.model_account_voucher
99+msgid "Accounting Voucher"
100+msgstr ""
101+
102+#. module: account_voucher_category
103+#: model:ir.actions.act_window,name:account_voucher_category.account_voucher_categ_action
104+#: model:ir.ui.menu,name:account_voucher_category.voucher_category_menu
105+msgid "Voucher Categories"
106+msgstr ""
107+
108+#. module: account_voucher_category
109+#: field:account.voucher.category,type:0
110+#: help:account.voucher.category,type:0
111+msgid "Category Type"
112+msgstr ""
113+
114+#. module: account_voucher_category
115+#: field:account.move.line,av_cat_id:0
116+#: field:account.voucher,av_cat_id:0
117+#: model:ir.ui.menu,name:account_voucher_category.voucher_category_main_menu
118+msgid "Voucher Category"
119+msgstr ""
120+
121+#. module: account_voucher_category
122+#: model:ir.model,name:account_voucher_category.model_account_voucher_category
123+msgid "account.voucher.category"
124+msgstr ""
125+
126+#. module: account_voucher_category
127+#: view:account.voucher.category:0
128+msgid "Account Voucher Category Form"
129+msgstr ""
130+
131+#. module: account_voucher_category
132+#: selection:account.voucher.category,type:0
133+msgid "Regular"
134+msgstr ""
135+
136+#. module: account_voucher_category
137+#: help:account.voucher.category,name:0
138+msgid "Category Name"
139+msgstr ""
140+
141+#. module: account_voucher_category
142+#: model:ir.model,name:account_voucher_category.model_account_move_line
143+msgid "Journal Items"
144+msgstr ""
145+
146+#. module: account_voucher_category
147+#: selection:account.voucher.category,type:0
148+msgid "View"
149+msgstr ""
150+
151+#. module: account_voucher_category
152+#: field:account.voucher.category,parent_right:0
153+msgid "Parent Right"
154+msgstr ""
155+
156+#. module: account_voucher_category
157+#: help:account.voucher.category,parent_id:0
158+msgid "Allows to create a Hierachycal Tree of Categories"
159+msgstr ""
160+
161
162=== added directory 'account_voucher_category/model'
163=== added file 'account_voucher_category/model/__init__.py'
164--- account_voucher_category/model/__init__.py 1970-01-01 00:00:00 +0000
165+++ account_voucher_category/model/__init__.py 2013-10-11 06:33:44 +0000
166@@ -0,0 +1,2 @@
167+# -*- encoding: utf-8 -*-
168+import account_voucher_category
169
170=== added file 'account_voucher_category/model/account_voucher_category.py'
171--- account_voucher_category/model/account_voucher_category.py 1970-01-01 00:00:00 +0000
172+++ account_voucher_category/model/account_voucher_category.py 2013-10-11 06:33:44 +0000
173@@ -0,0 +1,57 @@
174+# -*- encoding: utf-8 -*-
175+from openerp.osv import fields, osv
176+
177+class account_voucher_category(osv.Model):
178+ _order = "parent_left"
179+ _parent_order = "code"
180+ _parent_store = True
181+ _name = 'account.voucher.category'
182+
183+ _columns = {
184+ 'name':fields.char('Name', 256, help='Category Name', translate=True),
185+ 'code':fields.char('Code', 64, help='Category Code'),
186+ 'type':fields.selection([('view','View'),('other','Regular')], string='Category Type', help='Category Type'),
187+ 'company_id': fields.many2one('res.company', 'Company', required=True),
188+ 'parent_id':fields.many2one('account.voucher.category', 'Parent Category',
189+ help='Allows to create a Hierachycal Tree of Categories'),
190+ 'parent_left': fields.integer('Parent Left', select=1),
191+ 'parent_right': fields.integer('Parent Right', select=1),
192+ }
193+
194+ _defaults = {
195+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
196+ }
197+
198+class account_voucher(osv.Model):
199+ _inherit = 'account.voucher'
200+
201+ _columns = {
202+ 'av_cat_id': fields.many2one('account.voucher.category', 'Voucher Category'),
203+ }
204+
205+ def first_move_line_get(self, cr, uid, voucher_id, move_id, company_currency, current_currency, context=None):
206+ '''
207+ Return a dict to be use to create the first account move line of given voucher.
208+
209+ :param voucher_id: Id of voucher what we are creating account_move.
210+ :param move_id: Id of account move where this line will be added.
211+ :param company_currency: id of currency of the company to which the voucher belong
212+ :param current_currency: id of currency of the voucher
213+ :return: mapping between fieldname and value of account move line to create
214+ :rtype: dict
215+ '''
216+ context = context or {}
217+ move_line = super(account_voucher, self).first_move_line_get(cr, uid,
218+ voucher_id, move_id, company_currency, current_currency,
219+ context=context)
220+ voucher = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
221+ move_line['av_cat_id'] = voucher.av_cat_id and voucher.av_cat_id.id or False
222+ return move_line
223+
224+
225+class account_move_line(osv.Model):
226+ _inherit = 'account.move.line'
227+
228+ _columns = {
229+ 'av_cat_id': fields.many2one('account.voucher.category', 'Voucher Category'),
230+ }
231
232=== added directory 'account_voucher_category/security'
233=== added file 'account_voucher_category/security/ir.model.access.csv'
234--- account_voucher_category/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
235+++ account_voucher_category/security/ir.model.access.csv 2013-10-11 06:33:44 +0000
236@@ -0,0 +1,2 @@
237+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
238+access_account_voucher_category_manager,account.voucher.category,model_account_voucher_category,account.group_account_manager,1,1,1,1
239
240=== added directory 'account_voucher_category/view'
241=== added file 'account_voucher_category/view/menues_and_actions.xml'
242--- account_voucher_category/view/menues_and_actions.xml 1970-01-01 00:00:00 +0000
243+++ account_voucher_category/view/menues_and_actions.xml 2013-10-11 06:33:44 +0000
244@@ -0,0 +1,22 @@
245+<?xml version='1.0' encoding='utf-8'?>
246+<openerp>
247+ <data>
248+ <record id="account_voucher_categ_action" model="ir.actions.act_window">
249+ <field name="name">Voucher Categories</field>
250+ <field name="res_model">account.voucher.category</field>
251+ <field name="view_type">form</field>
252+ <field name="view_mode">tree,form</field>
253+ </record>
254+ <menuitem
255+ id="voucher_category_main_menu"
256+ name="Voucher Category"
257+ parent="account.menu_finance_configuration"
258+ sequence="45"
259+ groups="account.group_account_manager"/>
260+ <menuitem
261+ id="voucher_category_menu"
262+ parent="voucher_category_main_menu"
263+ action='account_voucher_categ_action'
264+ />
265+ </data>
266+</openerp>
267
268=== added file 'account_voucher_category/view/view.xml'
269--- account_voucher_category/view/view.xml 1970-01-01 00:00:00 +0000
270+++ account_voucher_category/view/view.xml 2013-10-11 06:33:44 +0000
271@@ -0,0 +1,61 @@
272+<?xml version='1.0' encoding='utf-8'?>
273+<openerp>
274+ <data>
275+ <record id="view_move_line_form" model="ir.ui.view">
276+ <field name="name">account.move.line.categ.form</field>
277+ <field name="model">account.move.line</field>
278+ <field name="inherit_id" ref="account.view_move_line_form"/>
279+ <field name="arch" type="xml">
280+ <xpath expr='//group[@string="Analytic"]' position='after'>
281+ <group string="Voucher Category">
282+ <field name="av_cat_id" domain="[('type','=','other')]"/>
283+ </group>
284+ </xpath>
285+ </field>
286+ </record>
287+ <record model="ir.ui.view" id="view_vendor_payment_form">
288+ <field name="name">account.voucher.payment.form</field>
289+ <field name="model">account.voucher</field>
290+ <field name="inherit_id" ref="account_voucher.view_vendor_payment_form"/>
291+ <field name="arch" type="xml">
292+ <xpath expr='//field[@name="date"]' position='before'>
293+ <field name="av_cat_id" domain="[('type','=','other')]" attrs="{'readonly': [('state','!=','draft')]}"/>
294+ </xpath>
295+ </field>
296+ </record>
297+ <record model="ir.ui.view" id="view_vendor_receipt_form">
298+ <field name="name">account.voucher.receipt.form</field>
299+ <field name="model">account.voucher</field>
300+ <field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/>
301+ <field name="arch" type="xml">
302+ <xpath expr='//field[@name="date"]' position='before'>
303+ <field name="av_cat_id" domain="[('type','=','other')]" attrs="{'readonly': [('state','!=','draft')]}"/>
304+ </xpath>
305+ </field>
306+ </record>
307+ <record model="ir.ui.view" id="account_voucher_categ_form_view">
308+ <field name="name">account.voucher.categ.form</field>
309+ <field name="model">account.voucher.category</field>
310+ <field name="arch" type="xml">
311+ <form string="Account Voucher Category Form">
312+ <field name="code"/>
313+ <field name="name"/>
314+ <field name="type"/>
315+ <field name="company_id" widget='selection' groups="base.group_multi_company"/>
316+ </form>
317+ </field>
318+ </record>
319+ <record model="ir.ui.view" id="account_voucher_categ_tree_view">
320+ <field name="name">account.voucher.categ.tree</field>
321+ <field name="model">account.voucher.category</field>
322+ <field name="arch" type="xml">
323+ <tree string="Account Voucher Category Tree">
324+ <field name="code"/>
325+ <field name="name"/>
326+ <field name="type"/>
327+ <field name="company_id"/>
328+ </tree>
329+ </field>
330+ </record>
331+ </data>
332+</openerp>