Merge lp:~domsense/domsense-agilebg-addons/adding_account_analytic_distribution_menu into lp:domsense-agilebg-addons/6.0

Proposed by Leonardo Pistone
Status: Merged
Merged at revision: 128
Proposed branch: lp:~domsense/domsense-agilebg-addons/adding_account_analytic_distribution_menu
Merge into: lp:domsense-agilebg-addons/6.0
Diff against target: 179 lines (+154/-0)
5 files modified
account_analytic_distribution_menu/AUTHORS.txt (+2/-0)
account_analytic_distribution_menu/__init__.py (+22/-0)
account_analytic_distribution_menu/__openerp__.py (+43/-0)
account_analytic_distribution_menu/account_analytic_plans.py (+37/-0)
account_analytic_distribution_menu/account_distribution.xml (+50/-0)
To merge this branch: bzr merge lp:~domsense/domsense-agilebg-addons/adding_account_analytic_distribution_menu
Reviewer Review Type Date Requested Status
Agile Business Group Pending
Review via email: mp+88338@code.launchpad.net
To post a comment you must log in.
120. By Lorenzo Battistini

[FIX] duplicating instances

121. By Lorenzo Battistini

[FIX] handling general cases

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_analytic_distribution_menu'
2=== added file 'account_analytic_distribution_menu/AUTHORS.txt'
3--- account_analytic_distribution_menu/AUTHORS.txt 1970-01-01 00:00:00 +0000
4+++ account_analytic_distribution_menu/AUTHORS.txt 2012-01-16 18:10:27 +0000
5@@ -0,0 +1,2 @@
6+Leonardo Pistone <leonardo.pistone@domsense.com>
7+Lorenzo Battistini <lorenzo.battistini@domsense.com>
8
9=== added file 'account_analytic_distribution_menu/__init__.py'
10--- account_analytic_distribution_menu/__init__.py 1970-01-01 00:00:00 +0000
11+++ account_analytic_distribution_menu/__init__.py 2012-01-16 18:10:27 +0000
12@@ -0,0 +1,22 @@
13+# -*- coding: utf-8 -*-
14+##############################################################################
15+#
16+# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
17+# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
18+# All Rights Reserved
19+#
20+# This program is free software: you can redistribute it and/or modify
21+# it under the terms of the GNU Affero General Public License as published
22+# by the Free Software Foundation, either version 3 of the License, or
23+# (at your option) any later version.
24+#
25+# This program is distributed in the hope that it will be useful,
26+# but WITHOUT ANY WARRANTY; without even the implied warranty of
27+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28+# GNU General Public License for more details.
29+#
30+# You should have received a copy of the GNU Affero General Public License
31+# along with this program. If not, see <http://www.gnu.org/licenses/>.
32+#
33+##############################################################################
34+import account_analytic_plans
35
36=== added file 'account_analytic_distribution_menu/__openerp__.py'
37--- account_analytic_distribution_menu/__openerp__.py 1970-01-01 00:00:00 +0000
38+++ account_analytic_distribution_menu/__openerp__.py 2012-01-16 18:10:27 +0000
39@@ -0,0 +1,43 @@
40+# -*- coding: utf-8 -*-
41+##############################################################################
42+#
43+# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
44+# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
45+# All Rights Reserved
46+#
47+# This program is free software: you can redistribute it and/or modify
48+# it under the terms of the GNU Affero General Public License as published
49+# by the Free Software Foundation, either version 3 of the License, or
50+# (at your option) any later version.
51+#
52+# This program is distributed in the hope that it will be useful,
53+# but WITHOUT ANY WARRANTY; without even the implied warranty of
54+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55+# GNU General Public License for more details.
56+#
57+# You should have received a copy of the GNU Affero General Public License
58+# along with this program. If not, see <http://www.gnu.org/licenses/>.
59+#
60+##############################################################################
61+{
62+ 'name': "Account Analytic Distribution Menu",
63+ 'version': '0.1',
64+ 'category' : 'Accounting & Finance',
65+ 'complexity': "easy",
66+ 'description': """
67+Account Analytic Distribution Menu
68+
69+This little module adds a menuitem to see all the analytic distributions
70+in the system""",
71+ 'author': 'Agile Business Group & Domsense',
72+ 'website': 'http://www.agilebg.com',
73+ 'license': 'AGPL-3',
74+ "depends" : ['account_analytic_plans'],
75+ "init_xml" : [],
76+ "update_xml" : [
77+ 'account_distribution.xml',
78+ ],
79+ "demo_xml" : [],
80+ "active": False,
81+ "installable": True
82+}
83
84=== added file 'account_analytic_distribution_menu/account_analytic_plans.py'
85--- account_analytic_distribution_menu/account_analytic_plans.py 1970-01-01 00:00:00 +0000
86+++ account_analytic_distribution_menu/account_analytic_plans.py 2012-01-16 18:10:27 +0000
87@@ -0,0 +1,37 @@
88+# -*- coding: utf-8 -*-
89+##############################################################################
90+#
91+# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
92+# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
93+# All Rights Reserved
94+#
95+# This program is free software: you can redistribute it and/or modify
96+# it under the terms of the GNU Affero General Public License as published
97+# by the Free Software Foundation, either version 3 of the License, or
98+# (at your option) any later version.
99+#
100+# This program is distributed in the hope that it will be useful,
101+# but WITHOUT ANY WARRANTY; without even the implied warranty of
102+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
103+# GNU General Public License for more details.
104+#
105+# You should have received a copy of the GNU Affero General Public License
106+# along with this program. If not, see <http://www.gnu.org/licenses/>.
107+#
108+##############################################################################
109+
110+from osv import fields, osv
111+
112+class account_analytic_plan_instance(osv.osv):
113+
114+ _inherit = "account.analytic.plan.instance"
115+
116+ def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
117+ if context is None:
118+ context = {}
119+ this = self.browse(cr, uid, ids[0], context=context)
120+ if this.plan_id and not vals.has_key('plan_id'):
121+ vals['plan_id'] = this.plan_id.id
122+ return super(account_analytic_plan_instance, self).write(cr, uid, ids, vals, context=context)
123+
124+account_analytic_plan_instance()
125
126=== added file 'account_analytic_distribution_menu/account_distribution.xml'
127--- account_analytic_distribution_menu/account_distribution.xml 1970-01-01 00:00:00 +0000
128+++ account_analytic_distribution_menu/account_distribution.xml 2012-01-16 18:10:27 +0000
129@@ -0,0 +1,50 @@
130+<?xml version="1.0"?>
131+<openerp>
132+<data>
133+
134+ <record model="ir.ui.view" id="account_analytic_plan_instance_form">
135+ <field name="name">account.analytic.plan.instance.form</field>
136+ <field name="model">account.analytic.plan.instance</field>
137+ <field name="type">form</field>
138+ <field name="inherit_id" ref="account_analytic_plans.account_analytic_plan_instance_form"></field>
139+ <field name="arch" type="xml">
140+ <field name="account_ids" nolabel="1" colspan="4" position="replace">
141+ <field name="account_ids" nolabel="1" colspan="4" />
142+ </field>
143+ </field>
144+ </record>
145+
146+ <record model="ir.ui.view" id="account_analytic_plan_instance_line_form">
147+ <field name="name">account.analytic.plan.instance.line.form</field>
148+ <field name="model">account.analytic.plan.instance.line</field>
149+ <field name="type">form</field>
150+ <field name="inherit_id" ref="account_analytic_plans.account_analytic_plan_instance_line_form"></field>
151+ <field name="arch" type="xml">
152+ <field name="plan_id" position="replace"/>
153+ </field>
154+ </record>
155+
156+ <record model="ir.ui.view" id="account_analytic_plan_instance_line_tree">
157+ <field name="name">account.analytic.plan.instance.line.tree</field>
158+ <field name="model">account.analytic.plan.instance.line</field>
159+ <field name="inherit_id" ref="account_analytic_plans.account_analytic_plan_instance_line_tree"></field>
160+ <field name="type">tree</field>
161+ <field name="arch" type="xml">
162+ <field name="plan_id" position="replace"/>
163+ </field>
164+ </record>
165+
166+ <record model="ir.actions.act_window" id="account_analytic_plan_instance_action">
167+ <field name="name">Analytic Distribution's Models</field>
168+ <field name="type">ir.actions.act_window</field>
169+ <field name="res_model">account.analytic.plan.instance</field>
170+ <field name="view_type">form</field>
171+ <field name="view_mode">tree,form</field>
172+ </record>
173+
174+ <menuitem
175+ parent="account_analytic_plans.menu_account_analytic_multi_plan_action"
176+ id="menu_account_analytic_plan_instance"
177+ action="account_analytic_plan_instance_action"/>
178+</data>
179+</openerp>

Subscribers

People subscribed via source and target branches

to status/vote changes: