Merge lp:~domsense/domsense-agilebg-addons/adding_account_budget_multiple_validation_fixed into lp:domsense-agilebg-addons/6.1

Proposed by Leonardo Pistone
Status: Merged
Merged at revision: 189
Proposed branch: lp:~domsense/domsense-agilebg-addons/adding_account_budget_multiple_validation_fixed
Merge into: lp:domsense-agilebg-addons/6.1
Diff against target: 325 lines (+284/-0)
8 files modified
account_budget_multiple_validation/AUTHORS.txt (+1/-0)
account_budget_multiple_validation/__init__.py (+22/-0)
account_budget_multiple_validation/__openerp__.py (+45/-0)
account_budget_multiple_validation/account_budget.py (+53/-0)
account_budget_multiple_validation/account_budget_view.xml (+21/-0)
account_budget_multiple_validation/account_budget_workflow.xml (+38/-0)
account_budget_multiple_validation/i18n/account_budget_multiple_validation.pot (+52/-0)
account_budget_multiple_validation/i18n/it.po (+52/-0)
To merge this branch: bzr merge lp:~domsense/domsense-agilebg-addons/adding_account_budget_multiple_validation_fixed
Reviewer Review Type Date Requested Status
Leonardo Pistone (community) Approve
Review via email: mp+105076@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_budget_multiple_validation'
2=== added file 'account_budget_multiple_validation/AUTHORS.txt'
3--- account_budget_multiple_validation/AUTHORS.txt 1970-01-01 00:00:00 +0000
4+++ account_budget_multiple_validation/AUTHORS.txt 2012-05-08 14:42:23 +0000
5@@ -0,0 +1,1 @@
6+Leonardo Pistone <leonardo.pistone@agilebg.com>
7
8=== added file 'account_budget_multiple_validation/__init__.py'
9--- account_budget_multiple_validation/__init__.py 1970-01-01 00:00:00 +0000
10+++ account_budget_multiple_validation/__init__.py 2012-05-08 14:42:23 +0000
11@@ -0,0 +1,22 @@
12+# -*- coding: utf-8 -*-
13+##############################################################################
14+#
15+# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
16+# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
17+# All Rights Reserved
18+#
19+# This program is free software: you can redistribute it and/or modify
20+# it under the terms of the GNU Affero General Public License as published
21+# by the Free Software Foundation, either version 3 of the License, or
22+# (at your option) any later version.
23+#
24+# This program is distributed in the hope that it will be useful,
25+# but WITHOUT ANY WARRANTY; without even the implied warranty of
26+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+# GNU General Public License for more details.
28+#
29+# You should have received a copy of the GNU Affero General Public License
30+# along with this program. If not, see <http://www.gnu.org/licenses/>.
31+#
32+##############################################################################
33+import account_budget
34
35=== added file 'account_budget_multiple_validation/__openerp__.py'
36--- account_budget_multiple_validation/__openerp__.py 1970-01-01 00:00:00 +0000
37+++ account_budget_multiple_validation/__openerp__.py 2012-05-08 14:42:23 +0000
38@@ -0,0 +1,45 @@
39+# -*- coding: utf-8 -*-
40+##############################################################################
41+#
42+# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
43+# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
44+# All Rights Reserved
45+#
46+# This program is free software: you can redistribute it and/or modify
47+# it under the terms of the GNU Affero General Public License as published
48+# by the Free Software Foundation, either version 3 of the License, or
49+# (at your option) any later version.
50+#
51+# This program is distributed in the hope that it will be useful,
52+# but WITHOUT ANY WARRANTY; without even the implied warranty of
53+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54+# GNU General Public License for more details.
55+#
56+# You should have received a copy of the GNU Affero General Public License
57+# along with this program. If not, see <http://www.gnu.org/licenses/>.
58+#
59+##############################################################################
60+{
61+ 'name': "Multiple validation for budgets",
62+ 'version': '0.1',
63+ 'category': 'Accounting & Finance',
64+ 'complexity': "easy",
65+
66+ 'description': """
67+This module changes the workflow of the budget to allow two extra validation steps.
68+TODO:
69+Allow the user to configure how many steps to add.
70+""",
71+ 'author': 'Agile Business Group & Domsense',
72+ 'website': 'http://www.agilebg.com',
73+ 'license': 'AGPL-3',
74+ "depends" : ['account_budget'],
75+ "init_xml" : [],
76+ "update_xml" : [
77+ 'account_budget_workflow.xml',
78+ 'account_budget_view.xml',
79+ ],
80+ "demo_xml" : [],
81+ 'installable': True,
82+ 'auto_install': False,
83+}
84
85=== added file 'account_budget_multiple_validation/account_budget.py'
86--- account_budget_multiple_validation/account_budget.py 1970-01-01 00:00:00 +0000
87+++ account_budget_multiple_validation/account_budget.py 2012-05-08 14:42:23 +0000
88@@ -0,0 +1,53 @@
89+# -*- coding: utf-8 -*-
90+##############################################################################
91+#
92+# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
93+# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
94+# All Rights Reserved
95+#
96+# This program is free software: you can redistribute it and/or modify
97+# it under the terms of the GNU Affero General Public License as published
98+# by the Free Software Foundation, either version 3 of the License, or
99+# (at your option) any later version.
100+#
101+# This program is distributed in the hope that it will be useful,
102+# but WITHOUT ANY WARRANTY; without even the implied warranty of
103+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
104+# GNU General Public License for more details.
105+#
106+# You should have received a copy of the GNU Affero General Public License
107+# along with this program. If not, see <http://www.gnu.org/licenses/>.
108+#
109+##############################################################################
110+
111+from osv import fields, osv
112+
113+class crossovered_budget(osv.osv):
114+ _inherit = "crossovered.budget"
115+
116+ _columns = {
117+ 'state' : fields.selection([
118+ ('draft','Draft'),
119+ ('confirm','Confirmed'),
120+ ('validate1','Waiting second approval'),
121+ ('validate2','Waiting third approval'),
122+ ('validate','Validated'),
123+ ('done','Done'),
124+ ('cancel', 'Cancelled')], 'Status', select=True, required=True, readonly=True),
125+ 'validating1_user_id': fields.many2one('res.users', 'Pre-Validate 1 User', readonly=True),
126+ 'validating2_user_id': fields.many2one('res.users', 'Pre-Validate 2 User', readonly=True),
127+ }
128+
129+ def budget_validate1(self, cr, uid, ids, *args):
130+ return self.write(cr, uid, ids, {
131+ 'state': 'validate1',
132+ 'validating1_user_id': uid,
133+ })
134+
135+ def budget_validate2(self, cr, uid, ids, *args):
136+ return self.write(cr, uid, ids, {
137+ 'state': 'validate2',
138+ 'validating2_user_id': uid,
139+ })
140+
141+crossovered_budget()
142
143=== added file 'account_budget_multiple_validation/account_budget_view.xml'
144--- account_budget_multiple_validation/account_budget_view.xml 1970-01-01 00:00:00 +0000
145+++ account_budget_multiple_validation/account_budget_view.xml 2012-05-08 14:42:23 +0000
146@@ -0,0 +1,21 @@
147+<?xml version="1.0" encoding="utf-8"?>
148+<openerp>
149+ <data>
150+ <record id="crossovered_budget_view_form" model="ir.ui.view">
151+ <field name="name">crossovered.budget.view.form</field>
152+ <field name="model">crossovered.budget</field>
153+ <field name="type">form</field>
154+ <field name="inherit_id" ref="account_budget.crossovered_budget_view_form"></field>
155+ <field name="arch" type="xml">
156+ <button name="validate" position="replace">
157+ <button string="First approval" name="validate1" states="confirm" type="workflow" icon="gtk-ok"/>
158+ <button string="Second approval" name="validate2" states="validate1" type="workflow" icon="gtk-ok"/>
159+ <button string="Final approval" name="validate" states="validate2" type="workflow" icon="gtk-ok"/>
160+ </button>
161+ <button name="cancel" position="replace" >
162+ <button string="Cancel" name="cancel" states="confirm,validate1,validate2,validate" type="workflow" icon="gtk-cancel"/>
163+ </button>
164+ </field>
165+ </record>
166+ </data>
167+</openerp>
168
169=== added file 'account_budget_multiple_validation/account_budget_workflow.xml'
170--- account_budget_multiple_validation/account_budget_workflow.xml 1970-01-01 00:00:00 +0000
171+++ account_budget_multiple_validation/account_budget_workflow.xml 2012-05-08 14:42:23 +0000
172@@ -0,0 +1,38 @@
173+<?xml version="1.0" encoding="utf-8"?>
174+<openerp>
175+ <data>
176+
177+ <record model="workflow.activity" id="act_validate1">
178+ <field name="wkf_id" ref="account_budget.wkf_crossovered_budget" />
179+ <field name="name">validate1</field>
180+ <field name="kind">function</field>
181+ <field name="action">budget_validate1()</field>
182+ </record>
183+
184+ <record model="workflow.activity" id="act_validate2">
185+ <field name="wkf_id" ref="account_budget.wkf_crossovered_budget" />
186+ <field name="name">validate2</field>
187+ <field name="kind">function</field>
188+ <field name="action">budget_validate2()</field>
189+ </record>
190+
191+ <record model="workflow.transition" id="t7">
192+ <field name="act_from" ref="account_budget.act_confirm" />
193+ <field name="act_to" ref="act_validate1" />
194+ <field name="signal">validate1</field>
195+ </record>
196+
197+ <record model="workflow.transition" id="t8">
198+ <field name="act_from" ref="act_validate1" />
199+ <field name="act_to" ref="act_validate2" />
200+ <field name="signal">validate2</field>
201+ </record>
202+
203+ <record model="workflow.transition" id="account_budget.t2">
204+ <field name="act_from" ref="act_validate2" />
205+ <field name="act_to" ref="account_budget.act_validate" />
206+ <field name="signal">validate</field>
207+ </record>
208+
209+ </data>
210+</openerp>
211
212=== added directory 'account_budget_multiple_validation/i18n'
213=== added file 'account_budget_multiple_validation/i18n/account_budget_multiple_validation.pot'
214--- account_budget_multiple_validation/i18n/account_budget_multiple_validation.pot 1970-01-01 00:00:00 +0000
215+++ account_budget_multiple_validation/i18n/account_budget_multiple_validation.pot 2012-05-08 14:42:23 +0000
216@@ -0,0 +1,52 @@
217+# Translation of OpenERP Server.
218+# This file contains the translation of the following modules:
219+# * account_budget_multiple_validation
220+#
221+msgid ""
222+msgstr ""
223+"Project-Id-Version: OpenERP Server 6.1\n"
224+"Report-Msgid-Bugs-To: \n"
225+"POT-Creation-Date: 2012-05-08 14:28+0000\n"
226+"PO-Revision-Date: 2012-05-08 14:28+0000\n"
227+"Last-Translator: <>\n"
228+"Language-Team: \n"
229+"MIME-Version: 1.0\n"
230+"Content-Type: text/plain; charset=UTF-8\n"
231+"Content-Transfer-Encoding: \n"
232+"Plural-Forms: \n"
233+
234+#. module: account_budget_multiple_validation
235+#: field:crossovered.budget,validating2_user_id:0
236+msgid "Pre-Validate 2 User"
237+msgstr ""
238+
239+#. module: account_budget_multiple_validation
240+#: view:crossovered.budget:0
241+msgid "Second approval"
242+msgstr ""
243+
244+#. module: account_budget_multiple_validation
245+#: view:crossovered.budget:0
246+msgid "First approval"
247+msgstr ""
248+
249+#. module: account_budget_multiple_validation
250+#: model:ir.model,name:account_budget_multiple_validation.model_crossovered_budget
251+msgid "Budget"
252+msgstr ""
253+
254+#. module: account_budget_multiple_validation
255+#: view:crossovered.budget:0
256+msgid "Final approval"
257+msgstr ""
258+
259+#. module: account_budget_multiple_validation
260+#: view:crossovered.budget:0
261+msgid "Cancel"
262+msgstr ""
263+
264+#. module: account_budget_multiple_validation
265+#: field:crossovered.budget,validating1_user_id:0
266+msgid "Pre-Validate 1 User"
267+msgstr ""
268+
269
270=== added file 'account_budget_multiple_validation/i18n/it.po'
271--- account_budget_multiple_validation/i18n/it.po 1970-01-01 00:00:00 +0000
272+++ account_budget_multiple_validation/i18n/it.po 2012-05-08 14:42:23 +0000
273@@ -0,0 +1,52 @@
274+# Translation of OpenERP Server.
275+# This file contains the translation of the following modules:
276+# * account_budget_multiple_validation
277+#
278+msgid ""
279+msgstr ""
280+"Project-Id-Version: OpenERP Server 6.1\n"
281+"Report-Msgid-Bugs-To: \n"
282+"POT-Creation-Date: 2012-05-08 14:31+0000\n"
283+"PO-Revision-Date: 2012-05-08 14:31+0000\n"
284+"Last-Translator: <>\n"
285+"Language-Team: \n"
286+"MIME-Version: 1.0\n"
287+"Content-Type: text/plain; charset=UTF-8\n"
288+"Content-Transfer-Encoding: \n"
289+"Plural-Forms: \n"
290+
291+#. module: account_budget_multiple_validation
292+#: field:crossovered.budget,validating2_user_id:0
293+msgid "Pre-Validate 2 User"
294+msgstr "Pre-Validate 2 User"
295+
296+#. module: account_budget_multiple_validation
297+#: view:crossovered.budget:0
298+msgid "Second approval"
299+msgstr "Seconda approvazione"
300+
301+#. module: account_budget_multiple_validation
302+#: view:crossovered.budget:0
303+msgid "First approval"
304+msgstr "Prima approvazione"
305+
306+#. module: account_budget_multiple_validation
307+#: model:ir.model,name:account_budget_multiple_validation.model_crossovered_budget
308+msgid "Budget"
309+msgstr "Budget"
310+
311+#. module: account_budget_multiple_validation
312+#: view:crossovered.budget:0
313+msgid "Final approval"
314+msgstr "Approvazione finale"
315+
316+#. module: account_budget_multiple_validation
317+#: view:crossovered.budget:0
318+msgid "Cancel"
319+msgstr "Annulla"
320+
321+#. module: account_budget_multiple_validation
322+#: field:crossovered.budget,validating1_user_id:0
323+msgid "Pre-Validate 1 User"
324+msgstr "Pre-Validate 1 User"
325+

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: