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
=== added directory 'account_voucher_category'
=== added file 'account_voucher_category/__init__.py'
--- account_voucher_category/__init__.py 1970-01-01 00:00:00 +0000
+++ account_voucher_category/__init__.py 2013-10-11 06:33:44 +0000
@@ -0,0 +1,2 @@
1# -*- encoding: utf-8 -*-
2import model
03
=== added file 'account_voucher_category/__openerp__.py'
--- account_voucher_category/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_voucher_category/__openerp__.py 2013-10-11 06:33:44 +0000
@@ -0,0 +1,31 @@
1# -*- encoding: utf-8 -*-
2{
3 "name": "Account Voucher Category",
4 "version": "1.0",
5 "author": "Vauxoo",
6 "category": "Generic Modules",
7 "description" : """
8Account Voucher Category
9========================
10
11This module adds a field into account.voucher module that will later be used
12to write into the Entry Lines of the account Bank Journal, Afterwards this field
13will be used to create a new kind of reports related to Cash Flow.
14 """,
15 "website": "http://www.vauxoo.com/",
16 "license": "AGPL-3",
17 "depends": [
18 "account_voucher",
19 ],
20 "demo": [
21 ],
22 "data": [
23 'security/ir.model.access.csv',
24 'view/view.xml',
25 'view/menues_and_actions.xml',
26 ],
27 "test" : [
28 ],
29 "installable": True,
30 "active": False,
31}
032
=== added directory 'account_voucher_category/i18n'
=== added file 'account_voucher_category/i18n/account_voucher_category.pot'
--- account_voucher_category/i18n/account_voucher_category.pot 1970-01-01 00:00:00 +0000
+++ account_voucher_category/i18n/account_voucher_category.pot 2013-10-11 06:33:44 +0000
@@ -0,0 +1,111 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_voucher_category
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-10-11 04:16+0000\n"
10"PO-Revision-Date: 2013-10-11 04:16+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: account_voucher_category
19#: field:account.voucher.category,parent_left:0
20msgid "Parent Left"
21msgstr ""
22
23#. module: account_voucher_category
24#: help:account.voucher.category,code:0
25msgid "Category Code"
26msgstr ""
27
28#. module: account_voucher_category
29#: field:account.voucher.category,code:0
30msgid "Code"
31msgstr ""
32
33#. module: account_voucher_category
34#: field:account.voucher.category,name:0
35msgid "Name"
36msgstr ""
37
38#. module: account_voucher_category
39#: field:account.voucher.category,parent_id:0
40msgid "Parent Category"
41msgstr ""
42
43#. module: account_voucher_category
44#: view:account.voucher.category:0
45msgid "Account Voucher Category Tree"
46msgstr ""
47
48#. module: account_voucher_category
49#: model:ir.model,name:account_voucher_category.model_account_voucher
50msgid "Accounting Voucher"
51msgstr ""
52
53#. module: account_voucher_category
54#: model:ir.actions.act_window,name:account_voucher_category.account_voucher_categ_action
55#: model:ir.ui.menu,name:account_voucher_category.voucher_category_menu
56msgid "Voucher Categories"
57msgstr ""
58
59#. module: account_voucher_category
60#: field:account.voucher.category,type:0
61#: help:account.voucher.category,type:0
62msgid "Category Type"
63msgstr ""
64
65#. module: account_voucher_category
66#: field:account.move.line,av_cat_id:0
67#: field:account.voucher,av_cat_id:0
68#: model:ir.ui.menu,name:account_voucher_category.voucher_category_main_menu
69msgid "Voucher Category"
70msgstr ""
71
72#. module: account_voucher_category
73#: model:ir.model,name:account_voucher_category.model_account_voucher_category
74msgid "account.voucher.category"
75msgstr ""
76
77#. module: account_voucher_category
78#: view:account.voucher.category:0
79msgid "Account Voucher Category Form"
80msgstr ""
81
82#. module: account_voucher_category
83#: selection:account.voucher.category,type:0
84msgid "Regular"
85msgstr ""
86
87#. module: account_voucher_category
88#: help:account.voucher.category,name:0
89msgid "Category Name"
90msgstr ""
91
92#. module: account_voucher_category
93#: model:ir.model,name:account_voucher_category.model_account_move_line
94msgid "Journal Items"
95msgstr ""
96
97#. module: account_voucher_category
98#: selection:account.voucher.category,type:0
99msgid "View"
100msgstr ""
101
102#. module: account_voucher_category
103#: field:account.voucher.category,parent_right:0
104msgid "Parent Right"
105msgstr ""
106
107#. module: account_voucher_category
108#: help:account.voucher.category,parent_id:0
109msgid "Allows to create a Hierachycal Tree of Categories"
110msgstr ""
111
0112
=== added directory 'account_voucher_category/model'
=== added file 'account_voucher_category/model/__init__.py'
--- account_voucher_category/model/__init__.py 1970-01-01 00:00:00 +0000
+++ account_voucher_category/model/__init__.py 2013-10-11 06:33:44 +0000
@@ -0,0 +1,2 @@
1# -*- encoding: utf-8 -*-
2import account_voucher_category
03
=== added file 'account_voucher_category/model/account_voucher_category.py'
--- account_voucher_category/model/account_voucher_category.py 1970-01-01 00:00:00 +0000
+++ account_voucher_category/model/account_voucher_category.py 2013-10-11 06:33:44 +0000
@@ -0,0 +1,57 @@
1# -*- encoding: utf-8 -*-
2from openerp.osv import fields, osv
3
4class account_voucher_category(osv.Model):
5 _order = "parent_left"
6 _parent_order = "code"
7 _parent_store = True
8 _name = 'account.voucher.category'
9
10 _columns = {
11 'name':fields.char('Name', 256, help='Category Name', translate=True),
12 'code':fields.char('Code', 64, help='Category Code'),
13 'type':fields.selection([('view','View'),('other','Regular')], string='Category Type', help='Category Type'),
14 'company_id': fields.many2one('res.company', 'Company', required=True),
15 'parent_id':fields.many2one('account.voucher.category', 'Parent Category',
16 help='Allows to create a Hierachycal Tree of Categories'),
17 'parent_left': fields.integer('Parent Left', select=1),
18 'parent_right': fields.integer('Parent Right', select=1),
19 }
20
21 _defaults = {
22 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
23 }
24
25class account_voucher(osv.Model):
26 _inherit = 'account.voucher'
27
28 _columns = {
29 'av_cat_id': fields.many2one('account.voucher.category', 'Voucher Category'),
30 }
31
32 def first_move_line_get(self, cr, uid, voucher_id, move_id, company_currency, current_currency, context=None):
33 '''
34 Return a dict to be use to create the first account move line of given voucher.
35
36 :param voucher_id: Id of voucher what we are creating account_move.
37 :param move_id: Id of account move where this line will be added.
38 :param company_currency: id of currency of the company to which the voucher belong
39 :param current_currency: id of currency of the voucher
40 :return: mapping between fieldname and value of account move line to create
41 :rtype: dict
42 '''
43 context = context or {}
44 move_line = super(account_voucher, self).first_move_line_get(cr, uid,
45 voucher_id, move_id, company_currency, current_currency,
46 context=context)
47 voucher = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
48 move_line['av_cat_id'] = voucher.av_cat_id and voucher.av_cat_id.id or False
49 return move_line
50
51
52class account_move_line(osv.Model):
53 _inherit = 'account.move.line'
54
55 _columns = {
56 'av_cat_id': fields.many2one('account.voucher.category', 'Voucher Category'),
57 }
058
=== added directory 'account_voucher_category/security'
=== added file 'account_voucher_category/security/ir.model.access.csv'
--- account_voucher_category/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ account_voucher_category/security/ir.model.access.csv 2013-10-11 06:33:44 +0000
@@ -0,0 +1,2 @@
1id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2access_account_voucher_category_manager,account.voucher.category,model_account_voucher_category,account.group_account_manager,1,1,1,1
03
=== added directory 'account_voucher_category/view'
=== added file 'account_voucher_category/view/menues_and_actions.xml'
--- account_voucher_category/view/menues_and_actions.xml 1970-01-01 00:00:00 +0000
+++ account_voucher_category/view/menues_and_actions.xml 2013-10-11 06:33:44 +0000
@@ -0,0 +1,22 @@
1<?xml version='1.0' encoding='utf-8'?>
2<openerp>
3 <data>
4 <record id="account_voucher_categ_action" model="ir.actions.act_window">
5 <field name="name">Voucher Categories</field>
6 <field name="res_model">account.voucher.category</field>
7 <field name="view_type">form</field>
8 <field name="view_mode">tree,form</field>
9 </record>
10 <menuitem
11 id="voucher_category_main_menu"
12 name="Voucher Category"
13 parent="account.menu_finance_configuration"
14 sequence="45"
15 groups="account.group_account_manager"/>
16 <menuitem
17 id="voucher_category_menu"
18 parent="voucher_category_main_menu"
19 action='account_voucher_categ_action'
20 />
21 </data>
22</openerp>
023
=== added file 'account_voucher_category/view/view.xml'
--- account_voucher_category/view/view.xml 1970-01-01 00:00:00 +0000
+++ account_voucher_category/view/view.xml 2013-10-11 06:33:44 +0000
@@ -0,0 +1,61 @@
1<?xml version='1.0' encoding='utf-8'?>
2<openerp>
3 <data>
4 <record id="view_move_line_form" model="ir.ui.view">
5 <field name="name">account.move.line.categ.form</field>
6 <field name="model">account.move.line</field>
7 <field name="inherit_id" ref="account.view_move_line_form"/>
8 <field name="arch" type="xml">
9 <xpath expr='//group[@string="Analytic"]' position='after'>
10 <group string="Voucher Category">
11 <field name="av_cat_id" domain="[('type','=','other')]"/>
12 </group>
13 </xpath>
14 </field>
15 </record>
16 <record model="ir.ui.view" id="view_vendor_payment_form">
17 <field name="name">account.voucher.payment.form</field>
18 <field name="model">account.voucher</field>
19 <field name="inherit_id" ref="account_voucher.view_vendor_payment_form"/>
20 <field name="arch" type="xml">
21 <xpath expr='//field[@name="date"]' position='before'>
22 <field name="av_cat_id" domain="[('type','=','other')]" attrs="{'readonly': [('state','!=','draft')]}"/>
23 </xpath>
24 </field>
25 </record>
26 <record model="ir.ui.view" id="view_vendor_receipt_form">
27 <field name="name">account.voucher.receipt.form</field>
28 <field name="model">account.voucher</field>
29 <field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/>
30 <field name="arch" type="xml">
31 <xpath expr='//field[@name="date"]' position='before'>
32 <field name="av_cat_id" domain="[('type','=','other')]" attrs="{'readonly': [('state','!=','draft')]}"/>
33 </xpath>
34 </field>
35 </record>
36 <record model="ir.ui.view" id="account_voucher_categ_form_view">
37 <field name="name">account.voucher.categ.form</field>
38 <field name="model">account.voucher.category</field>
39 <field name="arch" type="xml">
40 <form string="Account Voucher Category Form">
41 <field name="code"/>
42 <field name="name"/>
43 <field name="type"/>
44 <field name="company_id" widget='selection' groups="base.group_multi_company"/>
45 </form>
46 </field>
47 </record>
48 <record model="ir.ui.view" id="account_voucher_categ_tree_view">
49 <field name="name">account.voucher.categ.tree</field>
50 <field name="model">account.voucher.category</field>
51 <field name="arch" type="xml">
52 <tree string="Account Voucher Category Tree">
53 <field name="code"/>
54 <field name="name"/>
55 <field name="type"/>
56 <field name="company_id"/>
57 </tree>
58 </field>
59 </record>
60 </data>
61</openerp>