Merge lp:~dr.dran/domsense-agilebg-addons/account_analytics_deferred_6_0 into lp:domsense-agilebg-addons/6.1

Proposed by Franco Tampieri
Status: Rejected
Rejected by: Lorenzo Battistini
Proposed branch: lp:~dr.dran/domsense-agilebg-addons/account_analytics_deferred_6_0
Merge into: lp:domsense-agilebg-addons/6.1
Diff against target: 2836 lines (+2445/-2) (has conflicts)
54 files modified
account_analytic_deferred_choice/AUTHORS.txt (+3/-0)
account_analytic_deferred_choice/__init__.py (+23/-0)
account_analytic_deferred_choice/__openerp__.py (+42/-0)
account_analytic_deferred_choice/account_invoice_view.xml (+86/-0)
account_analytic_deferred_choice/analytic.py (+37/-0)
account_analytic_deferred_choice/i18n/it.po (+193/-0)
account_analytic_deferred_choice/invoice.py (+183/-0)
account_analytic_deferred_choice/project_view.xml (+21/-0)
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)
account_move_template/__openerp__.py (+4/-0)
account_move_template/wizard/select_template.py (+34/-2)
account_move_template/wizard/select_template.xml (+9/-0)
analytic_move/AUTHORS.txt (+1/-0)
analytic_move/__init__.py (+22/-0)
analytic_move/__openerp__.py (+40/-0)
analytic_move/analytic.py (+40/-0)
analytic_move/analytic_view.xml (+86/-0)
analytic_move/i18n/it.po (+70/-0)
analytic_move/security/ir.model.access.csv (+2/-0)
hr_expense_analytic_deferred_choice/AUTHORS.txt (+1/-0)
hr_expense_analytic_deferred_choice/__init__.py (+23/-0)
hr_expense_analytic_deferred_choice/__openerp__.py (+42/-0)
hr_expense_analytic_deferred_choice/analytic.py (+34/-0)
hr_expense_analytic_deferred_choice/hr_expense.py (+116/-0)
hr_expense_analytic_deferred_choice/hr_expense_view.xml (+37/-0)
hr_expense_analytic_deferred_choice/i18n/it.po (+140/-0)
hr_expense_analytic_deferred_choice/project_view.xml (+18/-0)
project_issue_customer_view/project_issue_menu.xml (+6/-0)
purchase_analytic_deferred_choice/AUTHORS.txt (+1/-0)
purchase_analytic_deferred_choice/__init__.py (+23/-0)
purchase_analytic_deferred_choice/__openerp__.py (+42/-0)
purchase_analytic_deferred_choice/analytic.py (+34/-0)
purchase_analytic_deferred_choice/i18n/it.po (+150/-0)
purchase_analytic_deferred_choice/project_view.xml (+18/-0)
purchase_analytic_deferred_choice/purchase_order.py (+116/-0)
purchase_analytic_deferred_choice/purchase_order_view.xml (+38/-0)
sale_double_validation/AUTHORS.txt (+1/-0)
sale_double_validation/__init__.py (+22/-0)
sale_double_validation/__openerp__.py (+41/-0)
sale_double_validation/i18n/it.po (+58/-0)
sale_double_validation/sale.py (+46/-0)
sale_double_validation/sale_view.xml (+20/-0)
sale_double_validation/sale_workflow.xml (+31/-0)
super_calendar/AUTHORS.txt (+1/-0)
super_calendar/__init__.py (+22/-0)
super_calendar/__openerp__.py (+46/-0)
super_calendar/cron_data.xml (+13/-0)
super_calendar/security/ir.model.access.csv (+4/-0)
super_calendar/super_calendar.py (+116/-0)
super_calendar/super_calendar_view.xml (+135/-0)
Conflict adding file account_analytic_deferred_choice.  Moved existing file to account_analytic_deferred_choice.moved.
Conflict adding file account_analytic_distribution_menu.  Moved existing file to account_analytic_distribution_menu.moved.
Text conflict in account_move_template/__openerp__.py
Text conflict in account_move_template/wizard/select_template.py
Text conflict in account_move_template/wizard/select_template.xml
Conflict adding file analytic_move.  Moved existing file to analytic_move.moved.
Conflict adding file hr_expense_analytic_deferred_choice.  Moved existing file to hr_expense_analytic_deferred_choice.moved.
Conflict adding file project_issue_customer_view/data.  Moved existing file to project_issue_customer_view/data.moved.
Text conflict in project_issue_customer_view/project_issue_menu.xml
Conflict adding file purchase_analytic_deferred_choice.  Moved existing file to purchase_analytic_deferred_choice.moved.
Conflict adding file sale_double_validation.  Moved existing file to sale_double_validation.moved.
Conflict adding file super_calendar.  Moved existing file to super_calendar.moved.
To merge this branch: bzr merge lp:~dr.dran/domsense-agilebg-addons/account_analytics_deferred_6_0
Reviewer Review Type Date Requested Status
Lorenzo Battistini Disapprove
Leonardo Pistone (community) Disapprove
Review via email: mp+105053@code.launchpad.net

Description of the change

Modificato il modulo account_analytics_deferred_choice in modo da poter associale la medesima funzione alle account.move e alle account.move.lines

To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) wrote :

Conflicts, let's do that again )

review: Disapprove
139. By Franco Tampieri

[Fix] A problem on the enrty lines view
[Add] The possibility to add an entry line without an account deferred_analytics_id that didn't permit to the system to raise a exception

Revision history for this message
Lorenzo Battistini (elbati) wrote :

It has been proposed to be merged into lp:domsense-agilebg-addons while should be lp:domsense-agilebg-addons/6.0 I think

review: Disapprove
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Unmerged revisions

139. By Franco Tampieri

[Fix] A problem on the enrty lines view
[Add] The possibility to add an entry line without an account deferred_analytics_id that didn't permit to the system to raise a exception

138. By Franco Tampieri

[Fix] Corretti bugs minori di interfaccia

137. By Franco Tampieri

[ADD] Added the deferred Analytic choice to the account.move and account move.line

136. By Lorenzo Battistini

[MERGE] aggiunto il partner nel wizard di scelta del template per inserirlo nei move generati

135. By Franco Tampieri <email address hidden>

Added menu icons

134. By Lorenzo Battistini

[ADD] sale_double_validation

133. By Lorenzo Battistini

[FIX] avoiding record creation when missing required fields

132. By Lorenzo Battistini

[FIX] super_calendar constraint

131. By Lorenzo Battistini

[ADD] account_analytic_deferred_choice analytic_move hr_expense_analytic_deferred_choice purchase_analytic_deferred_choice

130. By Lorenzo Battistini

[FIX] confusing menu items

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'account_analytic_deferred_choice'
=== renamed directory 'account_analytic_deferred_choice' => 'account_analytic_deferred_choice.moved'
=== added file 'account_analytic_deferred_choice/AUTHORS.txt'
--- account_analytic_deferred_choice/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ account_analytic_deferred_choice/AUTHORS.txt 2012-05-21 16:22:21 +0000
@@ -0,0 +1,3 @@
1Lorenzo Battistini <lorenzo.battistini@agilebg.com>
2Leonardo Pistone <leonardo.pistobe@agilebg.com>
3Franco Tampieri <franco.tampieri@agilebg.com>
04
=== added file 'account_analytic_deferred_choice/__init__.py'
--- account_analytic_deferred_choice/__init__.py 1970-01-01 00:00:00 +0000
+++ account_analytic_deferred_choice/__init__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22import invoice
23import analytic
024
=== added file 'account_analytic_deferred_choice/__openerp__.py'
--- account_analytic_deferred_choice/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_analytic_deferred_choice/__openerp__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{
23 'name': "Analytic Deferred Choice for Invoices",
24 'version': '0.1',
25 'category': 'Generic Modules/Accounting',
26 'description': """User can assign the invoice amount to one or more analytic accounts, subsequently (or previously) to invoice confirmation.
27 The invoice has a new field, containing the analytic plan to be used. The related button generates tha analytic lines, related to the invoice. The invoice lines have new fields too, containing the analytic plan. If the line's field is not filled, the invoice's one is used.
28 On the invoice form, another button allows to delete the previously generated analytic lines.
29 Every analytic line contains a reference to the invoice line that generated it.""",
30 'author': 'Agile Business Group & Domsense',
31 'website': 'http://www.agilebg.com',
32 'license': 'AGPL-3',
33 "depends" : ['account_analytic_plans'],
34 "init_xml" : [],
35 "update_xml" : [
36 'account_invoice_view.xml',
37 'project_view.xml',
38 ],
39 "demo_xml" : [],
40 "active": False,
41 "installable": True
42}
043
=== added file 'account_analytic_deferred_choice/account_invoice_view.xml'
--- account_analytic_deferred_choice/account_invoice_view.xml 1970-01-01 00:00:00 +0000
+++ account_analytic_deferred_choice/account_invoice_view.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,86 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="invoice_supplier_form" model="ir.ui.view">
5 <field name="name">account.invoice.supplier.form</field>
6 <field name="model">account.invoice</field>
7 <field name="type">form</field>
8 <field name="inherit_id" ref="account.invoice_supplier_form"></field>
9 <field name="arch" type="xml">
10 <field name="move_id" position="after">
11 <group colspan="2" col="4" groups="analytic.group_analytic_accounting">
12 <field name="deferred_analytics_id" domain="[('plan_id','&lt;&gt;',False)]"/>
13 <button name="create_analytic_lines" type="object" string="Create analytic lines" groups="account.group_account_user"/>
14 <button name="delete_analytic_lines" type="object" string="Delete analytic lines" groups="account.group_account_user"/>
15 </group>
16 </field>
17 <page string="Payments" position="after">
18 <page string="Deferred analytic lines" groups="account.group_account_user">
19 <field name="deferred_line_ids" nolabel="1" colspan="4"/>
20 </page>
21 </page>
22 </field>
23 </record>
24
25 <record id="invoice_form" model="ir.ui.view">
26 <field name="name">account.invoice.form</field>
27 <field name="model">account.invoice</field>
28 <field name="type">form</field>
29 <field name="inherit_id" ref="account.invoice_form"></field>
30 <field name="arch" type="xml">
31 <field name="move_id" position="after">
32 <group colspan="2" col="4" groups="analytic.group_analytic_accounting">
33 <field name="deferred_analytics_id" domain="[('plan_id','&lt;&gt;',False)]"/>
34 <button name="create_analytic_lines" type="object" string="Create analytic lines" groups="account.group_account_user"/>
35 <button name="delete_analytic_lines" type="object" string="Delete analytic lines" groups="account.group_account_user"/>
36 </group>
37 </field>
38 <page string="Payments" position="after">
39 <page string="Deferred analytic lines" groups="account.group_account_user">
40 <field name="deferred_line_ids" nolabel="1" colspan="4"/>
41 </page>
42 </page>
43 </field>
44 </record>
45
46 <record id="view_invoice_line_form" model="ir.ui.view">
47 <field name="name">account.invoice.line.form</field>
48 <field name="model">account.invoice.line</field>
49 <field name="type">form</field>
50 <field name="inherit_id" ref="account_analytic_plans.view_invoice_line_form_inherit"></field>
51 <field name="arch" type="xml">
52 <field name="analytics_id" position="after">
53 <field name="deferred_analytics_id" groups="analytic.group_analytic_accounting" domain="[('plan_id','&lt;&gt;',False)]"/>
54 </field>
55 </field>
56 </record>
57
58 <record id="account_move_deferred_form" model="ir.ui.view">
59 <field name="name">account.move.deferred.form</field>
60 <field name="model">account.move</field>
61 <field name="type">form</field>
62 <field name="inherit_id" ref="account.view_move_form"></field>
63 <field name="arch" type="xml">
64 <xpath expr="/form/notebook/page[@string='Journal Items']/field[@name='line_id']/form/notebook/page[@string='Information']/group/field[@name='analytic_account_id']" position="after">
65 <field name="deferred_analytics_id" groups="analytic.group_analytic_accounting" domain="[('plan_id','&lt;&gt;',False)]"/>
66 </xpath>
67 <xpath expr="/form/notebook/page[@string='Journal Items']/field[@name='line_id']/tree/field[@name='analytic_account_id']" position="after">
68 <field name="deferred_analytics_id" groups="analytic.group_analytic_accounting" domain="[('plan_id','&lt;&gt;',False)]"/>
69 </xpath>
70 <page string="Journal Items" position="after">
71 <page string="Deferred analytic lines" groups="account.group_account_user">
72 <group colspan="2" col="4" groups="analytic.group_analytic_accounting">
73 <field name="deferred_analytics_id" domain="[('plan_id','&lt;&gt;',False)]"/>
74 <button name="create_analytic_lines" type="object" string="Create analytic lines" groups="account.group_account_user"/>
75 <button name="delete_analytic_lines" type="object" string="Delete analytic lines" groups="account.group_account_user"/>
76 </group>
77 <newline/>
78 <field name="deferred_line_ids" nolabel="1" colspan="4"/>
79 </page>
80 </page>
81 </field>
82 </record>
83
84
85 </data>
86</openerp>
087
=== added file 'account_analytic_deferred_choice/analytic.py'
--- account_analytic_deferred_choice/analytic.py 1970-01-01 00:00:00 +0000
+++ account_analytic_deferred_choice/analytic.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,37 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24
25class account_analytic_line(osv.osv):
26 _inherit = 'account.analytic.line'
27
28 _columns = {
29 'deferred_invoice_line_id': fields.many2one('account.invoice.line', 'Invoice Line', readonly=True),
30 'deferred_invoice_id': fields.related('deferred_invoice_line_id', 'invoice_id', type="many2one",
31 relation="account.invoice", string="Invoice", store=False, readonly=True),
32 'deferred_account_move_line_id': fields.many2one('account.move.line', 'Account Entry Line', readonly=True),
33 'deferred_account_move_id': fields.related('deferred_account_move_line_id', 'move_id', type="many2one",
34 relation="account.move", string="Account Entry", store=False, readonly=True),
35 }
36
37account_analytic_line()
038
=== added directory 'account_analytic_deferred_choice/i18n'
=== added file 'account_analytic_deferred_choice/i18n/it.mo'
1Binary files account_analytic_deferred_choice/i18n/it.mo 1970-01-01 00:00:00 +0000 and account_analytic_deferred_choice/i18n/it.mo 2012-05-21 16:22:21 +0000 differ39Binary files account_analytic_deferred_choice/i18n/it.mo 1970-01-01 00:00:00 +0000 and account_analytic_deferred_choice/i18n/it.mo 2012-05-21 16:22:21 +0000 differ
=== added file 'account_analytic_deferred_choice/i18n/it.po'
--- account_analytic_deferred_choice/i18n/it.po 1970-01-01 00:00:00 +0000
+++ account_analytic_deferred_choice/i18n/it.po 2012-05-21 16:22:21 +0000
@@ -0,0 +1,193 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_analytic_deferred_choice
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.4\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2012-05-08 08:09+0000\n"
10"PO-Revision-Date: 2012-05-08 10:24+0100\n"
11"Last-Translator: Franco Tampieri <info@francotampieri.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: account_analytic_deferred_choice
19#: constraint:account.move:0
20msgid "You cannot create entries on different periods/journals in the same move"
21msgstr "Non si possono creare scritture in sezionali differenti con una stessa registrazione."
22
23#. module: account_analytic_deferred_choice
24#: view:account.invoice:0
25#: view:account.move:0
26msgid "Create analytic lines"
27msgstr "Crea righe analitiche"
28
29#. module: account_analytic_deferred_choice
30#: code:addons/account_analytic_deferred_choice/invoice.py:69
31#: code:addons/account_analytic_deferred_choice/invoice.py:148
32#, python-format
33msgid "You have to define an analytic journal on the '%s' journal!"
34msgstr "E' necessario definite un giornale analitico per il sezionale '%s'!"
35
36#. module: account_analytic_deferred_choice
37#: code:addons/account_analytic_deferred_choice/invoice.py:63
38#, python-format
39msgid "Analytic lines yet generated for invoice %s. Remove them first"
40msgstr "Righe analitiche già generate per la fattura %s. Rimuoverle prima di crearne altre"
41
42#. module: account_analytic_deferred_choice
43#: code:addons/account_analytic_deferred_choice/invoice.py:142
44#, python-format
45msgid "Analytic lines yet generated for Account Entry %s. Remove them first"
46msgstr "Righe analitiche già generate per il Movimento %s. Rimuoverle prima di crearne altre"
47
48#. module: account_analytic_deferred_choice
49#: model:ir.module.module,description:account_analytic_deferred_choice.module_meta_information
50msgid ""
51"User can assign the invoice amount to one or more analytic accounts, subsequently (or previously) to invoice confirmation.\n"
52" The invoice has a new field, containing the analytic plan to be used. The related button generates tha analytic lines, related to the invoice. The invoice lines have new fields too, containing the analytic plan. If the line's field is not filled, the invoice's one is used.\n"
53" On the invoice form, another button allows to delete the previously generated analytic lines.\n"
54" Every analytic line contains a reference to the invoice line that generated it."
55msgstr ""
56"User can assign the invoice amount to one or more analytic accounts, subsequently (or previously) to invoice confirmation.\n"
57" The invoice has a new field, containing the analytic plan to be used. The related button generates tha analytic lines, related to the invoice. The invoice lines have new fields too, containing the analytic plan. If the line's field is not filled, the invoice's one is used.\n"
58" On the invoice form, another button allows to delete the previously generated analytic lines.\n"
59" Every analytic line contains a reference to the invoice line that generated it."
60
61#. module: account_analytic_deferred_choice
62#: model:ir.model,name:account_analytic_deferred_choice.model_account_analytic_line
63msgid "Analytic Line"
64msgstr "Linea conto analitico"
65
66#. module: account_analytic_deferred_choice
67#: constraint:account.move.line:0
68msgid "You can not create move line on closed account."
69msgstr "Non si puo' inserire una voce per una registrazione su un conto chiuso."
70
71#. module: account_analytic_deferred_choice
72#: field:account.invoice,deferred_analytics_id:0
73#: field:account.invoice.line,deferred_analytics_id:0
74#: field:account.move,deferred_analytics_id:0
75#: field:account.move.line,deferred_analytics_id:0
76msgid "Deferred Analytic Distribution"
77msgstr "Distribuzione analitica differita"
78
79#. module: account_analytic_deferred_choice
80#: code:addons/account_analytic_deferred_choice/invoice.py:66
81#, python-format
82msgid "Invoice %s and line %s have no Deferred Analytic Distribution"
83msgstr "La fattura %s e la riga %s non hanno una distribuzione analitica differita"
84
85#. module: account_analytic_deferred_choice
86#: model:ir.module.module,shortdesc:account_analytic_deferred_choice.module_meta_information
87msgid "Analytic Deferred Choice for Invoices"
88msgstr "Scelta analitica differita per le fatture"
89
90#. module: account_analytic_deferred_choice
91#: view:account.move:0
92#: model:ir.model,name:account_analytic_deferred_choice.model_account_move_line
93msgid "Journal Items"
94msgstr "Voci sezionale"
95
96#. module: account_analytic_deferred_choice
97#: constraint:account.move.line:0
98msgid "Company must be same for its related account and period."
99msgstr "L'azienda deve essere la stessa per il periodo ed il conto ad essa correlato."
100
101#. module: account_analytic_deferred_choice
102#: code:addons/account_analytic_deferred_choice/invoice.py:145
103#, python-format
104msgid "Account Entry %s and line %s have no Deferred Analytic Distribution"
105msgstr "Il Movimento Sezionale %s e la riga %s non hanno una distribuzione analitica differita"
106
107#. module: account_analytic_deferred_choice
108#: field:account.invoice,deferred_line_ids:0
109#: field:account.invoice.line,deferred_line_ids:0
110#: field:account.move,deferred_line_ids:0
111#: field:account.move.line,deferred_line_ids:0
112msgid "Analytic Lines"
113msgstr "Righe analitiche"
114
115#. module: account_analytic_deferred_choice
116#: constraint:account.move:0
117#: constraint:account.move.line:0
118msgid "The date of your Journal Entry is not in the defined period!"
119msgstr "La data del Movimento Sezionale non è inclusa nel periodo definito!"
120
121#. module: account_analytic_deferred_choice
122#: field:account.analytic.line,deferred_account_move_line_id:0
123msgid "Account Entry Line"
124msgstr "Linea Movimento Sezionale"
125
126#. module: account_analytic_deferred_choice
127#: constraint:account.move:0
128msgid "You cannot create more than one move per period on centralized journal"
129msgstr "Non si puo' creare piu' di un movimento per periodo su un sezionale centralizzato"
130
131#. module: account_analytic_deferred_choice
132#: sql_constraint:account.move.line:0
133msgid "Wrong credit or debit value in accounting entry !"
134msgstr "Valore di credito o debito errato nella registrazione contabile !"
135
136#. module: account_analytic_deferred_choice
137#: view:account.invoice:0
138msgid "Payments"
139msgstr "Pagamenti"
140
141#. module: account_analytic_deferred_choice
142#: code:addons/account_analytic_deferred_choice/invoice.py:62
143#: code:addons/account_analytic_deferred_choice/invoice.py:66
144#: code:addons/account_analytic_deferred_choice/invoice.py:141
145#: code:addons/account_analytic_deferred_choice/invoice.py:145
146#, python-format
147msgid "Error"
148msgstr "Errore"
149
150#. module: account_analytic_deferred_choice
151#: view:account.invoice:0
152#: view:account.move:0
153msgid "Deferred analytic lines"
154msgstr "Righe analitiche differite"
155
156#. module: account_analytic_deferred_choice
157#: view:account.invoice:0
158#: view:account.move:0
159msgid "Delete analytic lines"
160msgstr "Rimuovi righe analitiche"
161
162#. module: account_analytic_deferred_choice
163#: view:account.analytic.line:0
164#: field:account.analytic.line,deferred_account_move_id:0
165#: model:ir.model,name:account_analytic_deferred_choice.model_account_move
166msgid "Account Entry"
167msgstr "Movimento Sezionale"
168
169#. module: account_analytic_deferred_choice
170#: code:addons/account_analytic_deferred_choice/invoice.py:69
171#: code:addons/account_analytic_deferred_choice/invoice.py:148
172#, python-format
173msgid "No Analytic Journal !"
174msgstr "Nessun giornale analitico!"
175
176#. module: account_analytic_deferred_choice
177#: field:account.analytic.line,deferred_invoice_line_id:0
178#: model:ir.model,name:account_analytic_deferred_choice.model_account_invoice_line
179msgid "Invoice Line"
180msgstr "Riga fattura"
181
182#. module: account_analytic_deferred_choice
183#: view:account.analytic.line:0
184#: field:account.analytic.line,deferred_invoice_id:0
185#: model:ir.model,name:account_analytic_deferred_choice.model_account_invoice
186msgid "Invoice"
187msgstr "Fattura"
188
189#. module: account_analytic_deferred_choice
190#: constraint:account.move.line:0
191msgid "You can not create move line on view account."
192msgstr "Non si possono inserire movimenti in un conto di tipo \"vista\""
193
0194
=== added file 'account_analytic_deferred_choice/invoice.py'
--- account_analytic_deferred_choice/invoice.py 1970-01-01 00:00:00 +0000
+++ account_analytic_deferred_choice/invoice.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,183 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24from tools.translate import _
25from osv import orm
26
27class account_invoice(osv.osv):
28
29 _inherit = 'account.invoice'
30
31 def _get_deferred_analytic_lines(self, cr, uid, ids, field_name, arg, context=None):
32 res={}
33 for invoice in self.browse(cr, uid, ids):
34 analytic_lines = []
35 for line in invoice.invoice_line:
36 try:
37 if line.deferred_line_ids:
38 analytic_lines.extend([x.id for x in line.deferred_line_ids])
39 except orm.except_orm, e:
40 if e.name != 'AccessError':
41 raise e
42 res[invoice.id] = analytic_lines
43 return res
44
45 _columns={
46 'deferred_analytics_id': fields.many2one('account.analytic.plan.instance', 'Deferred Analytic Distribution'),
47 'deferred_line_ids': fields.function(_get_deferred_analytic_lines, type='one2many', obj='account.analytic.line', method=True, string='Analytic Lines'),
48 }
49
50 def delete_analytic_lines(self, cr, uid, ids, context=None):
51 analytic_line_obj = self.pool.get('account.analytic.line')
52 for invoice in self.browse(cr, uid, ids):
53 for line in invoice.deferred_line_ids:
54 line.unlink()
55 return True
56
57 def create_analytic_lines(self, cr, uid, ids, context=None):
58 analytic_line_obj = self.pool.get('account.analytic.line')
59 invoice_line_obj = self.pool.get('account.invoice.line')
60 for invoice in self.browse(cr, uid, ids):
61 if invoice.deferred_line_ids:
62 raise osv.except_osv(_('Error'),
63 _('Analytic lines yet generated for invoice %s. Remove them first') % invoice.name)
64 for inv_line in invoice.invoice_line:
65 if not inv_line.deferred_analytics_id and not invoice.deferred_analytics_id:
66 raise osv.except_osv(_('Error'),_('Invoice %s and line %s have no Deferred Analytic Distribution')
67 % (invoice.name or '', inv_line.name))
68 if not invoice.journal_id.analytic_journal_id:
69 raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (invoice.journal_id.name,))
70 if inv_line.deferred_analytics_id:
71 deferred_analytics_id = inv_line.deferred_analytics_id
72 else:
73 deferred_analytics_id = invoice.deferred_analytics_id
74 for plan_line in deferred_analytics_id.account_ids:
75 amount = inv_line.price_subtotal * (plan_line.rate / 100)
76 if invoice.type in ('in_invoice', 'out_refund'):
77 amount = - amount
78 al_vals={
79 'name': inv_line.name,
80 'account_id': plan_line.analytic_account_id.id,
81 'unit_amount': inv_line.quantity,
82 'product_id': inv_line.product_id and inv_line.product_id.id or False,
83 'product_uom_id': inv_line.uos_id and inv_line.uos_id.id or False,
84 'amount': amount,
85 'journal_id': invoice.journal_id.analytic_journal_id.id,
86 'percentage': plan_line.rate,
87 'deferred_invoice_line_id': inv_line.id,
88 'general_account_id': inv_line.account_id.id,
89 }
90 al_id = analytic_line_obj.create(cr, uid, al_vals, context=context)
91 return True
92
93account_invoice()
94
95class account_invoice_line(osv.osv):
96
97 _inherit = 'account.invoice.line'
98
99 _columns={
100 # TODO is it possible to have editable?
101 'deferred_analytics_id': fields.many2one('account.analytic.plan.instance', 'Deferred Analytic Distribution'),
102 'deferred_line_ids': fields.one2many('account.analytic.line', 'deferred_invoice_line_id', 'Analytic Lines'),
103 }
104
105account_invoice_line()
106
107class account_move(osv.osv):
108
109 _inherit = 'account.move'
110
111 def _get_deferred_analytic_lines(self, cr, uid, ids, field_name, arg, context=None):
112 res={}
113 for move in self.browse(cr, uid, ids):
114 analytic_lines = []
115 for line in move.line_id:
116 try:
117 if line.deferred_line_ids:
118 analytic_lines.extend([x.id for x in line.deferred_line_ids])
119 except orm.except_orm, e:
120 if e.name != 'AccessError':
121 raise e
122 res[move.id] = analytic_lines
123 return res
124
125 _columns={
126 'deferred_analytics_id': fields.many2one('account.analytic.plan.instance', 'Deferred Analytic Distribution'),
127 'deferred_line_ids': fields.function(_get_deferred_analytic_lines, type='one2many', obj='account.analytic.line', method=True, string='Analytic Lines'),
128 }
129
130 def delete_analytic_lines(self, cr, uid, ids, context=None):
131 analytic_line_obj = self.pool.get('account.analytic.line')
132 for move in self.browse(cr, uid, ids):
133 for line in move.deferred_line_ids:
134 line.unlink()
135 return True
136
137 def create_analytic_lines(self, cr, uid, ids, context=None):
138 analytic_line_obj = self.pool.get('account.analytic.line')
139 for move in self.browse(cr, uid, ids):
140 if move.deferred_line_ids:
141 raise osv.except_osv(_('Error'),
142 _('Analytic lines yet generated for Account Entry %s. Remove them first') % move.name)
143 for move_line in move.line_id:
144 if not move_line.deferred_analytics_id and not move.deferred_analytics_id:
145 continue
146 if not move.journal_id.analytic_journal_id:
147 raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (invoice.journal_id.name,))
148 if move_line.deferred_analytics_id:
149 deferred_analytics_id = move_line.deferred_analytics_id
150 else:
151 deferred_analytics_id = move.deferred_analytics_id
152 for plan_line in deferred_analytics_id.account_ids:
153 if move_line.credit:
154 amount = move_line.credit * (plan_line.rate / 100)
155 if move_line.debit:
156 amount = - move_line.debit * (plan_line.rate / 100)
157 al_vals={
158 'name': move_line.name,
159 'account_id': plan_line.analytic_account_id.id,
160 'unit_amount': False,
161 'product_id': False,
162 'product_uom_id': False,
163 'amount': amount,
164 'journal_id': move.journal_id.analytic_journal_id.id,
165 'percentage': plan_line.rate,
166 'deferred_account_move_line_id': move_line.id,
167 'general_account_id': move_line.account_id.id,
168 }
169 al_id = analytic_line_obj.create(cr, uid, al_vals, context=context)
170 return True
171
172account_move()
173
174class account_move_line(osv.osv):
175
176 _inherit = 'account.move.line'
177
178 _columns={
179 'deferred_analytics_id': fields.many2one('account.analytic.plan.instance', 'Deferred Analytic Distribution'),
180 'deferred_line_ids': fields.one2many('account.analytic.line', 'deferred_account_move_line_id', 'Analytic Lines'),
181 }
182
183account_move_line()
0\ No newline at end of file184\ No newline at end of file
1185
=== added file 'account_analytic_deferred_choice/project_view.xml'
--- account_analytic_deferred_choice/project_view.xml 1970-01-01 00:00:00 +0000
+++ account_analytic_deferred_choice/project_view.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,21 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_account_analytic_line_form" model="ir.ui.view">
5 <field name="name">account.analytic.line.form</field>
6 <field name="model">account.analytic.line</field>
7 <field name="type">form</field>
8 <field name="inherit_id" ref="account.view_account_analytic_line_form"></field>
9 <field name="arch" type="xml">
10 <field name="move_id" position="after">
11 <separator colspan="2" string="Invoice"/>
12 <field name="deferred_invoice_id"/>
13 <field name="deferred_invoice_line_id"/>
14 <separator colspan="2" string="Account Entry"/>
15 <field name="deferred_account_move_id"/>
16 <field name="deferred_account_move_line_id"/>
17 </field>
18 </field>
19 </record>
20 </data>
21</openerp>
022
=== added directory 'account_analytic_distribution_menu'
=== renamed directory 'account_analytic_distribution_menu' => 'account_analytic_distribution_menu.moved'
=== added file 'account_analytic_distribution_menu/AUTHORS.txt'
--- account_analytic_distribution_menu/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ account_analytic_distribution_menu/AUTHORS.txt 2012-05-21 16:22:21 +0000
@@ -0,0 +1,2 @@
1Leonardo Pistone <leonardo.pistone@domsense.com>
2Lorenzo Battistini <lorenzo.battistini@domsense.com>
03
=== added file 'account_analytic_distribution_menu/__init__.py'
--- account_analytic_distribution_menu/__init__.py 1970-01-01 00:00:00 +0000
+++ account_analytic_distribution_menu/__init__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22import account_analytic_plans
023
=== added file 'account_analytic_distribution_menu/__openerp__.py'
--- account_analytic_distribution_menu/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_analytic_distribution_menu/__openerp__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,43 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{
23 'name': "Account Analytic Distribution Menu",
24 'version': '0.1',
25 'category' : 'Accounting & Finance',
26 'complexity': "easy",
27 'description': """
28Account Analytic Distribution Menu
29
30This little module adds a menuitem to see all the analytic distributions
31in the system""",
32 'author': 'Agile Business Group & Domsense',
33 'website': 'http://www.agilebg.com',
34 'license': 'AGPL-3',
35 "depends" : ['account_analytic_plans'],
36 "init_xml" : [],
37 "update_xml" : [
38 'account_distribution.xml',
39 ],
40 "demo_xml" : [],
41 "active": False,
42 "installable": True
43}
044
=== added file 'account_analytic_distribution_menu/account_analytic_plans.py'
--- account_analytic_distribution_menu/account_analytic_plans.py 1970-01-01 00:00:00 +0000
+++ account_analytic_distribution_menu/account_analytic_plans.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,37 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24
25class account_analytic_plan_instance(osv.osv):
26
27 _inherit = "account.analytic.plan.instance"
28
29 def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
30 if context is None:
31 context = {}
32 this = self.browse(cr, uid, ids[0], context=context)
33 if this.plan_id and not vals.has_key('plan_id'):
34 vals['plan_id'] = this.plan_id.id
35 return super(account_analytic_plan_instance, self).write(cr, uid, ids, vals, context=context)
36
37account_analytic_plan_instance()
038
=== added file 'account_analytic_distribution_menu/account_distribution.xml'
--- account_analytic_distribution_menu/account_distribution.xml 1970-01-01 00:00:00 +0000
+++ account_analytic_distribution_menu/account_distribution.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,50 @@
1<?xml version="1.0"?>
2<openerp>
3<data>
4
5 <record model="ir.ui.view" id="account_analytic_plan_instance_form">
6 <field name="name">account.analytic.plan.instance.form</field>
7 <field name="model">account.analytic.plan.instance</field>
8 <field name="type">form</field>
9 <field name="inherit_id" ref="account_analytic_plans.account_analytic_plan_instance_form"></field>
10 <field name="arch" type="xml">
11 <field name="account_ids" nolabel="1" colspan="4" position="replace">
12 <field name="account_ids" nolabel="1" colspan="4" />
13 </field>
14 </field>
15 </record>
16
17 <record model="ir.ui.view" id="account_analytic_plan_instance_line_form">
18 <field name="name">account.analytic.plan.instance.line.form</field>
19 <field name="model">account.analytic.plan.instance.line</field>
20 <field name="type">form</field>
21 <field name="inherit_id" ref="account_analytic_plans.account_analytic_plan_instance_line_form"></field>
22 <field name="arch" type="xml">
23 <field name="plan_id" position="replace"/>
24 </field>
25 </record>
26
27 <record model="ir.ui.view" id="account_analytic_plan_instance_line_tree">
28 <field name="name">account.analytic.plan.instance.line.tree</field>
29 <field name="model">account.analytic.plan.instance.line</field>
30 <field name="inherit_id" ref="account_analytic_plans.account_analytic_plan_instance_line_tree"></field>
31 <field name="type">tree</field>
32 <field name="arch" type="xml">
33 <field name="plan_id" position="replace"/>
34 </field>
35 </record>
36
37 <record model="ir.actions.act_window" id="account_analytic_plan_instance_action">
38 <field name="name">Analytic Distribution's Models</field>
39 <field name="type">ir.actions.act_window</field>
40 <field name="res_model">account.analytic.plan.instance</field>
41 <field name="view_type">form</field>
42 <field name="view_mode">tree,form</field>
43 </record>
44
45 <menuitem
46 parent="account_analytic_plans.menu_account_analytic_multi_plan_action"
47 id="menu_account_analytic_plan_instance"
48 action="account_analytic_plan_instance_action"/>
49</data>
50</openerp>
051
=== modified file 'account_invoice_template/account_invoice_template.py'
=== modified file 'account_move_template/__openerp__.py'
--- account_move_template/__openerp__.py 2012-02-18 10:13:35 +0000
+++ account_move_template/__openerp__.py 2012-05-21 16:22:21 +0000
@@ -33,7 +33,11 @@
33 'author': 'Agile Business Group & Domsense',33 'author': 'Agile Business Group & Domsense',
34 'website': 'http://www.agilebg.com',34 'website': 'http://www.agilebg.com',
35 'license': 'AGPL-3',35 'license': 'AGPL-3',
36<<<<<<< TREE
36 "depends" : ['account_accountant', 'analytic'],37 "depends" : ['account_accountant', 'analytic'],
38=======
39 "depends" : ['account_accountant'],
40>>>>>>> MERGE-SOURCE
37 "init_xml" : [],41 "init_xml" : [],
38 "update_xml" : [42 "update_xml" : [
39 'move_template.xml',43 'move_template.xml',
4044
=== modified file 'account_move_template/wizard/select_template.py'
--- account_move_template/wizard/select_template.py 2012-03-25 09:53:44 +0000
+++ account_move_template/wizard/select_template.py 2012-05-21 16:22:21 +0000
@@ -28,7 +28,12 @@
2828
29 _name = "wizard.select.move.template"29 _name = "wizard.select.move.template"
30 _columns = {30 _columns = {
31<<<<<<< TREE
31 'template_id': fields.many2one('account.move.template', 'Move Template', required=True),'partner_id': fields.many2one('res.partner', 'Partner'),32 'template_id': fields.many2one('account.move.template', 'Move Template', required=True),'partner_id': fields.many2one('res.partner', 'Partner'),
33=======
34 'template_id': fields.many2one('account.move.template', 'Move Template', required=True),
35 'partner_id': fields.many2one('res.partner', 'Partner'),
36>>>>>>> MERGE-SOURCE
32 'line_ids': fields.one2many('wizard.select.move.template.line', 'template_id', 'Lines'),37 'line_ids': fields.one2many('wizard.select.move.template.line', 'template_id', 'Lines'),
33 'state': fields.selection([38 'state': fields.selection([
34 ('template_selected','Template selected'),39 ('template_selected','Template selected'),
@@ -75,11 +80,14 @@
75 template_obj = self.pool.get('account.move.template')80 template_obj = self.pool.get('account.move.template')
76 template_line_obj = self.pool.get('account.move.template.line')81 template_line_obj = self.pool.get('account.move.template.line')
77 account_period_obj = self.pool.get('account.period')82 account_period_obj = self.pool.get('account.period')
78
79
80 mod_obj = self.pool.get('ir.model.data')83 mod_obj = self.pool.get('ir.model.data')
81 wizard = self.browse(cr, uid, ids, context=context)[0]84 wizard = self.browse(cr, uid, ids, context=context)[0]
85<<<<<<< TREE
82 if not template_obj.check_zero_lines(cr, uid, wizard):86 if not template_obj.check_zero_lines(cr, uid, wizard):
87=======
88 partner_id=wizard.partner_id.id
89 if not self.check_zero_lines(cr, uid, wizard):
90>>>>>>> MERGE-SOURCE
83 raise osv.except_osv(_('Error !'), _('At least one amount has to be non-zero!'))91 raise osv.except_osv(_('Error !'), _('At least one amount has to be non-zero!'))
84 input_lines = {}92 input_lines = {}
8593
@@ -96,15 +104,27 @@
96 moves={}104 moves={}
97 for line in wizard.template_id.template_line_ids:105 for line in wizard.template_id.template_line_ids:
98 if line.journal_id.id not in moves:106 if line.journal_id.id not in moves:
107<<<<<<< TREE
99 moves[line.journal_id.id]=self._make_move(108 moves[line.journal_id.id]=self._make_move(
100 cr,uid,wizard.template_id.name,period_id,line.journal_id.id, wizard.partner_id.id)109 cr,uid,wizard.template_id.name,period_id,line.journal_id.id, wizard.partner_id.id)
110=======
111 moves[line.journal_id.id]=self._make_move(cr,uid,wizard.template_id.name,period_id,line.journal_id.id,partner_id)
112>>>>>>> MERGE-SOURCE
101 113
114<<<<<<< TREE
102 id_line=self._make_move_line(cr,uid,line,computed_lines,moves[line.journal_id.id],period_id,115 id_line=self._make_move_line(cr,uid,line,computed_lines,moves[line.journal_id.id],period_id,
103 wizard.partner_id.id)116 wizard.partner_id.id)
117=======
118 id_line=self._make_move_line(cr,uid,line,computed_lines,moves[line.journal_id.id],period_id,partner_id)
119>>>>>>> MERGE-SOURCE
104 if wizard.template_id.cross_journals :120 if wizard.template_id.cross_journals :
105 trans_account_id=wizard.template_id.transitory_acc_id.id121 trans_account_id=wizard.template_id.transitory_acc_id.id
122<<<<<<< TREE
106 id_trans_line=self._make_transitory_move_line(cr,uid,line,computed_lines,123 id_trans_line=self._make_transitory_move_line(cr,uid,line,computed_lines,
107 moves[line.journal_id.id],period_id,trans_account_id, wizard.partner_id.id)124 moves[line.journal_id.id],period_id,trans_account_id, wizard.partner_id.id)
125=======
126 id_trans_line=self._make_transitory_move_line(cr,uid,line,computed_lines,moves[line.journal_id.id],period_id,trans_account_id,partner_id)
127>>>>>>> MERGE-SOURCE
108 128
109 return {129 return {
110 'domain': "[('id','in', "+str(moves.values())+")]",130 'domain': "[('id','in', "+str(moves.values())+")]",
@@ -116,7 +136,11 @@
116 'target': 'current',136 'target': 'current',
117 }137 }
118 #'res_id': moves.values() or False,138 #'res_id': moves.values() or False,
139<<<<<<< TREE
119 def _make_move(self, cr, uid,ref,period_id,journal_id, partner_id):140 def _make_move(self, cr, uid,ref,period_id,journal_id, partner_id):
141=======
142 def _make_move(self, cr, uid,ref,period_id,journal_id,partner_id):
143>>>>>>> MERGE-SOURCE
120 account_move_obj = self.pool.get('account.move')144 account_move_obj = self.pool.get('account.move')
121 move_id = account_move_obj.create(cr, uid, {145 move_id = account_move_obj.create(cr, uid, {
122 'ref': ref,146 'ref': ref,
@@ -126,7 +150,11 @@
126 })150 })
127 return move_id151 return move_id
128 152
153<<<<<<< TREE
129 def _make_move_line(self,cr,uid,line,computed_lines,move_id,period_id, partner_id):154 def _make_move_line(self,cr,uid,line,computed_lines,move_id,period_id, partner_id):
155=======
156 def _make_move_line(self,cr,uid,line,computed_lines,move_id,period_id,partner_id):
157>>>>>>> MERGE-SOURCE
130 account_move_line_obj = self.pool.get('account.move.line')158 account_move_line_obj = self.pool.get('account.move.line')
131 analytic_account_id = False159 analytic_account_id = False
132 if line.analytic_account_id:160 if line.analytic_account_id:
@@ -153,8 +181,12 @@
153 id_line = account_move_line_obj.create(cr, uid, val)181 id_line = account_move_line_obj.create(cr, uid, val)
154 return id_line182 return id_line
155 183
184<<<<<<< TREE
156 def _make_transitory_move_line(185 def _make_transitory_move_line(
157 self,cr,uid,line,computed_lines,move_id,period_id,trans_account_id, partner_id):186 self,cr,uid,line,computed_lines,move_id,period_id,trans_account_id, partner_id):
187=======
188 def _make_transitory_move_line(self,cr,uid,line,computed_lines,move_id,period_id,trans_account_id,partner_id):
189>>>>>>> MERGE-SOURCE
158 account_move_line_obj = self.pool.get('account.move.line')190 account_move_line_obj = self.pool.get('account.move.line')
159 analytic_account_id = False191 analytic_account_id = False
160 if line.analytic_account_id:192 if line.analytic_account_id:
161193
=== modified file 'account_move_template/wizard/select_template.xml'
--- account_move_template/wizard/select_template.xml 2012-03-25 09:53:44 +0000
+++ account_move_template/wizard/select_template.xml 2012-05-21 16:22:21 +0000
@@ -8,6 +8,7 @@
8 <field name="type">form</field>8 <field name="type">form</field>
9 <field name="arch" type="xml">9 <field name="arch" type="xml">
10 <form string="Move Template" >10 <form string="Move Template" >
11<<<<<<< TREE
11 <group col="2" width="600" height="500">12 <group col="2" width="600" height="500">
12 <field name="template_id" attrs="{'invisible':[('state','=','template_selected')]}"/>13 <field name="template_id" attrs="{'invisible':[('state','=','template_selected')]}"/>
13 <field name="partner_id" attrs="{'invisible':[('state','=','template_selected')]}"/>14 <field name="partner_id" attrs="{'invisible':[('state','=','template_selected')]}"/>
@@ -18,6 +19,14 @@
18 <newline/>19 <newline/>
19 <button icon="gtk-cancel" special="cancel" string="Cancel" />20 <button icon="gtk-cancel" special="cancel" string="Cancel" />
20 <field name="state" invisible="1"/>21 <field name="state" invisible="1"/>
22=======
23 <group col="2">
24 <field name="template_id" on_change="on_change_template_id(template_id)"/>
25 <field name="partner_id"/>
26 <field name="line_ids" colspan="2" nolabel="1" width="600" height="500"/>
27 <button icon="gtk-cancel" special="cancel" string="Cancel"/>
28 <button icon="gtk-ok" name="load_template" string="Load" type="object"/>
29>>>>>>> MERGE-SOURCE
21 </group>30 </group>
22 </form>31 </form>
23 </field>32 </field>
2433
=== added directory 'analytic_move'
=== renamed directory 'analytic_move' => 'analytic_move.moved'
=== added file 'analytic_move/AUTHORS.txt'
--- analytic_move/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ analytic_move/AUTHORS.txt 2012-05-21 16:22:21 +0000
@@ -0,0 +1,1 @@
1Lorenzo Battistini <lorenzo.battistini@agilebg.com>
02
=== added file 'analytic_move/__init__.py'
--- analytic_move/__init__.py 1970-01-01 00:00:00 +0000
+++ analytic_move/__init__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22import analytic
023
=== added file 'analytic_move/__openerp__.py'
--- analytic_move/__openerp__.py 1970-01-01 00:00:00 +0000
+++ analytic_move/__openerp__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,40 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{
23 'name': "Analytic Move",
24 'version': '0.1',
25 'category': 'Generic Modules/Accounting',
26 'description': """When user manually creates analytic lines, he is now able to track source and destination of the amounts. That is, if user moves amounts from an account to another, he can see where those amounts come from.
27 This is achieved by the 'analytic move' object, that allows to group analytic lines.""",
28 'author': 'Agile Business Group & Domsense',
29 'website': 'http://www.agilebg.com',
30 'license': 'AGPL-3',
31 "depends" : ['analytic', 'account'],
32 "init_xml" : [],
33 "update_xml" : [
34 'analytic_view.xml',
35 'security/ir.model.access.csv',
36 ],
37 "demo_xml" : [],
38 "active": False,
39 "installable": True
40}
041
=== added file 'analytic_move/analytic.py'
--- analytic_move/analytic.py 1970-01-01 00:00:00 +0000
+++ analytic_move/analytic.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,40 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24
25class account_analytic_move(osv.osv):
26 _name = 'account.analytic.move'
27 _description = 'Analytic Move'
28
29 _columns = {
30 'name': fields.char('Name', size=64, required=True),
31 'line_ids': fields.one2many('account.analytic.line', 'analytic_move_id', 'Analytic Lines'),
32 }
33account_analytic_move()
34
35class account_analytic_line(osv.osv):
36 _inherit = 'account.analytic.line'
37 _columns = {
38 'analytic_move_id': fields.many2one('account.analytic.move', 'Analytic Move'),
39 }
40account_analytic_line()
041
=== added file 'analytic_move/analytic_view.xml'
--- analytic_move/analytic_view.xml 1970-01-01 00:00:00 +0000
+++ analytic_move/analytic_view.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,86 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_account_analytic_line_form" model="ir.ui.view">
5 <field name="name">account.analytic.line.form</field>
6 <field name="model">account.analytic.line</field>
7 <field name="type">form</field>
8 <field name="inherit_id" ref="account.view_account_analytic_line_form"></field>
9 <field name="arch" type="xml">
10 <field name="company_id" position="after">
11 <field name="analytic_move_id"/>
12 </field>
13 </field>
14 </record>
15 <record id="view_account_analytic_line_tree" model="ir.ui.view">
16 <field name="name">account.analytic.line.tree</field>
17 <field name="model">account.analytic.line</field>
18 <field name="type">tree</field>
19 <field name="inherit_id" ref="account.view_account_analytic_line_tree"></field>
20 <field name="arch" type="xml">
21 <field name="user_id" position="after">
22 <field name="analytic_move_id"/>
23 </field>
24 </field>
25 </record>
26
27 <record id="view_account_analytic_move_form" model="ir.ui.view">
28 <field name="name">account.analytic.move.form</field>
29 <field name="model">account.analytic.move</field>
30 <field name="type">form</field>
31 <field name="arch" type="xml">
32 <form string="Analytic Move">
33 <field name="name"/>
34 <newline/>
35 <field name="line_ids" nolabel="1" colspan="4">
36 <tree string="Analytic Entries">
37 <field name="date"/>
38 <field name="name"/>
39 <field name="journal_id"/>
40 <field name="amount" sum="Total"/>
41 <field name="account_id"/>
42 </tree>
43 <form string="Analytic Entry">
44 <group colspan="4" col="6">
45 <field name="name"/>
46 <field name="ref"/>
47 <field name="account_id"/>
48 <field name="journal_id"/>
49 <field name="date"/>
50 <field name="company_id" groups="base.group_multi_company"/>
51 </group>
52 <group colspan="2" col="4">
53 <separator string="Amount" colspan="4"/>
54 <field name="amount" colspan="4"/>
55 <field name="amount_currency" colspan="2"/>
56 <field name="currency_id" colspan="2" nolabel="1"/>
57 </group>
58 </form>
59 </field>
60 </form>
61 </field>
62 </record>
63
64 <record id="view_account_analytic_move_search" model="ir.ui.view">
65 <field name="name">account.analytic.move.search</field>
66 <field name="model">account.analytic.move</field>
67 <field name="type">search</field>
68 <field name="arch" type="xml">
69 <search string="Analytic Moves">
70 <field name="name"/>
71 </search>
72 </field>
73 </record>
74
75 <record id="action_account_analytic_journal_open_form" model="ir.actions.act_window">
76 <field name="name">Analytic Journal Entries</field>
77 <field name="res_model">account.analytic.move</field>
78 <field name="view_type">form</field>
79 <field name="view_mode">tree,form</field>
80 </record>
81 <menuitem groups="analytic.group_analytic_accounting"
82 action="action_account_analytic_journal_open_form"
83 id="account_analytic_journal_entries"
84 parent="account.menu_finance_entries"/>
85 </data>
86</openerp>
087
=== added directory 'analytic_move/i18n'
=== added file 'analytic_move/i18n/it.po'
--- analytic_move/i18n/it.po 1970-01-01 00:00:00 +0000
+++ analytic_move/i18n/it.po 2012-05-21 16:22:21 +0000
@@ -0,0 +1,70 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * analytic_move
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-12-09 10:28+0000\n"
10"PO-Revision-Date: 2011-12-09 11:37+0100\n"
11"Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: analytic_move
19#: view:account.analytic.move:0
20msgid "Total"
21msgstr "Totale"
22
23#. module: analytic_move
24#: model:ir.model,name:analytic_move.model_account_analytic_line
25msgid "Analytic Line"
26msgstr "Voce conto analitico"
27
28#. module: analytic_move
29#: field:account.analytic.move,name:0
30msgid "Name"
31msgstr "Nome"
32
33#. module: analytic_move
34#: field:account.analytic.move,line_ids:0
35msgid "Analytic Lines"
36msgstr "Righe analitiche"
37
38#. module: analytic_move
39#: model:ir.actions.act_window,name:analytic_move.action_account_analytic_journal_open_form
40#: model:ir.ui.menu,name:analytic_move.account_analytic_journal_entries
41msgid "Analytic Journal Entries"
42msgstr "Registrazioni analitiche"
43
44#. module: analytic_move
45#: field:account.analytic.line,analytic_move_id:0
46#: view:account.analytic.move:0
47#: model:ir.model,name:analytic_move.model_account_analytic_move
48msgid "Analytic Move"
49msgstr "Movimento analitico"
50
51#. module: analytic_move
52#: view:account.analytic.move:0
53msgid "Analytic Moves"
54msgstr "Movimenti analitici"
55
56#. module: analytic_move
57#: view:account.analytic.move:0
58msgid "Amount"
59msgstr "Importo"
60
61#. module: analytic_move
62#: view:account.analytic.move:0
63msgid "Analytic Entry"
64msgstr "Registrazione analitica"
65
66#. module: analytic_move
67#: view:account.analytic.move:0
68msgid "Analytic Entries"
69msgstr "Registrazioni analitiche"
70
071
=== added directory 'analytic_move/security'
=== added file 'analytic_move/security/ir.model.access.csv'
--- analytic_move/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ analytic_move/security/ir.model.access.csv 2012-05-21 16:22:21 +0000
@@ -0,0 +1,2 @@
1id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2group_analytic_accounting,group_analytic_accounting,model_account_analytic_move,analytic.group_analytic_accounting,1,1,1,1
03
=== added directory 'hr_expense_analytic_deferred_choice'
=== renamed directory 'hr_expense_analytic_deferred_choice' => 'hr_expense_analytic_deferred_choice.moved'
=== added file 'hr_expense_analytic_deferred_choice/AUTHORS.txt'
--- hr_expense_analytic_deferred_choice/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_deferred_choice/AUTHORS.txt 2012-05-21 16:22:21 +0000
@@ -0,0 +1,1 @@
1Lorenzo Battistini <lorenzo.battistini@agilebg.com>
02
=== added file 'hr_expense_analytic_deferred_choice/__init__.py'
--- hr_expense_analytic_deferred_choice/__init__.py 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_deferred_choice/__init__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22import hr_expense
23import analytic
024
=== added file 'hr_expense_analytic_deferred_choice/__openerp__.py'
--- hr_expense_analytic_deferred_choice/__openerp__.py 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_deferred_choice/__openerp__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{
23 'name': "Analytic Deferred Choice for Expenses",
24 'version': '0.1',
25 'category': 'Generic Modules/Human Resources',
26 'description': """User can assign the expense amount to one or more analytic accounts, subsequently (or previously) to expense confirmation.
27 The expense has a new field, containing the analytic plan to be used. The related button generates tha analytic lines, related to the expense. The expense lines have new fields too, containing the analytic plan. If the line's field is not filled, the expense's one is used.
28 On the expense form, another button allows to delete the previously generated analytic lines.
29 Every analytic line contains a reference to the expense line that generated it.""",
30 'author': 'Agile Business Group & Domsense',
31 'website': 'http://www.agilebg.com',
32 'license': 'AGPL-3',
33 "depends" : ['account_analytic_plans', 'hr_analytic_plans'],
34 "init_xml" : [],
35 "update_xml" : [
36 'hr_expense_view.xml',
37 'project_view.xml',
38 ],
39 "demo_xml" : [],
40 "active": False,
41 "installable": True
42}
043
=== added file 'hr_expense_analytic_deferred_choice/analytic.py'
--- hr_expense_analytic_deferred_choice/analytic.py 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_deferred_choice/analytic.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,34 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24
25class account_analytic_line(osv.osv):
26 _inherit = 'account.analytic.line'
27
28 _columns = {
29 'deferred_expense_line_id': fields.many2one('hr.expense.line', 'Expense Line', readonly=True),
30 'deferred_expense_id': fields.related('deferred_expense_line_id', 'expense_id', type="many2one",
31 relation="hr.expense.expense", string="Expense", store=False, readonly=True),
32 }
33
34account_analytic_line()
035
=== added file 'hr_expense_analytic_deferred_choice/hr_expense.py'
--- hr_expense_analytic_deferred_choice/hr_expense.py 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_deferred_choice/hr_expense.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,116 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24from tools.translate import _
25from osv import orm
26
27class hr_expense(osv.osv):
28
29 _inherit = 'hr.expense.expense'
30
31 def _get_deferred_analytic_lines(self, cr, uid, ids, field_name, arg, context=None):
32 res={}
33 for expense in self.browse(cr, uid, ids):
34 analytic_lines = []
35 for line in expense.line_ids:
36 try:
37 if line.deferred_line_ids:
38 analytic_lines.extend([x.id for x in line.deferred_line_ids])
39 except orm.except_orm, e:
40 if e.name != 'AccessError':
41 raise e
42 res[expense.id] = analytic_lines
43 return res
44
45 _columns={
46 'deferred_analytics_id': fields.many2one('account.analytic.plan.instance', 'Deferred Analytic Distribution'),
47 'deferred_line_ids': fields.function(_get_deferred_analytic_lines, type='one2many',
48 obj='account.analytic.line', method=True, string='Analytic Lines'),
49 }
50
51 def delete_analytic_lines(self, cr, uid, ids, context=None):
52 analytic_line_obj = self.pool.get('account.analytic.line')
53 for expense in self.browse(cr, uid, ids):
54 for line in expense.deferred_line_ids:
55 line.unlink()
56 return True
57
58 def create_analytic_lines(self, cr, uid, ids, context=None):
59 analytic_line_obj = self.pool.get('account.analytic.line')
60 journal_obj = self.pool.get('account.journal')
61 expense_line_obj = self.pool.get('hr.expense.line')
62 for expense in self.browse(cr, uid, ids):
63 journal_ids = journal_obj.search(cr, uid, [
64 ('type', '=','purchase'),('company_id', '=', expense.company_id.id)], limit=1)
65 if not journal_ids:
66 raise osv.except_osv(_('Error !'),
67 _('There is no purchase journal defined for this company: "%s" (id:%d)')
68 % (expense.company_id.name, expensecompany_id.id))
69 journal = journal_obj.browse(cr, uid, journal_ids[0])
70 if not journal.analytic_journal_id:
71 raise osv.except_osv(_('No Analytic Journal !'),
72 _("You have to define an analytic journal on the '%s' journal!") % (journal.name))
73 if not journal.default_debit_account_id:
74 raise osv.except_osv(_('No Debit Account !'),
75 _("You have to define a default debit account on the '%s' journal!") % (journal.name))
76 if expense.deferred_line_ids:
77 raise osv.except_osv(_('Error'),
78 _('Analytic lines yet generated for expense %s. Remove them first') % expense.name)
79 for line in expense.line_ids:
80 if not line.deferred_analytics_id and not expense.deferred_analytics_id:
81 raise osv.except_osv(_('Error'),_('Expense %s and line %s have no Deferred Analytic Distribution')
82 % (expense.name or '', line.name))
83 if line.deferred_analytics_id:
84 deferred_analytics_id = line.deferred_analytics_id
85 else:
86 deferred_analytics_id = expense.deferred_analytics_id
87 for plan_line in deferred_analytics_id.account_ids:
88 amount = - line.total_amount * (plan_line.rate / 100)
89 al_vals={
90 'name': line.name,
91 'account_id': plan_line.analytic_account_id.id,
92 'unit_amount': line.unit_quantity,
93 'product_id': line.product_id and line.product_id.id or False,
94 'product_uom_id': line.uom_id and line.uom_id.id or False,
95 'amount': amount,
96 'journal_id': journal.analytic_journal_id.id,
97 'percentage': plan_line.rate,
98 'deferred_expense_line_id': line.id,
99 'general_account_id': journal.default_debit_account_id.id,
100 }
101 al_id = analytic_line_obj.create(cr, uid, al_vals, context=context)
102 return True
103
104hr_expense()
105
106class hr_expense_line(osv.osv):
107
108 _inherit = 'hr.expense.line'
109
110 _columns={
111 'deferred_analytics_id': fields.many2one('account.analytic.plan.instance', 'Deferred Analytic Distribution'),
112 'deferred_line_ids': fields.one2many('account.analytic.line', 'deferred_expense_line_id',
113 'Analytic Lines'),
114 }
115
116hr_expense_line()
0117
=== added file 'hr_expense_analytic_deferred_choice/hr_expense_view.xml'
--- hr_expense_analytic_deferred_choice/hr_expense_view.xml 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_deferred_choice/hr_expense_view.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,37 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_expenses_form" model="ir.ui.view">
5 <field name="name">hr.expense.form</field>
6 <field name="type">form</field>
7 <field name="model">hr.expense.expense</field>
8 <field name="inherit_id" ref="hr_expense.view_expenses_form"></field>
9 <field name="arch" type="xml">
10 <field name="company_id" position="after">
11 <group colspan="2" col="4" groups="analytic.group_analytic_accounting">
12 <field name="deferred_analytics_id" domain="[('plan_id','&lt;&gt;',False)]"/>
13 <button name="create_analytic_lines" type="object" string="Create analytic lines" groups="account.group_account_user"/>
14 <button name="delete_analytic_lines" type="object" string="Delete analytic lines" groups="account.group_account_user"/>
15 </group>
16 </field>
17 <page string="Other Info" position="after">
18 <page string="Deferred analytic lines" groups="account.group_account_user">
19 <field name="deferred_line_ids" nolabel="1" colspan="4"/>
20 </page>
21 </page>
22 </field>
23 </record>
24 <record id="view_expenses_form_distribution_id" model="ir.ui.view">
25 <field name="name">hr.expense.form.distribution_id</field>
26 <field name="type">form</field>
27 <field name="model">hr.expense.expense</field>
28 <field name="inherit_id" ref="hr_analytic_plans.view_expenses_form"></field>
29 <field name="arch" type="xml">
30 <field name="distribution_id" position="after">
31 <field name="deferred_analytics_id" groups="analytic.group_analytic_accounting" domain="[('plan_id','&lt;&gt;',False)]"/>
32 </field>
33 </field>
34 </record>
35
36 </data>
37</openerp>
038
=== added directory 'hr_expense_analytic_deferred_choice/i18n'
=== added file 'hr_expense_analytic_deferred_choice/i18n/it.po'
--- hr_expense_analytic_deferred_choice/i18n/it.po 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_deferred_choice/i18n/it.po 2012-05-21 16:22:21 +0000
@@ -0,0 +1,140 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * hr_expense_analytic_deferred_choice
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-12-09 10:29+0000\n"
10"PO-Revision-Date: 2011-12-09 11:49+0100\n"
11"Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: hr_expense_analytic_deferred_choice
19#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:70
20#, python-format
21msgid "You have to define a default debit account on the '%s' journal!"
22msgstr "E' necessario definire un conto di debito di default per il sezionale '%s'!"
23
24#. module: hr_expense_analytic_deferred_choice
25#: model:ir.model,name:hr_expense_analytic_deferred_choice.model_account_analytic_line
26msgid "Analytic Line"
27msgstr "Voce conto analitico"
28
29#. module: hr_expense_analytic_deferred_choice
30#: field:account.analytic.line,deferred_expense_line_id:0
31#: model:ir.model,name:hr_expense_analytic_deferred_choice.model_hr_expense_line
32msgid "Expense Line"
33msgstr "Riga spesa"
34
35#. module: hr_expense_analytic_deferred_choice
36#: field:hr.expense.expense,deferred_line_ids:0
37#: field:hr.expense.line,deferred_line_ids:0
38msgid "Analytic Lines"
39msgstr "Righe analitiche"
40
41#. module: hr_expense_analytic_deferred_choice
42#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:66
43#, python-format
44msgid "No Analytic Journal !"
45msgstr "Nessun giornale analitico!"
46
47#. module: hr_expense_analytic_deferred_choice
48#: view:hr.expense.expense:0
49msgid "Other Info"
50msgstr "Altre informazioni"
51
52#. module: hr_expense_analytic_deferred_choice
53#: view:hr.expense.expense:0
54msgid "Create analytic lines"
55msgstr "Crea righe analitiche"
56
57#. module: hr_expense_analytic_deferred_choice
58#: model:ir.module.module,description:hr_expense_analytic_deferred_choice.module_meta_information
59msgid ""
60"User can assign the expense amount to one or more analytic accounts, subsequently (or previously) to expense confirmation.\n"
61" The expense has a new field, containing the analytic plan to be used. The related button generates tha analytic lines, related to the expense. The expense lines have new fields too, containing the analytic plan. If the line's field is not filled, the expense's one is used.\n"
62" On the expense form, another button allows to delete the previously generated analytic lines.\n"
63" Every analytic line contains a reference to the expense line that generated it."
64msgstr ""
65"User can assign the expense amount to one or more analytic accounts, subsequently (or previously) to expense confirmation.\n"
66" The expense has a new field, containing the analytic plan to be used. The related button generates tha analytic lines, related to the expense. The expense lines have new fields too, containing the analytic plan. If the line's field is not filled, the expense's one is used.\n"
67" On the expense form, another button allows to delete the previously generated analytic lines.\n"
68" Every analytic line contains a reference to the expense line that generated it."
69
70#. module: hr_expense_analytic_deferred_choice
71#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:76
72#, python-format
73msgid "Expense %s and line %s have no Deferred Analytic Distribution"
74msgstr "La spesa %s e la riga %s non hanno una distribuzione analitica differita"
75
76#. module: hr_expense_analytic_deferred_choice
77#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:62
78#, python-format
79msgid "There is no purchase journal defined for this company: \"%s\" (id:%d)"
80msgstr "Non c'è un sezionale d'acquisto definito per questa azienda: \"%s\" (id:%d)"
81
82#. module: hr_expense_analytic_deferred_choice
83#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:67
84#, python-format
85msgid "You have to define an analytic journal on the '%s' journal!"
86msgstr "E' necessario definite un giornale analitico per il sezionale '%s'!"
87
88#. module: hr_expense_analytic_deferred_choice
89#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:73
90#, python-format
91msgid "Analytic lines yet generated for expense %s. Remove them first"
92msgstr "Righe analitiche già generate per la fattura %s. Rimuoverle prima di crearne altre"
93
94#. module: hr_expense_analytic_deferred_choice
95#: view:hr.expense.expense:0
96msgid "Delete analytic lines"
97msgstr "Rimuovi righe analitiche"
98
99#. module: hr_expense_analytic_deferred_choice
100#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:72
101#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:76
102#, python-format
103msgid "Error"
104msgstr "Errore"
105
106#. module: hr_expense_analytic_deferred_choice
107#: view:hr.expense.expense:0
108msgid "Deferred analytic lines"
109msgstr "Righe analitiche differite"
110
111#. module: hr_expense_analytic_deferred_choice
112#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:61
113#, python-format
114msgid "Error !"
115msgstr "Errore !"
116
117#. module: hr_expense_analytic_deferred_choice
118#: view:account.analytic.line:0
119#: field:account.analytic.line,deferred_expense_id:0
120#: model:ir.model,name:hr_expense_analytic_deferred_choice.model_hr_expense_expense
121msgid "Expense"
122msgstr "Spesa"
123
124#. module: hr_expense_analytic_deferred_choice
125#: model:ir.module.module,shortdesc:hr_expense_analytic_deferred_choice.module_meta_information
126msgid "Analytic Deferred Choice for Expenses"
127msgstr "Scelta analitica differita per i rimborsi spese"
128
129#. module: hr_expense_analytic_deferred_choice
130#: code:addons/hr_expense_analytic_deferred_choice/hr_expense.py:69
131#, python-format
132msgid "No Debit Account !"
133msgstr "Nessun conto di debito!"
134
135#. module: hr_expense_analytic_deferred_choice
136#: field:hr.expense.expense,deferred_analytics_id:0
137#: field:hr.expense.line,deferred_analytics_id:0
138msgid "Deferred Analytic Distribution"
139msgstr "Distribuzione analitica differita"
140
0141
=== added file 'hr_expense_analytic_deferred_choice/project_view.xml'
--- hr_expense_analytic_deferred_choice/project_view.xml 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_deferred_choice/project_view.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,18 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_account_analytic_line_form" model="ir.ui.view">
5 <field name="name">account.analytic.line.form</field>
6 <field name="model">account.analytic.line</field>
7 <field name="type">form</field>
8 <field name="inherit_id" ref="account.view_account_analytic_line_form"></field>
9 <field name="arch" type="xml">
10 <field name="move_id" position="after">
11 <separator colspan="2" string="Expense"/>
12 <field name="deferred_expense_id"/>
13 <field name="deferred_expense_line_id"/>
14 </field>
15 </field>
16 </record>
17 </data>
18</openerp>
019
=== added directory 'project_issue_customer_view/data'
=== renamed directory 'project_issue_customer_view/data' => 'project_issue_customer_view/data.moved'
=== added file 'project_issue_customer_view/data/tickets-icon-hover.png'
1Binary files project_issue_customer_view/data/tickets-icon-hover.png 1970-01-01 00:00:00 +0000 and project_issue_customer_view/data/tickets-icon-hover.png 2012-05-21 16:22:21 +0000 differ20Binary files project_issue_customer_view/data/tickets-icon-hover.png 1970-01-01 00:00:00 +0000 and project_issue_customer_view/data/tickets-icon-hover.png 2012-05-21 16:22:21 +0000 differ
=== added file 'project_issue_customer_view/data/tickets-icon.png'
2Binary files project_issue_customer_view/data/tickets-icon.png 1970-01-01 00:00:00 +0000 and project_issue_customer_view/data/tickets-icon.png 2012-05-21 16:22:21 +0000 differ21Binary files project_issue_customer_view/data/tickets-icon.png 1970-01-01 00:00:00 +0000 and project_issue_customer_view/data/tickets-icon.png 2012-05-21 16:22:21 +0000 differ
=== modified file 'project_issue_customer_view/project_issue_menu.xml'
--- project_issue_customer_view/project_issue_menu.xml 2012-03-31 15:46:16 +0000
+++ project_issue_customer_view/project_issue_menu.xml 2012-05-21 16:22:21 +0000
@@ -25,9 +25,15 @@
25 <field name="act_window_id" ref="action_project_ticket"/>25 <field name="act_window_id" ref="action_project_ticket"/>
26 </record>26 </record>
2727
28<<<<<<< TREE
28 <menuitem name="Support" id="menu_customer_support"29 <menuitem name="Support" id="menu_customer_support"
29 web_icon="data/tickets-icon.png"30 web_icon="data/tickets-icon.png"
30 web_icon_hover="data/tickets-icon-hover.png" action="action_project_ticket"/>31 web_icon_hover="data/tickets-icon-hover.png" action="action_project_ticket"/>
32=======
33 <menuitem name="Support" id="menu_customer_support"
34 web_icon="data/tickets-icon.png"
35 web_icon_hover="data/tickets-icon-hover.png"/>
36>>>>>>> MERGE-SOURCE
31 <menuitem name="Tickets" id="menu_customer_ticket" parent="menu_customer_support"/>37 <menuitem name="Tickets" id="menu_customer_ticket" parent="menu_customer_support"/>
32 <menuitem name="Tickets" id="menu_customer_ticket_list" parent="menu_customer_ticket"38 <menuitem name="Tickets" id="menu_customer_ticket_list" parent="menu_customer_ticket"
33 action="action_project_ticket" sequence="5"/>39 action="action_project_ticket" sequence="5"/>
3440
=== added directory 'purchase_analytic_deferred_choice'
=== renamed directory 'purchase_analytic_deferred_choice' => 'purchase_analytic_deferred_choice.moved'
=== added file 'purchase_analytic_deferred_choice/AUTHORS.txt'
--- purchase_analytic_deferred_choice/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ purchase_analytic_deferred_choice/AUTHORS.txt 2012-05-21 16:22:21 +0000
@@ -0,0 +1,1 @@
1Lorenzo Battistini <lorenzo.battistini@agilebg.com>
02
=== added file 'purchase_analytic_deferred_choice/__init__.py'
--- purchase_analytic_deferred_choice/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_analytic_deferred_choice/__init__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22import purchase_order
23import analytic
024
=== added file 'purchase_analytic_deferred_choice/__openerp__.py'
--- purchase_analytic_deferred_choice/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_analytic_deferred_choice/__openerp__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{
23 'name': "Analytic Deferred Choice for Purchase Orders",
24 'version': '0.1',
25 'category': 'Generic Modules/Sales & Purchases',
26 'description': """User can assign the invoice amount to one or more analytic accounts, subsequently (or previously) to purchase order confirmation.
27 The purchase order has a new field, containing the analytic plan to be used. The related button generates tha analytic lines, related to the order. The order lines have new fields too, containing the analytic plan. If the line's field is not filled, the order's one is used.
28 On the order form, another button allows to delete the previously generated analytic lines.
29 Every analytic line contains a reference to the order line that generated it.""",
30 'author': 'Agile Business Group & Domsense',
31 'website': 'http://www.agilebg.com',
32 'license': 'AGPL-3',
33 "depends" : ['account_analytic_plans', 'purchase', 'purchase_analytic_plans'],
34 "init_xml" : [],
35 "update_xml" : [
36 'purchase_order_view.xml',
37 'project_view.xml',
38 ],
39 "demo_xml" : [],
40 "active": False,
41 "installable": True
42}
043
=== added file 'purchase_analytic_deferred_choice/analytic.py'
--- purchase_analytic_deferred_choice/analytic.py 1970-01-01 00:00:00 +0000
+++ purchase_analytic_deferred_choice/analytic.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,34 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24
25class account_analytic_line(osv.osv):
26 _inherit = 'account.analytic.line'
27
28 _columns = {
29 'deferred_purchase_order_line_id': fields.many2one('purchase.order.line', 'Purchase Order Line', readonly=True),
30 'deferred_purchase_order_id': fields.related('deferred_purchase_order_line_id', 'order_id', type="many2one",
31 relation="purchase.order", string="Purchase Order", store=False, readonly=True),
32 }
33
34account_analytic_line()
035
=== added directory 'purchase_analytic_deferred_choice/i18n'
=== added file 'purchase_analytic_deferred_choice/i18n/it.po'
--- purchase_analytic_deferred_choice/i18n/it.po 1970-01-01 00:00:00 +0000
+++ purchase_analytic_deferred_choice/i18n/it.po 2012-05-21 16:22:21 +0000
@@ -0,0 +1,150 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * purchase_analytic_deferred_choice
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-12-09 10:28+0000\n"
10"PO-Revision-Date: 2011-12-09 11:47+0100\n"
11"Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: purchase_analytic_deferred_choice
19#: field:account.analytic.line,deferred_purchase_order_line_id:0
20#: model:ir.model,name:purchase_analytic_deferred_choice.model_purchase_order_line
21msgid "Purchase Order Line"
22msgstr "Riga ordine d'acquisto"
23
24#. module: purchase_analytic_deferred_choice
25#: view:purchase.order:0
26msgid "Create analytic lines"
27msgstr "Crea righe analitiche"
28
29#. module: purchase_analytic_deferred_choice
30#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:67
31#, python-format
32msgid "You have to define an analytic journal on the '%s' journal!"
33msgstr "E' necessario definite un giornale analitico per il sezionale '%s'!"
34
35#. module: purchase_analytic_deferred_choice
36#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:70
37#, python-format
38msgid "You have to define a default debit account on the '%s' journal!"
39msgstr "E' necessario definire un conto di debito di default per il sezionale '%s'!"
40
41#. module: purchase_analytic_deferred_choice
42#: model:ir.module.module,shortdesc:purchase_analytic_deferred_choice.module_meta_information
43msgid "Analytic Deferred Choice for Purchase Orders"
44msgstr "Scelta analitica differita per gli ordini d'acquisto"
45
46#. module: purchase_analytic_deferred_choice
47#: sql_constraint:purchase.order:0
48msgid "Order Reference must be unique !"
49msgstr "Il riferimento ordine deve essere unico!"
50
51#. module: purchase_analytic_deferred_choice
52#: model:ir.model,name:purchase_analytic_deferred_choice.model_account_analytic_line
53msgid "Analytic Line"
54msgstr "Voce conto analitico"
55
56#. module: purchase_analytic_deferred_choice
57#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:62
58#, python-format
59msgid "There is no purchase journal defined for this company: \"%s\" (id:%d)"
60msgstr "Non c'è un sezionale d'acquisto definito per questa azienda: \"%s\" (id:%d)"
61
62#. module: purchase_analytic_deferred_choice
63#: field:purchase.order,deferred_analytics_id:0
64#: field:purchase.order.line,deferred_analytics_id:0
65msgid "Deferred Analytic Distribution"
66msgstr "Distribuzione analitica differita"
67
68#. module: purchase_analytic_deferred_choice
69#: view:purchase.order:0
70msgid "Notes"
71msgstr "Note"
72
73#. module: purchase_analytic_deferred_choice
74#: field:purchase.order,deferred_line_ids:0
75#: field:purchase.order.line,deferred_line_ids:0
76msgid "Analytic Lines"
77msgstr "Righe analitiche"
78
79#. module: purchase_analytic_deferred_choice
80#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:73
81#, python-format
82msgid "Analytic lines yet generated for order %s. Remove them first"
83msgstr "Righe analitiche già generate per la fattura %s. Rimuoverle prima di crearne altre"
84
85#. module: purchase_analytic_deferred_choice
86#: view:account.analytic.line:0
87#: field:account.analytic.line,deferred_purchase_order_id:0
88#: model:ir.model,name:purchase_analytic_deferred_choice.model_purchase_order
89msgid "Purchase Order"
90msgstr "Ordine d'acquisto"
91
92#. module: purchase_analytic_deferred_choice
93#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:72
94#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:76
95#, python-format
96msgid "Error"
97msgstr "Errore"
98
99#. module: purchase_analytic_deferred_choice
100#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:61
101#, python-format
102msgid "Error !"
103msgstr "Errore !"
104
105#. module: purchase_analytic_deferred_choice
106#: view:purchase.order:0
107msgid "Deferred analytic lines"
108msgstr "Righe analitiche differite"
109
110#. module: purchase_analytic_deferred_choice
111#: view:purchase.order:0
112msgid "Delete analytic lines"
113msgstr "Rimuovi righe analitiche"
114
115#. module: purchase_analytic_deferred_choice
116#: view:purchase.order:0
117msgid "Analytic lines"
118msgstr "Righe analitiche"
119
120#. module: purchase_analytic_deferred_choice
121#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:66
122#, python-format
123msgid "No Analytic Journal !"
124msgstr "Nessun giornale analitico!"
125
126#. module: purchase_analytic_deferred_choice
127#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:69
128#, python-format
129msgid "No Debit Account !"
130msgstr "Nessun conto di debito!"
131
132#. module: purchase_analytic_deferred_choice
133#: model:ir.module.module,description:purchase_analytic_deferred_choice.module_meta_information
134msgid ""
135"User can assign the invoice amount to one or more analytic accounts, subsequently (or previously) to purchase order confirmation.\n"
136" The purchase order has a new field, containing the analytic plan to be used. The related button generates tha analytic lines, related to the order. The order lines have new fields too, containing the analytic plan. If the line's field is not filled, the order's one is used.\n"
137" On the order form, another button allows to delete the previously generated analytic lines.\n"
138" Every analytic line contains a reference to the order line that generated it."
139msgstr ""
140"User can assign the invoice amount to one or more analytic accounts, subsequently (or previously) to purchase order confirmation.\n"
141" The purchase order has a new field, containing the analytic plan to be used. The related button generates tha analytic lines, related to the order. The order lines have new fields too, containing the analytic plan. If the line's field is not filled, the order's one is used.\n"
142" On the order form, another button allows to delete the previously generated analytic lines.\n"
143" Every analytic line contains a reference to the order line that generated it."
144
145#. module: purchase_analytic_deferred_choice
146#: code:addons/purchase_analytic_deferred_choice/purchase_order.py:76
147#, python-format
148msgid "Order %s and line %s have no Deferred Analytic Distribution"
149msgstr "L'ordine %s e la riga %s non hanno una distribuzione analitica differita"
150
0151
=== added file 'purchase_analytic_deferred_choice/project_view.xml'
--- purchase_analytic_deferred_choice/project_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_analytic_deferred_choice/project_view.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,18 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_account_analytic_line_form" model="ir.ui.view">
5 <field name="name">account.analytic.line.form</field>
6 <field name="model">account.analytic.line</field>
7 <field name="type">form</field>
8 <field name="inherit_id" ref="account.view_account_analytic_line_form"></field>
9 <field name="arch" type="xml">
10 <field name="move_id" position="after">
11 <separator colspan="2" string="Purchase Order"/>
12 <field name="deferred_purchase_order_id"/>
13 <field name="deferred_purchase_order_line_id"/>
14 </field>
15 </field>
16 </record>
17 </data>
18</openerp>
019
=== added file 'purchase_analytic_deferred_choice/purchase_order.py'
--- purchase_analytic_deferred_choice/purchase_order.py 1970-01-01 00:00:00 +0000
+++ purchase_analytic_deferred_choice/purchase_order.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,116 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24from tools.translate import _
25from osv import orm
26
27class purchase_order(osv.osv):
28
29 _inherit = 'purchase.order'
30
31 def _get_deferred_analytic_lines(self, cr, uid, ids, field_name, arg, context=None):
32 res={}
33 for po in self.browse(cr, uid, ids):
34 analytic_lines = []
35 for line in po.order_line:
36 try:
37 if line.deferred_line_ids:
38 analytic_lines.extend([x.id for x in line.deferred_line_ids])
39 except orm.except_orm, e:
40 if e.name != 'AccessError':
41 raise e
42 res[po.id] = analytic_lines
43 return res
44
45 _columns={
46 'deferred_analytics_id': fields.many2one('account.analytic.plan.instance', 'Deferred Analytic Distribution'),
47 'deferred_line_ids': fields.function(_get_deferred_analytic_lines, type='one2many',
48 obj='account.analytic.line', method=True, string='Analytic Lines'),
49 }
50
51 def delete_analytic_lines(self, cr, uid, ids, context=None):
52 analytic_line_obj = self.pool.get('account.analytic.line')
53 for po in self.browse(cr, uid, ids):
54 for line in po.deferred_line_ids:
55 line.unlink()
56 return True
57
58 def create_analytic_lines(self, cr, uid, ids, context=None):
59 analytic_line_obj = self.pool.get('account.analytic.line')
60 journal_obj = self.pool.get('account.journal')
61 po_line_obj = self.pool.get('purchase.order.line')
62 for po in self.browse(cr, uid, ids):
63 journal_ids = journal_obj.search(cr, uid, [
64 ('type', '=','purchase'),('company_id', '=', po.company_id.id)], limit=1)
65 if not journal_ids:
66 raise osv.except_osv(_('Error !'),
67 _('There is no purchase journal defined for this company: "%s" (id:%d)')
68 % (po.company_id.name, po.company_id.id))
69 journal = journal_obj.browse(cr, uid, journal_ids[0])
70 if not journal.analytic_journal_id:
71 raise osv.except_osv(_('No Analytic Journal !'),
72 _("You have to define an analytic journal on the '%s' journal!") % (journal.name))
73 if not journal.default_debit_account_id:
74 raise osv.except_osv(_('No Debit Account !'),
75 _("You have to define a default debit account on the '%s' journal!") % (journal.name))
76 if po.deferred_line_ids:
77 raise osv.except_osv(_('Error'),
78 _('Analytic lines yet generated for order %s. Remove them first') % po.name)
79 for po_line in po.order_line:
80 if not po_line.deferred_analytics_id and not po.deferred_analytics_id:
81 raise osv.except_osv(_('Error'),_('Order %s and line %s have no Deferred Analytic Distribution')
82 % (po.name or '', po_line.name))
83 if po_line.deferred_analytics_id:
84 deferred_analytics_id = po_line.deferred_analytics_id
85 else:
86 deferred_analytics_id = po.deferred_analytics_id
87 for plan_line in deferred_analytics_id.account_ids:
88 amount = - po_line.price_subtotal * (plan_line.rate / 100)
89 al_vals={
90 'name': po_line.name,
91 'account_id': plan_line.analytic_account_id.id,
92 'unit_amount': po_line.product_qty,
93 'product_id': po_line.product_id and po_line.product_id.id or False,
94 'product_uom_id': po_line.product_uom and po_line.product_uom.id or False,
95 'amount': amount,
96 'journal_id': journal.analytic_journal_id.id,
97 'percentage': plan_line.rate,
98 'deferred_purchase_order_line_id': po_line.id,
99 'general_account_id': journal.default_debit_account_id.id,
100 }
101 al_id = analytic_line_obj.create(cr, uid, al_vals, context=context)
102 return True
103
104purchase_order()
105
106class purchase_order_line(osv.osv):
107
108 _inherit = 'purchase.order.line'
109
110 _columns={
111 'deferred_analytics_id': fields.many2one('account.analytic.plan.instance', 'Deferred Analytic Distribution'),
112 'deferred_line_ids': fields.one2many('account.analytic.line', 'deferred_purchase_order_line_id',
113 'Analytic Lines'),
114 }
115
116purchase_order_line()
0117
=== added file 'purchase_analytic_deferred_choice/purchase_order_view.xml'
--- purchase_analytic_deferred_choice/purchase_order_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_analytic_deferred_choice/purchase_order_view.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,38 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="purchase_order_form" model="ir.ui.view">
5 <field name="name">purchase.order.form</field>
6 <field name="model">purchase.order</field>
7 <field name="type">form</field>
8 <field name="inherit_id" ref="purchase.purchase_order_form"></field>
9 <field name="arch" type="xml">
10 <field name="fiscal_position" position="after">
11 <separator string="Analytic lines" colspan="2"/>
12 <group colspan="2" col="4" groups="analytic.group_analytic_accounting">
13 <field name="deferred_analytics_id" domain="[('plan_id','&lt;&gt;',False)]"/>
14 <button name="create_analytic_lines" type="object" string="Create analytic lines"/>
15 <button name="delete_analytic_lines" type="object" string="Delete analytic lines"/>
16 </group>
17 </field>
18 <page string="Notes" position="after">
19 <page string="Deferred analytic lines" groups="account.group_account_user">
20 <field name="deferred_line_ids" nolabel="1" colspan="4"/>
21 </page>
22 </page>
23 </field>
24 </record>
25
26 <record id="purchase_order_line_form" model="ir.ui.view">
27 <field name="name">purchase.order.line.form</field>
28 <field name="model">purchase.order.line</field>
29 <field name="type">form</field>
30 <field name="inherit_id" ref="purchase_analytic_plans.purchase_order_line_form_inherit"></field>
31 <field name="arch" type="xml">
32 <field name="analytics_id" position="after">
33 <field name="deferred_analytics_id" groups="analytic.group_analytic_accounting" domain="[('plan_id','&lt;&gt;',False)]"/>
34 </field>
35 </field>
36 </record>
37 </data>
38</openerp>
039
=== added directory 'sale_double_validation'
=== renamed directory 'sale_double_validation' => 'sale_double_validation.moved'
=== added file 'sale_double_validation/AUTHORS.txt'
--- sale_double_validation/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ sale_double_validation/AUTHORS.txt 2012-05-21 16:22:21 +0000
@@ -0,0 +1,1 @@
1Lorenzo Battistini <lorenzo.battistini@agilebg.com>
02
=== added file 'sale_double_validation/__init__.py'
--- sale_double_validation/__init__.py 1970-01-01 00:00:00 +0000
+++ sale_double_validation/__init__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22import sale
023
=== added file 'sale_double_validation/__openerp__.py'
--- sale_double_validation/__openerp__.py 1970-01-01 00:00:00 +0000
+++ sale_double_validation/__openerp__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,41 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{
23 'name': "Double validation for sale orders",
24 'version': '0.1',
25 'category': 'Generic Modules/Sales & Purchases',
26 'description': """
27 This module modifies the sale workflow adding a validation step before the sale order confirmation.
28 """,
29 'author': 'Agile Business Group & Domsense',
30 'website': 'http://www.agilebg.com',
31 'license': 'AGPL-3',
32 "depends" : ['sale'],
33 "init_xml" : [],
34 "update_xml" : [
35 'sale_workflow.xml',
36 'sale_view.xml',
37 ],
38 "demo_xml" : [],
39 "active": False,
40 "installable": True
41}
042
=== added directory 'sale_double_validation/i18n'
=== added file 'sale_double_validation/i18n/it.po'
--- sale_double_validation/i18n/it.po 1970-01-01 00:00:00 +0000
+++ sale_double_validation/i18n/it.po 2012-05-21 16:22:21 +0000
@@ -0,0 +1,58 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * sale_double_validation
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2012-02-08 16:43+0000\n"
10"PO-Revision-Date: 2012-02-08 17:44+0100\n"
11"Last-Translator: eLBati <lorenzo.battistini@domsense.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: sale_double_validation
19#: sql_constraint:sale.order:0
20msgid "Order Reference must be unique !"
21msgstr "Il riferimento ordine deve essere unico!"
22
23#. module: sale_double_validation
24#: model:ir.module.module,description:sale_double_validation.module_meta_information
25msgid ""
26"\n"
27" This module modifies the sale workflow adding a validation step before the sale order confirmation.\n"
28" "
29msgstr ""
30"\n"
31" This module modifies the sale workflow adding a validation step before the sale order confirmation.\n"
32" "
33
34#. module: sale_double_validation
35#: view:sale.order:0
36msgid "Quotation Accepted"
37msgstr "Preventivo Accettato"
38
39#. module: sale_double_validation
40#: model:ir.module.module,shortdesc:sale_double_validation.module_meta_information
41msgid "Double validation for sale orders"
42msgstr "Doppia validazione per gli ordini di vendita"
43
44#. module: sale_double_validation
45#: view:sale.order:0
46msgid "Confirm Order"
47msgstr "Conferma Ordine"
48
49#. module: sale_double_validation
50#: model:ir.model,name:sale_double_validation.model_sale_order
51msgid "Sales Order"
52msgstr "Ordine di vendita"
53
54#. module: sale_double_validation
55#: view:sale.order:0
56msgid "Cancel Order"
57msgstr "Annulla Ordine"
58
059
=== added file 'sale_double_validation/sale.py'
--- sale_double_validation/sale.py 1970-01-01 00:00:00 +0000
+++ sale_double_validation/sale.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,46 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24
25class sale_order(osv.osv):
26 _inherit = "sale.order"
27
28 _columns = {
29 'state': fields.selection([
30 ('draft', 'Quotation'),
31 ('waiting_resp', 'Waiting Responsible'),
32 ('waiting_date', 'Waiting Schedule'),
33 ('manual', 'Manual In Progress'),
34 ('progress', 'In Progress'),
35 ('shipping_except', 'Shipping Exception'),
36 ('invoice_except', 'Invoice Exception'),
37 ('done', 'Done'),
38 ('cancel', 'Cancelled')
39 ], 'Order State', readonly=True, help="Gives the state of the quotation or sales order. \nThe exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). \nThe 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True),
40 }
41
42 def waiting_responsible(self, cr, uid, ids, context=None):
43 self.write(cr, uid, ids, {'state': 'waiting_resp'})
44 return True
45
46sale_order()
047
=== added file 'sale_double_validation/sale_view.xml'
--- sale_double_validation/sale_view.xml 1970-01-01 00:00:00 +0000
+++ sale_double_validation/sale_view.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,20 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_order_form" model="ir.ui.view">
5 <field name="name">sale.order.form</field>
6 <field name="model">sale.order</field>
7 <field name="type">form</field>
8 <field name="inherit_id" ref="sale.view_order_form"></field>
9 <field name="arch" type="xml">
10 <button name="order_confirm" position="replace">
11 <button name="order_confirm" states="waiting_resp" string="Confirm Order" icon="gtk-apply"/>
12 <button name="waiting_responsible" states="draft" string="Quotation Accepted" icon="gtk-apply"/>
13 </button>
14 <button name="cancel" position="replace" >
15 <button name="cancel" states="draft,waiting_resp" string="Cancel Order" icon="gtk-cancel"/>
16 </button>
17 </field>
18 </record>
19 </data>
20</openerp>
021
=== added file 'sale_double_validation/sale_workflow.xml'
--- sale_double_validation/sale_workflow.xml 1970-01-01 00:00:00 +0000
+++ sale_double_validation/sale_workflow.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,31 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="act_waiting_responsible" model="workflow.activity">
5 <field name="wkf_id" ref="sale.wkf_sale"/>
6 <field name="name">waiting_responsible</field>
7 <field name="action">waiting_responsible()</field>
8 <field name="kind">function</field>
9 </record>
10
11 <record id="sale.trans_draft_router" model="workflow.transition">
12 <field name="act_from" ref="sale.act_draft"/>
13 <field name="act_to" ref="act_waiting_responsible"/>
14 <field name="signal">waiting_responsible</field>
15 </record>
16
17 <record id="trans_waiting_router" model="workflow.transition">
18 <field name="act_from" ref="act_waiting_responsible"/>
19 <field name="act_to" ref="sale.act_router"/>
20 <field name="signal">order_confirm</field>
21 <field name="group_id" ref="base.group_sale_manager"/>
22 </record>
23
24 <record id="trans_waiting_cancel" model="workflow.transition">
25 <field name="act_from" ref="act_waiting_responsible"/>
26 <field name="act_to" ref="sale.act_cancel"/>
27 <field name="signal">cancel</field>
28 <field name="group_id" ref="base.group_sale_manager"/>
29 </record>
30 </data>
31</openerp>
032
=== added directory 'sale_double_validation/security'
=== added directory 'super_calendar'
=== renamed directory 'super_calendar' => 'super_calendar.moved'
=== added file 'super_calendar/AUTHORS.txt'
--- super_calendar/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ super_calendar/AUTHORS.txt 2012-05-21 16:22:21 +0000
@@ -0,0 +1,1 @@
1Lorenzo Battistini <lorenzo.battistini@agilebg.com>
02
=== added file 'super_calendar/__init__.py'
--- super_calendar/__init__.py 1970-01-01 00:00:00 +0000
+++ super_calendar/__init__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22import super_calendar
023
=== added file 'super_calendar/__openerp__.py'
--- super_calendar/__openerp__.py 1970-01-01 00:00:00 +0000
+++ super_calendar/__openerp__.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,46 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{
23 'name': "Super Calendar",
24 'version': '0.1',
25 'category': 'Generic Modules/Others',
26 'description': """
27 This module allows to create configurable calendars.
28
29 Through the 'calendar configurator' object, you can specify which models have to be merged in the super calendar. For each model, you have to define the 'description' and 'date_start' fields at least. Then you can define 'duration' and the 'user_id' fields.
30
31 The 'super.calendar' object contains the the merged calendars. The 'super.calendar' can be updated by 'ir.cron' or manually.
32 """,
33 'author': 'Agile Business Group & Domsense',
34 'website': 'http://www.agilebg.com',
35 'license': 'AGPL-3',
36 "depends" : ['base'],
37 "init_xml" : [],
38 "update_xml" : [
39 'super_calendar_view.xml',
40 'cron_data.xml',
41 'security/ir.model.access.csv',
42 ],
43 "demo_xml" : [],
44 "active": False,
45 "installable": True
46}
047
=== added file 'super_calendar/cron_data.xml'
--- super_calendar/cron_data.xml 1970-01-01 00:00:00 +0000
+++ super_calendar/cron_data.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,13 @@
1<?xml version="1.0"?>
2<openerp>
3 <data noupdate="1">
4 <record model="ir.cron" id="generate_calendar_records_cron">
5 <field name="name">Generate Calendar Records</field>
6 <field name="interval_number">10</field>
7 <field name="interval_type">minutes</field>
8 <field eval="'super.calendar.configurator'" name="model"/>
9 <field eval="'generate_calendar_records'" name="function"/>
10 <field eval="'[[],{}]'" name="args"/>
11 </record>
12 </data>
13</openerp>
014
=== added directory 'super_calendar/i18n'
=== added directory 'super_calendar/security'
=== added file 'super_calendar/security/ir.model.access.csv'
--- super_calendar/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ super_calendar/security/ir.model.access.csv 2012-05-21 16:22:21 +0000
@@ -0,0 +1,4 @@
1id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2access_model_super_calendar_configurator,access_model_super_calendar_configurator,model_super_calendar_configurator,base.group_system,1,1,1,1
3access_model_super_calendar_configurator_line,access_model_super_calendar_configurator_line,model_super_calendar_configurator_line,base.group_system,1,1,1,1
4access_model_super_calendar,access_model_super_calendar,model_super_calendar,base.group_user,1,0,0,0
05
=== added file 'super_calendar/super_calendar.py'
--- super_calendar/super_calendar.py 1970-01-01 00:00:00 +0000
+++ super_calendar/super_calendar.py 2012-05-21 16:22:21 +0000
@@ -0,0 +1,116 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
5# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published
10# by the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import fields, osv
24from tools.translate import _
25import netsvc
26
27def _models_get(self, cr, uid, context={}):
28 obj = self.pool.get('ir.model')
29 ids = obj.search(cr, uid, [])
30 res = obj.read(cr, uid, ids, ['model', 'name'], context)
31 return [(r['model'], r['name']) for r in res]
32
33class super_calendar_configurator(osv.osv):
34 _logger = netsvc.Logger()
35 _name = 'super.calendar.configurator'
36 _columns = {
37 'name': fields.char('Name', size=64, required=True),
38 'line_ids': fields.one2many('super.calendar.configurator.line', 'configurator_id', 'Lines'),
39 }
40
41 def generate_calendar_records(self, cr, uid, ids, context=None):
42 configurator_ids = self.search(cr, uid, [])
43 super_calendar_pool = self.pool.get('super.calendar')
44
45 # removing old records
46 super_calendar_ids = super_calendar_pool.search(cr, uid, [])
47 super_calendar_pool.unlink(cr, uid, super_calendar_ids)
48
49 for configurator_id in configurator_ids:
50 configurator = self.browse(cr, uid, configurator_id)
51 for line in configurator.line_ids:
52 current_pool = self.pool.get(line.name.model)
53 current_record_ids = current_pool.search(cr, uid, line.domain and eval(line.domain) or [])
54 for current_record_id in current_record_ids:
55 current_record = current_pool.browse(cr, uid, current_record_id)
56 if line.user_field_id and \
57 current_record[line.user_field_id.name]._table_name != 'res.users':
58 raise osv.except_osv(_('Error'),
59 _("The 'User' field of record %s (%s) does not refer to res.users")
60 % (current_record[line.description_field_id.name], line.name.model))
61 if current_record[line.description_field_id.name] \
62 and current_record[line.date_start_field_id.name]:
63 super_calendar_values = {
64 'name': current_record[line.description_field_id.name],
65 'date_start': current_record[line.date_start_field_id.name],
66 #'date_stop': line.date_stop_field_id and current_record[line.date_stop_field_id.name] or False,
67 'duration': line.duration_field_id and current_record[line.duration_field_id.name] \
68 or False,
69 'user_id': line.user_field_id and current_record[line.user_field_id.name] and current_record[line.user_field_id.name].id or False,
70 'configurator_id': configurator.id,
71 'res_id': line.name.model+','+str(current_record['id']),
72 'model_id': line.name.id,
73 }
74 super_calendar_pool.create(cr, uid, super_calendar_values)
75 self._logger.notifyChannel('super_calendar', netsvc.LOG_INFO, "Calendar generated")
76 return True
77
78super_calendar_configurator()
79
80class super_calendar_configurator_line(osv.osv):
81 _name = 'super.calendar.configurator.line'
82 _columns = {
83 'name': fields.many2one('ir.model', 'Model', required=True),
84 'domain': fields.char('Domain', size=512),
85 'configurator_id': fields.many2one('super.calendar.configurator', 'Configurator'),
86 'description_field_id': fields.many2one('ir.model.fields', 'Description field',
87 domain="[('model_id', '=', name),('ttype', '=', 'char')]", required=True),
88 'date_start_field_id': fields.many2one('ir.model.fields', 'Start date field',
89 domain="['&',('ttype', '=', 'datetime'),('model_id', '=', name)]",
90 required=True),
91# 'date_stop_field_id': fields.many2one('ir.model.fields', 'End date field',
92# domain="['&',('ttype', '=', 'datetime'),('model_id', '=', name)]"),
93 'duration_field_id': fields.many2one('ir.model.fields', 'Duration field',
94 domain="['&',('ttype', '=', 'float'),('model_id', '=', name)]"),
95 'user_field_id': fields.many2one('ir.model.fields', 'User field',
96 domain="['&',('ttype', '=', 'many2one'),('model_id', '=', name)]"),
97 }
98 # False. The same object can have several dates
99 #_sql_constraints = [
100 # ('name', 'unique(configurator_id,name)', 'The model must be unique per configurator' )
101 # ]
102super_calendar_configurator_line()
103
104class super_calendar(osv.osv):
105 _name = 'super.calendar'
106 _columns = {
107 'name': fields.char('Description', size=64, required=True),
108 'date_start':fields.datetime('Start date', required=True),
109 #'date_stop':fields.datetime('End date'), # to be removed?
110 'duration':fields.float('Duration'),
111 'user_id': fields.many2one('res.users', 'User'),
112 'configurator_id': fields.many2one('super.calendar.configurator', 'Configurator'),
113 'res_id': fields.reference('Resource', selection=_models_get, size=128),
114 'model_id': fields.many2one('ir.model', 'Model'),
115 }
116super_calendar()
0117
=== added file 'super_calendar/super_calendar_view.xml'
--- super_calendar/super_calendar_view.xml 1970-01-01 00:00:00 +0000
+++ super_calendar/super_calendar_view.xml 2012-05-21 16:22:21 +0000
@@ -0,0 +1,135 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4
5 <!-- configurator -->
6
7 <record model="ir.ui.view" id="super_calendar_configurator_tree">
8 <field name="name">super_calendar_configurator_tree</field>
9 <field name="model">super.calendar.configurator</field>
10 <field name="type">tree</field>
11 <field name="arch" type="xml">
12 <tree string="Configurators">
13 <field name="name"/>
14 </tree>
15 </field>
16 </record>
17 <record model="ir.ui.view" id="super_calendar_configurator_form">
18 <field name="name">super_calendar_configurator_form</field>
19 <field name="model">super.calendar.configurator</field>
20 <field name="type">form</field>
21 <field name="arch" type="xml">
22 <form string="Configurator">
23 <field name="name" select="1" colspan="2"/>
24 <newline/>
25 <field name="line_ids" nolabel="1" colspan="4">
26 <tree string="Lines">
27 <field name="name"/>
28 <field name="domain"/>
29 </tree>
30 <form string="Line">
31 <field name="name"/>
32 <field name="domain"/>
33 <field name="description_field_id"/>
34 <field name="date_start_field_id"/>
35 <!--<field name="date_stop_field_id"/>-->
36 <field name="duration_field_id"/>
37 <field name="user_field_id"/>
38 </form>
39 </field>
40 <newline/>
41 <button name="generate_calendar_records" string="Generate Calendar" type="object" icon="gtk-go-forward" colspan="2"/>
42 </form>
43 </field>
44 </record>
45
46 <record model="ir.actions.act_window" id="super_calendar_configurator">
47 <field name="name">Calendar Configurators</field>
48 <field name="res_model">super.calendar.configurator</field>
49 <field name="view_type">form</field>
50 <field name="view_mode">tree,form</field>
51 <field name="view_id" ref="super_calendar_configurator_tree"/>
52 </record>
53
54 <!-- calendar -->
55
56 <record model="ir.ui.view" id="super_calendar_tree">
57 <field name="name">super_calendar_tree</field>
58 <field name="model">super.calendar</field>
59 <field name="type">tree</field>
60 <field name="arch" type="xml">
61 <tree string="Calendar">
62 <field name="name"/>
63 <field name="date_start"/>
64 <!--<field name="date_stop"/>-->
65 <field name="duration"/>
66 <field name="user_id"/>
67 <field name="configurator_id"/>
68 <field name="model_id"/>
69 </tree>
70 </field>
71 </record>
72 <record model="ir.ui.view" id="super_calendar_form">
73 <field name="name">super_calendar_form</field>
74 <field name="model">super.calendar</field>
75 <field name="type">form</field>
76 <field name="arch" type="xml">
77 <form string="Configurator">
78 <field name="name" readonly="1"/>
79 <field name="date_start" readonly="1"/>
80 <!--<field name="date_stop" readonly="1"/>-->
81 <field name="duration" readonly="1"/>
82 <field name="user_id" readonly="1"/>
83 <field name="configurator_id" readonly="1"/>
84 <field name="model_id" readonly="1"/>
85 <field name="res_id"/>
86 </form>
87 </field>
88 </record>
89 <record model="ir.ui.view" id="super_calendar">
90 <field name="name">super_calendar</field>
91 <field name="model">super.calendar</field>
92 <field name="type">calendar</field>
93 <field name="arch" type="xml">
94 <calendar string="Calendar" color="model_id" date_start="date_start" date_delay="duration">
95 <field name="name"/>
96 </calendar>
97 </field>
98 </record>
99 <record model="ir.ui.view" id="super_calendar_search">
100 <field name="name">super_calendar_search</field>
101 <field name="model">super.calendar</field>
102 <field name="type">search</field>
103 <field name="arch" type="xml">
104 <search string="Search Calendar" >
105 <field name="name"/>
106 <field name="configurator_id" select="1"/>
107 <field name="model_id" select="1"/>
108 <field name="user_id" select="1">
109 <filter domain="[('user_id','=',uid)]" help="My Items" icon="terp-personal"/>
110 </field>
111 <newline/>
112 <group expand="0" string="Extended Filters..." colspan="4" col="8">
113 <field name="date_start" />
114 <!--<field name="date_stop" />-->
115 <field name="duration" />
116 </group>
117 </search>
118 </field>
119 </record>
120
121 <record model="ir.actions.act_window" id="super_calendar_action">
122 <field name="name">Super Calendar</field>
123 <field name="res_model">super.calendar</field>
124 <field name="view_type">form</field>
125 <field name="view_mode">calendar,tree,form</field>
126 <field name="view_id" ref="super_calendar"/>
127 </record>
128
129 <menuitem id="super_calendar_menu" name="Super Calendar" />
130 <menuitem id="super_calendar_calendar" name="Calendar" parent="super_calendar_menu" />
131 <menuitem id="super_calendar_calendar_calendar" name="Calendar" parent="super_calendar_calendar" action="super_calendar_action"/>
132 <menuitem id="super_calendar_configuration" name="Configuration" parent="super_calendar_menu" />
133 <menuitem id="super_calendar_configurators" name="Configurators" parent="super_calendar_configuration" action="super_calendar_configurator"/>
134 </data>
135</openerp>

Subscribers

People subscribed via source and target branches

to status/vote changes: