eficent team mailing list archive
-
eficent team
-
Mailing list archive
-
Message #00002
lp:~cpueyo/eficent-openerp-project-management/nerviaconsultores-openerp-7.0 into lp:eficent-openerp-project-management
Carlos Pueyo has proposed merging lp:~cpueyo/eficent-openerp-project-management/nerviaconsultores-openerp-7.0 into lp:eficent-openerp-project-management.
Requested reviews:
Eficent (eficent)
For more details, see:
https://code.launchpad.net/~cpueyo/eficent-openerp-project-management/nerviaconsultores-openerp-7.0/+merge/144256
Adaptados los módulos a la versión 7.0
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~cpueyo/eficent-openerp-project-management/nerviaconsultores-openerp-7.0/+merge/144256
Your team Eficent is requested to review the proposed merge of lp:~cpueyo/eficent-openerp-project-management/nerviaconsultores-openerp-7.0 into lp:eficent-openerp-project-management.
=== added directory 'account_analytic_lob'
=== renamed directory 'account_analytic_lob' => 'account_analytic_lob.moved'
=== added file 'account_analytic_lob/__init__.py'
--- account_analytic_lob/__init__.py 1970-01-01 00:00:00 +0000
+++ account_analytic_lob/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_analytic_lob
+import project
+
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_analytic_lob/__openerp__.py'
--- account_analytic_lob/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_analytic_lob/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+ "name": "Project Management",
+ "version": "1.0",
+ "author": "Eficent, Nervia Consultores",
+ "website": "",
+ "category": "Generic Modules/Projects & Services",
+ "depends": ["account","analytic","project"],
+ "description": """Introduce business segments in analytic accounts.
+ Provides the possibility to perform economic analysis by business segment.
+ """,
+ "init_xml": [],
+ "update_xml": [
+ "security/ir.model.access.csv",
+ "account_analytic_lob_view.xml",
+ "project_view.xml",
+ ],
+ 'demo_xml': [
+
+ ],
+ 'test':[
+ ],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_analytic_lob/account_analytic_lob.py'
--- account_analytic_lob/account_analytic_lob.py 1970-01-01 00:00:00 +0000
+++ account_analytic_lob/account_analytic_lob.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import tools
+from osv import fields, osv
+from tools.translate import _
+
+
+class account_analytic_lob(osv.osv):
+
+ _name = "account.analytic.lob"
+ _description = 'Line of Business'
+ _order = 'name'
+
+ _columns = {
+ 'code': fields.char('Code', size=4, required=True, translate=True),
+ 'name': fields.char('Name', size=32, required=True, translate=True),
+ }
+
+account_analytic_lob()
+
=== added file 'account_analytic_lob/account_analytic_lob_view.xml'
--- account_analytic_lob/account_analytic_lob_view.xml 1970-01-01 00:00:00 +0000
+++ account_analytic_lob/account_analytic_lob_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Analytic Account Line of Business -->
+
+ <record id="view_account_analytic_lob_search" model="ir.ui.view">
+ <field name="name">account.analytic.lob.search</field>
+ <field name="model">account.analytic.lob</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Line of Business">
+ <field name="code"/>
+ <field name="name"/>
+ </search>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_lob_edit" model="ir.ui.view">
+ <field name="name">account.analytic.lob.form</field>
+ <field name="model">account.analytic.lob</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Line of Business">
+ <field name="code" select="1"/>
+ <field name="name" select="1"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_lob_tree" model="ir.ui.view">
+ <field name="name">account.analytic.lob.tree</field>
+ <field name="model">account.analytic.lob</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Line of Business">
+ <field name="code"/>
+ <field name="name"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="action_account_analytic_lob_tree" model="ir.actions.act_window">
+ <field name="name">Line of Business</field>
+ <field name="res_model">account.analytic.lob</field>
+ <field name="view_id" ref="view_account_analytic_lob_tree"/>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_account_analytic_lob_search"/>
+ <field name="help">Define the Lines of Business.</field>
+ </record>
+
+ <menuitem id="menu_account_analytic_lob_config"
+ name="Line of Business"
+ parent="account.menu_analytic_accounting"
+ sequence="1"
+ />
+
+ <menuitem
+ action="action_account_analytic_lob_tree"
+ id="menu_account_analytic_lob_view"
+ parent="menu_account_analytic_lob_config"
+ sequence="1"
+ groups="analytic.group_analytic_accounting"
+ />
+ </data>
+</openerp>
=== added directory 'account_analytic_lob/i18n'
=== added file 'account_analytic_lob/i18n/account_analytic_lob.pot'
--- account_analytic_lob/i18n/account_analytic_lob.pot 1970-01-01 00:00:00 +0000
+++ account_analytic_lob/i18n/account_analytic_lob.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,57 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_analytic_lob
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-12-18 08:17+0000\n"
+"PO-Revision-Date: 2011-12-18 08:17+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_analytic_lob
+#: field:account.analytic.account,lob:0
+#: view:account.analytic.lob:0
+#: model:ir.actions.act_window,name:account_analytic_lob.action_account_analytic_lob_tree
+#: model:ir.model,name:account_analytic_lob.model_account_analytic_lob
+#: model:ir.ui.menu,name:account_analytic_lob.menu_account_analytic_lob_config
+#: model:ir.ui.menu,name:account_analytic_lob.menu_account_analytic_lob_view
+msgid "Line of Business"
+msgstr ""
+
+#. module: account_analytic_lob
+#: field:account.analytic.lob,code:0
+msgid "Code"
+msgstr ""
+
+#. module: account_analytic_lob
+#: field:account.analytic.lob,name:0
+msgid "Name"
+msgstr ""
+
+#. module: account_analytic_lob
+#: model:ir.actions.act_window,help:account_analytic_lob.action_account_analytic_lob_tree
+msgid "Define the Lines of Business."
+msgstr ""
+
+#. module: account_analytic_lob
+#: model:ir.model,name:account_analytic_lob.model_account_analytic_account
+msgid "Analytic Account"
+msgstr ""
+
+#. module: account_analytic_lob
+#: constraint:account.analytic.account:0
+msgid "Error! The currency has to be the same as the currency of the selected company"
+msgstr ""
+
+#. module: account_analytic_lob
+#: constraint:account.analytic.account:0
+msgid "Error! You can not create recursive analytic accounts."
+msgstr ""
+
=== added file 'account_analytic_lob/i18n/es.po'
--- account_analytic_lob/i18n/es.po 1970-01-01 00:00:00 +0000
+++ account_analytic_lob/i18n/es.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,57 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_analytic_lob
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-12-18 08:17+0000\n"
+"PO-Revision-Date: 2011-12-18 09:18+0100\n"
+"Last-Translator: Jordi Ballester <jordi.ballester@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: account_analytic_lob
+#: field:account.analytic.account,lob:0
+#: view:account.analytic.lob:0
+#: model:ir.actions.act_window,name:account_analytic_lob.action_account_analytic_lob_tree
+#: model:ir.model,name:account_analytic_lob.model_account_analytic_lob
+#: model:ir.ui.menu,name:account_analytic_lob.menu_account_analytic_lob_config
+#: model:ir.ui.menu,name:account_analytic_lob.menu_account_analytic_lob_view
+msgid "Line of Business"
+msgstr "Línea de Negocio"
+
+#. module: account_analytic_lob
+#: field:account.analytic.lob,code:0
+msgid "Code"
+msgstr "Código"
+
+#. module: account_analytic_lob
+#: field:account.analytic.lob,name:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: account_analytic_lob
+#: model:ir.actions.act_window,help:account_analytic_lob.action_account_analytic_lob_tree
+msgid "Define the Lines of Business."
+msgstr "Define las Líneas de Negocio."
+
+#. module: account_analytic_lob
+#: model:ir.model,name:account_analytic_lob.model_account_analytic_account
+msgid "Analytic Account"
+msgstr "Cuenta analítica"
+
+#. module: account_analytic_lob
+#: constraint:account.analytic.account:0
+msgid "Error! The currency has to be the same as the currency of the selected company"
+msgstr "¡Error! La divisa tiene que ser la misma que la establecida en la compañía seleccionada"
+
+#. module: account_analytic_lob
+#: constraint:account.analytic.account:0
+msgid "Error! You can not create recursive analytic accounts."
+msgstr "¡Error! No puede crear cuentas analíticas recursivas."
+
=== added file 'account_analytic_lob/project.py'
--- account_analytic_lob/project.py 1970-01-01 00:00:00 +0000
+++ account_analytic_lob/project.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+
+class account_analytic_account(osv.osv):
+
+ _inherit = 'account.analytic.account'
+
+
+ _columns = {
+ 'lob': fields.many2one('account.analytic.lob','Line of Business'),
+ }
+
+account_analytic_account()
=== added file 'account_analytic_lob/project_view.xml'
--- account_analytic_lob/project_view.xml 1970-01-01 00:00:00 +0000
+++ account_analytic_lob/project_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+
+#---------------------------------------------------------------------------------------------------------
+# Extend the project
+#---------------------------------------------------------------------------------------------------------
+ <record id="edit_project" model="ir.ui.view">
+ <field name="name">project.project.form</field>
+ <field name="model">project.project</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="project.edit_project"/>
+ <field name="arch" type="xml">
+ <xpath expr="//form/sheet/notebook/page[@string='Other Info']/group/group[@string='Miscellaneous']/field[@name='parent_id']" position="after">
+ <field name="lob"/>
+ </xpath>
+ </field>
+ </record>
+
+
+
+#---------------------------------------------------------------------------------------------------------
+# Extend the analytic account
+#---------------------------------------------------------------------------------------------------------
+
+
+ <record id="view_account_analytic_account_form" model="ir.ui.view">
+ <field name="name">account.analytic.account.form</field>
+ <field name="model">account.analytic.account</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//form/sheet/notebook/page[@string='Contract Information']/field[@name='description']" position="after">
+ <field name="lob"/>
+ </xpath>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'account_analytic_lob/security'
=== added file 'account_analytic_lob/security/ir.model.access.csv'
--- account_analytic_lob/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ account_analytic_lob/security/ir.model.access.csv 2013-01-22 10:02:35 +0000
@@ -0,0 +1,5 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_account_analytic_lob_project_user","account.analytic.lob project user","model_account_analytic_lob","project.group_project_user",1,0,0,0
+"access_account_analytic_lob_account_user","account.analytic.lob account user","model_account_analytic_lob","account.group_account_user",1,0,0,0
+"access_account_analytic_lob_project_manager","account.analytic.lob project manager","model_account_analytic_lob","project.group_project_manager",1,1,1,1
+"access_account_analytic_lob_account_manager","account.analytic.lob account manager","model_account_analytic_lob","account.group_account_manager",1,1,1,1
\ No newline at end of file
=== added directory 'hr_contract_wage_type'
=== added file 'hr_contract_wage_type/__init__.py'
--- hr_contract_wage_type/__init__.py 1970-01-01 00:00:00 +0000
+++ hr_contract_wage_type/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Authors: Olivier Laurent & Stéphane Bidoul
+# Copyright (c) 2012 Acsone SA/NV (http://www.acsone.eu)
+# All Rights Reserved
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs.
+# End users who are looking for a ready-to-use solution with commercial
+# guarantees and support are strongly advised to contact a Free Software
+# Service Company.
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import hr_contract_wage_type
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'hr_contract_wage_type/__openerp__.py'
--- hr_contract_wage_type/__openerp__.py 1970-01-01 00:00:00 +0000
+++ hr_contract_wage_type/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Authors: Olivier Laurent & Stéphane Bidoul
+# Copyright (c) 2012 Acsone SA/NV (http://www.acsone.eu)
+# All Rights Reserved
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs.
+# End users who are looking for a ready-to-use solution with commercial
+# guarantees and support are strongly advised to contact a Free Software
+# Service Company.
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+{
+ "name": "HR Contract Wage Type",
+ "version": "1.0",
+ "author": "ACSONE SA/NV",
+ "maintainer": "ACSONE SA/NV",
+ "website": "http://www.acsone.eu",
+ "images": [],
+ "category": "Human Resources",
+ "complexity": "easy",
+ "depends": ["hr_contract"],
+ "description": """
+HR Contract Wage Type
+=====================
+
+Reintroduce wage_type and wage_type_period classes that were removed from the
+OpenERP hr_contract official addon in 6.1.
+
+These classes were present in 6.0 and removed in 6.1 following the
+introduction of the hr_payroll module. However, hr_payroll does not provide
+similar functionality and data cannot be migrated. This module restores
+identical functionality.
+ """,
+ "init_xml": ["hr_contract_wage_type_data.xml"],
+ "update_xml": [
+ "hr_contract_wage_type_view.xml",
+ "security/ir.model.access.csv",
+ ],
+ "demo_xml": [],
+ "test": [
+ "test/hr_contract_wage_type_hourly_wage.yml",
+ ],
+ "active": False,
+ "licence": "AGPL-3",
+ "installable": True,
+ "auto_install": False,
+ "application": False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'hr_contract_wage_type/hr_contract_wage_type.py'
--- hr_contract_wage_type/hr_contract_wage_type.py 1970-01-01 00:00:00 +0000
+++ hr_contract_wage_type/hr_contract_wage_type.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,112 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Authors: Olivier Laurent & Stéphane Bidoul
+# Copyright (c) 2012 Acsone SA/NV (http://www.acsone.eu)
+# All Rights Reserved
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs.
+# End users who are looking for a ready-to-use solution with commercial
+# guarantees and support are strongly advised to contact a Free Software
+# Service Company.
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from datetime import datetime
+from osv import fields, osv
+
+class hr_contract_wage_type_period(osv.Model):
+ """ Contract Wage Type Period """
+ _name = 'hr.contract.wage.type.period'
+ _description = 'Wage Period'
+ _columns = {
+ 'name': fields.char('Period Name', size=50, required=True, select=True),
+ 'factor_days': fields.float('Hours in the Period', digits=(12,4), required=True)
+ }
+ _defaults = {
+ 'factor_days': 168.0
+ }
+
+class hr_contract_wage_type(osv.Model):
+ """ Contract Wage Type (hourly, daily, monthly, ...) """
+ _name = 'hr.contract.wage.type'
+ _description = 'Wage Type'
+ _columns = {
+ 'name': fields.char('Wage Type Name', size=50, required=True, select=True),
+ 'period_id': fields.many2one('hr.contract.wage.type.period', 'Wage Period', required=True),
+ 'type': fields.selection([('gross','Gross'), ('net','Net')], 'Type', required=True),
+ 'factor_type': fields.float('Factor for Hour Cost', digits=(12,4), required=True, help='This field is used by the timesheet system to compute the cost of an hour of work based on the contract of the employee')
+ }
+ _defaults = {
+ 'type': 'gross',
+ 'factor_type': 1.8
+ }
+
+class hr_contract(osv.Model):
+ _inherit = 'hr.contract'
+
+ def _get_hourly_wage(self, cwt, wage):
+ p = cwt.period_id
+ if p:
+ # Prevent divison-by-zero error
+ if p.factor_days:
+ return wage * cwt.factor_type / p.factor_days
+ else:
+ return 0.0
+ else:
+ return 0.0
+
+ def _hourly_wage(self, cr, uid, ids, field, arg, context=None):
+ res = {}
+ contracts = self.browse(cr, uid, ids, context=context)
+ for contract in contracts:
+ num = False
+ cwt = contract.wage_type_id
+ if cwt:
+ num = self._get_hourly_wage(cwt, contract.wage)
+ res[contract.id] = num
+ return res
+
+ _columns = {
+ 'wage_type_id': fields.many2one('hr.contract.wage.type', 'Wage Type', required=True),
+ 'hourly_wage': fields.function(_hourly_wage, type='float', string="Hourly wage", method=True),
+ }
+
+class hr_employee(osv.Model):
+ _inherit = "hr.employee"
+
+ def get_hourly_wage_on_date(self, cr, uid, ids, date, context=None):
+ """ Return the hourly wage of employees from the contracts,
+ or False if no contract is defined at requested date
+
+ :param ids: employee ids
+ :param date: validity date of the contract
+ """
+ res = {}
+ for employees in self.browse(cr, uid, ids, context=context):
+ num = False
+ if employees.contract_ids:
+ for contract in employees.contract_ids:
+ if contract.date_start <= date:
+ if not contract.date_end or contract.date_end >= date:
+ num = contract.hourly_wage
+ res[employees.id] = num
+ return res
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'hr_contract_wage_type/hr_contract_wage_type_data.xml'
--- hr_contract_wage_type/hr_contract_wage_type_data.xml 1970-01-01 00:00:00 +0000
+++ hr_contract_wage_type/hr_contract_wage_type_data.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data noupdate="1">
+
+ <!-- Contract Wage Type Periods -->
+ <record id="hr_contract_wage_type_period_daily" model="hr.contract.wage.type.period">
+ <field name="name">daily</field>
+ <field name="factor_days">8</field>
+ </record>
+ <record id="hr_contract_wage_type_period_weekly" model="hr.contract.wage.type.period">
+ <field name="name">weekly</field>
+ <field name="factor_days">40</field>
+ </record>
+ <record id="hr_contract_wage_type_period_monthly" model="hr.contract.wage.type.period">
+ <field name="name">monthly</field>
+ <field name="factor_days">168</field>
+ </record>
+
+ <!-- Contract Wage Types -->
+ <record id="hr_contract_monthly_gross" model="hr.contract.wage.type">
+ <field name="name">Monthly Gross Wage</field>
+ <field name="type">gross</field>
+ <field name="period_id" ref="hr_contract_wage_type_period_monthly"/>
+ </record>
+
+ <record id="hr_contract_monthly_net" model="hr.contract.wage.type">
+ <field name="name">Monthly Net Wage</field>
+ <field name="type">net</field>
+ <field name="period_id" ref="hr_contract_wage_type_period_monthly"/>
+ </record>
+
+ </data>
+</openerp>
=== added file 'hr_contract_wage_type/hr_contract_wage_type_view.xml'
--- hr_contract_wage_type/hr_contract_wage_type_view.xml 1970-01-01 00:00:00 +0000
+++ hr_contract_wage_type/hr_contract_wage_type_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Contract Wage Type -->
+
+ <record id="hr_contract_wage_type_view_form" model="ir.ui.view">
+ <field name="name">hr.contract.wage.type.form</field>
+ <field name="model">hr.contract.wage.type</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Wage Type">
+ <field colspan="4" name="name"/>
+ <field name="period_id"/>
+ <field name="type"/>
+ <separator colspan="4" string="Hourly Cost Computation"/>
+ <field name="factor_type"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="hr_contract_wage_type_view_tree" model="ir.ui.view">
+ <field name="name">hr.contract.wage.type.tree</field>
+ <field name="model">hr.contract.wage.type</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Wage Types">
+ <field name="name"/>
+ <field name="type"/>
+ <field name="period_id" invisible="1"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="hr_contract_wage_type_view_search" model="ir.ui.view">
+ <field name="name">hr.contract.wage.type.search</field>
+ <field name="model">hr.contract.wage.type</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Search Wage Type">
+ <group col='15' colspan='4'>
+ <field name="name"/>
+ <field name="type"/>
+ </group>
+ <newline/>
+ <group expand="0" string="Group By..." colspan="4" col="20">
+ <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="hr_contract_wage_type_action" model="ir.actions.act_window">
+ <field name="name">Wage Type</field>
+ <field name="res_model">hr.contract.wage.type</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="hr_contract_wage_type_view_search"/>
+ </record>
+
+ <menuitem action="hr_contract_wage_type_action"
+ id="hr_contract_wage_type_menu"
+ parent="hr_contract.next_id_56"
+ sequence="7"/>
+
+ <!-- Contract Wage Type Period -->
+
+ <record id="hr_contract_wage_type_period_view_form" model="ir.ui.view">
+ <field name="name">hr.contract.wage.type.period.form</field>
+ <field name="model">hr.contract.wage.type.period</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Wage Period">
+ <field colspan="4" name="name"/>
+ <field name="factor_days"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="hr_contract_wage_type_period_view_tree" model="ir.ui.view">
+ <field name="name">hr.contract.wage.type.period.tree</field>
+ <field name="model">hr.contract.wage.type.period</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Wage Periods">
+ <field name="name"/>
+ <field name="factor_days"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="hr_contract_wage_type_period_action" model="ir.actions.act_window">
+ <field name="name">Wage Period</field>
+ <field name="res_model">hr.contract.wage.type.period</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ </record>
+
+ <menuitem action="hr_contract_wage_type_period_action"
+ id="hr_contract_wage_type_period_menu"
+ parent="hr_contract.next_id_56"
+ sequence="8"/>
+
+ <!-- Contract -->
+
+ <record id="hr_contract_view_form" model="ir.ui.view">
+ <field name="name">hr.contract.view.form</field>
+ <field name="model">hr.contract</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="hr_contract.hr_contract_view_form" />
+ <field name="arch" type="xml">
+ <field name="wage" position="after">
+ <field name="wage_type_id" />
+ </field>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'hr_contract_wage_type/i18n'
=== added file 'hr_contract_wage_type/i18n/fr.po'
--- hr_contract_wage_type/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ hr_contract_wage_type/i18n/fr.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,120 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * hr_contract_wage_type
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-11-15 11:55+0000\n"
+"PO-Revision-Date: 2012-11-15 11:55+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Hourly Cost Computation"
+msgstr "Calcul du Coût Horaire"
+
+#. module: hr_contract_wage_type
+#: selection:hr.contract.wage.type,type:0
+msgid "Gross"
+msgstr "Brut"
+
+#. module: hr_contract_wage_type
+#: help:hr.contract.wage.type,factor_type:0
+msgid "This field is used by the timesheet system to compute the cost of an hour of work based on the contract of the employee"
+msgstr "Ce champ est utilisé par le mécanisme de feuille de prestation pour calculer le coût d'une heure de travail basée sur le contrat de l'employé"
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type.period:0
+msgid "Wage Periods"
+msgstr "Périodes de Rémunération"
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Group By..."
+msgstr "Groupé par..."
+
+#. module: hr_contract_wage_type
+#: field:hr.contract,wage_type_id:0
+#: view:hr.contract.wage.type:0
+#: model:ir.actions.act_window,name:hr_contract_wage_type.hr_contract_wage_type_action
+#: model:ir.model,name:hr_contract_wage_type.model_hr_contract_wage_type
+#: model:ir.ui.menu,name:hr_contract_wage_type.hr_contract_wage_type_menu
+msgid "Wage Type"
+msgstr "Type de Rémunération"
+
+#. module: hr_contract_wage_type
+#: field:hr.contract,hourly_wage:0
+msgid "Hourly wage"
+msgstr "Rémunération horaire"
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Period"
+msgstr "Période"
+
+#. module: hr_contract_wage_type
+#: model:ir.model,name:hr_contract_wage_type.model_hr_contract
+msgid "Contract"
+msgstr "Contrat"
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type.period,factor_days:0
+msgid "Hours in the Period"
+msgstr "Heures Contenues dans la Période"
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Search Wage Type"
+msgstr "Recherche de Type de Rémunération"
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type,factor_type:0
+msgid "Factor for Hour Cost"
+msgstr "Facteur du Coût Horaire"
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type.period,name:0
+msgid "Period Name"
+msgstr "Nom de la Période"
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type,period_id:0
+#: view:hr.contract.wage.type.period:0
+#: model:ir.actions.act_window,name:hr_contract_wage_type.hr_contract_wage_type_period_action
+#: model:ir.model,name:hr_contract_wage_type.model_hr_contract_wage_type_period
+#: model:ir.ui.menu,name:hr_contract_wage_type.hr_contract_wage_type_period_menu
+msgid "Wage Period"
+msgstr "Période de Rémunération"
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Wage Types"
+msgstr "Types de Rémunération"
+
+#. module: hr_contract_wage_type
+#: model:ir.model,name:hr_contract_wage_type.model_hr_employee
+msgid "Employee"
+msgstr "Employé"
+
+#. module: hr_contract_wage_type
+#: selection:hr.contract.wage.type,type:0
+msgid "Net"
+msgstr "Net"
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type,name:0
+msgid "Wage Type Name"
+msgstr "Nom du Type de Rémunération"
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type,type:0
+msgid "Type"
+msgstr "Type"
+
=== added file 'hr_contract_wage_type/i18n/hr_contract_wage_type.pot'
--- hr_contract_wage_type/i18n/hr_contract_wage_type.pot 1970-01-01 00:00:00 +0000
+++ hr_contract_wage_type/i18n/hr_contract_wage_type.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,120 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * hr_contract_wage_type
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-11-15 11:55+0000\n"
+"PO-Revision-Date: 2012-11-15 11:55+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Hourly Cost Computation"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: selection:hr.contract.wage.type,type:0
+msgid "Gross"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: help:hr.contract.wage.type,factor_type:0
+msgid "This field is used by the timesheet system to compute the cost of an hour of work based on the contract of the employee"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type.period:0
+msgid "Wage Periods"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Group By..."
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: field:hr.contract,wage_type_id:0
+#: view:hr.contract.wage.type:0
+#: model:ir.actions.act_window,name:hr_contract_wage_type.hr_contract_wage_type_action
+#: model:ir.model,name:hr_contract_wage_type.model_hr_contract_wage_type
+#: model:ir.ui.menu,name:hr_contract_wage_type.hr_contract_wage_type_menu
+msgid "Wage Type"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: field:hr.contract,hourly_wage:0
+msgid "Hourly wage"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Period"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: model:ir.model,name:hr_contract_wage_type.model_hr_contract
+msgid "Contract"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type.period,factor_days:0
+msgid "Hours in the Period"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Search Wage Type"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type,factor_type:0
+msgid "Factor for Hour Cost"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type.period,name:0
+msgid "Period Name"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type,period_id:0
+#: view:hr.contract.wage.type.period:0
+#: model:ir.actions.act_window,name:hr_contract_wage_type.hr_contract_wage_type_period_action
+#: model:ir.model,name:hr_contract_wage_type.model_hr_contract_wage_type_period
+#: model:ir.ui.menu,name:hr_contract_wage_type.hr_contract_wage_type_period_menu
+msgid "Wage Period"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: view:hr.contract.wage.type:0
+msgid "Wage Types"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: model:ir.model,name:hr_contract_wage_type.model_hr_employee
+msgid "Employee"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: selection:hr.contract.wage.type,type:0
+msgid "Net"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type,name:0
+msgid "Wage Type Name"
+msgstr ""
+
+#. module: hr_contract_wage_type
+#: field:hr.contract.wage.type,type:0
+msgid "Type"
+msgstr ""
+
=== added directory 'hr_contract_wage_type/security'
=== added file 'hr_contract_wage_type/security/ir.model.access.csv'
--- hr_contract_wage_type/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ hr_contract_wage_type/security/ir.model.access.csv 2013-01-22 10:02:35 +0000
@@ -0,0 +1,5 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_contract_wage_type_period_mgr","hr_contract_wage_type_period_mgr","model_hr_contract_wage_type_period","base.group_hr_manager",1,1,1,1
+"access_hr_contract_wage_type_mgr","hr_contract_wage_type_mgr","model_hr_contract_wage_type","base.group_hr_manager",1,1,1,1
+"access_hr_contract_wage_type_period_usr","hr_contract_wage_type_period_usr","model_hr_contract_wage_type_period","base.group_hr_user",1,0,0,0
+"access_hr_contract_wage_type_usr","hr_contract_wage_type_usr","model_hr_contract_wage_type","base.group_hr_user",1,0,0,0
=== added directory 'hr_contract_wage_type/test'
=== added file 'hr_contract_wage_type/test/hr_contract_wage_type_hourly_wage.yml'
--- hr_contract_wage_type/test/hr_contract_wage_type_hourly_wage.yml 1970-01-01 00:00:00 +0000
+++ hr_contract_wage_type/test/hr_contract_wage_type_hourly_wage.yml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,47 @@
+-
+ I create a new employee "Mark Johnson".
+-
+ !record {model: hr.employee, id: hr_employee_employee0}:
+ address_home_id: base.res_partner_address_1
+ company_id: base.main_company
+ gender: male
+ name: Mark Johnson
+ children: 2
+ marital: 'married'
+ place_of_birth: Belgium
+ vehicle: 'No'
+ vehicle_distance: 12
+-
+ I create a contract type "Employee"
+-
+ !record {model: hr.contract.type, id: hr_contract_type_emp}:
+ name: Employee
+-
+ I create a new contract for "Mark Johnson".
+-
+ !record {model: hr.contract, id: hr_contract_contract0}:
+ employee_id: 'hr_employee_employee0'
+ date_end: !eval "'%s-05-18' %(datetime.now().year+1)"
+ date_start: !eval "'%s-05-18' %(datetime.now().year)"
+ trial_date_end: !eval "'%s-03-01' %(datetime.now().year)"
+ trial_date_start: !eval "'%s-04-30' %(datetime.now().year)"
+ name: contract1
+ wage: 1.0
+ wage_type_id: hr_contract_monthly_gross
+ type_id: hr_contract_type_emp
+ working_hours: resource.timesheet_group1
+-
+ I check the hourly wage on date of the employee.
+-
+ !python {model: hr.employee}: |
+ uid = ref('base.user_root')
+ from datetime import datetime
+ hourly_wage_on_date = self.get_hourly_wage_on_date(cr, uid, [ref('hr_employee_employee0')], '%s-05-19' %(datetime.now().year))
+ assert abs(hourly_wage_on_date[ref('hr_employee_employee0')]+0.0107142) < 0.00001
+-
+ I check the hourly_wage on the contract
+-
+ !assert {model: hr.contract, id: hr_contract_contract0}:
+ - abs(hourly_wage+0.0107142) < 0.00001
+
+
=== added directory 'hr_timesheet_cost_contract'
=== added file 'hr_timesheet_cost_contract/__init__.py'
--- hr_timesheet_cost_contract/__init__.py 1970-01-01 00:00:00 +0000
+++ hr_timesheet_cost_contract/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Authors: Stéphane Bidoul & Olivier Laurent
+# Copyright (c) 2012 Acsone SA/NV (http://www.acsone.eu)
+# All Rights Reserved
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs.
+# End users who are looking for a ready-to-use solution with commercial
+# guarantees and support are strongly advised to contact a Free Software
+# Service Company.
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import hr_timesheet_cost_contract
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'hr_timesheet_cost_contract/__openerp__.py'
--- hr_timesheet_cost_contract/__openerp__.py 1970-01-01 00:00:00 +0000
+++ hr_timesheet_cost_contract/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Authors: Stéphane Bidoul & Olivier Laurent
+# Copyright (c) 2012 Acsone SA/NV (http://www.acsone.eu)
+# All Rights Reserved
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs.
+# End users who are looking for a ready-to-use solution with commercial
+# guarantees and support are strongly advised to contact a Free Software
+# Service Company.
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+{
+ "name" : "HR Timesheet cost based on contract",
+ "version": "1.0",
+ "author": "ACSONE SA/NV",
+ "maintainer": "ACSONE SA/NV",
+ "website": "http://www.acsone.eu",
+ "images": [],
+ "category": "Generic Modules/Human Resources",
+ "complexity": "easy",
+ "depends" : ["hr_contract_wage_type","hr_timesheet_sheet"],
+ "module": "",
+ "description": """
+HR Timesheet cost based on contract
+===================================
+
+Compute the cost of an employee for his timesheets according
+to his contract definitions. The effective cost is calculated when
+timesheet is 'Confirmed'. If no contract are defined, an exception
+is raised.
+
+This module is inspired from extra-trunk/hr_contract_timesheet that
+updates the cost each time the unit_amount is changed but does
+not warn if no contract exists.
+
+Other known similar module:
+* extra-trunk/project_timesheet_contract relies on project.task.work
+
+What we do here:
+* update the cost when the timesheet is confirmed (i.e. submitted)
+* prevent submission if no contract exists for the corresponding date
+""",
+ "init_xml": [],
+ "update_xml": [],
+ "demo_xml": [],
+ "test": [],
+ "active": False,
+ "licence": "AGPL-3",
+ "installable": True,
+ "auto_install": False,
+ "application": False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'hr_timesheet_cost_contract/hr_timesheet_cost_contract.py'
--- hr_timesheet_cost_contract/hr_timesheet_cost_contract.py 1970-01-01 00:00:00 +0000
+++ hr_timesheet_cost_contract/hr_timesheet_cost_contract.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Authors: Stéphane Bidoul & Olivier Laurent
+# Copyright (c) 2012 Acsone SA/NV (http://www.acsone.eu)
+# All Rights Reserved
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs.
+# End users who are looking for a ready-to-use solution with commercial
+# guarantees and support are strongly advised to contact a Free Software
+# Service Company.
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from openerp import SUPERUSER_ID
+from osv import fields, osv
+
+from tools.translate import _
+
+class hr_timesheet_sheet(osv.Model):
+ _inherit = "hr_timesheet_sheet.sheet"
+
+ def update_timesheets_cost_from_contract(self, cr, uid, ids, context=None):
+ ts_obj = self.pool.get('hr.analytic.timesheet')
+ for sheet in self.browse(cr, uid, ids, context=context):
+ ts_ids = ts_obj.search(cr, uid, [('sheet_id','=',sheet.id)], context=context)
+ ts_obj.update_cost_from_contract(cr, uid, ts_ids, sheet.employee_id.id, context=context)
+
+ def button_confirm(self, cr, uid, ids, context=None):
+ self.update_timesheets_cost_from_contract(cr, SUPERUSER_ID, ids, context=context)
+ return super(hr_timesheet_sheet, self).button_confirm(cr, uid, ids, context=context)
+
+class hr_analytic_timesheet(osv.Model):
+ _inherit = "hr.analytic.timesheet"
+
+ def update_cost_from_contract(self, cr, uid, ids, employee_id, context=None):
+ employee_obj = self.pool.get('hr.employee')
+ for ts in self.browse(cr, uid, ids, context=context):
+ hourly_wage = employee_obj.get_hourly_wage_on_date(cr,uid,[employee_id],ts.date,context=context)[employee_id]
+ if hourly_wage is False:
+ employee = employee_obj.browse(cr, uid, [employee_id], context=context)[0]
+ raise osv.except_osv(_('Error !'), _('No contract defined for employee %s on timesheet date %s') % (employee.name, ts.date))
+ self.write(cr, uid, [ts.id], {'amount': -hourly_wage * ts.unit_amount})
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added directory 'hr_timesheet_cost_contract/i18n'
=== added file 'hr_timesheet_cost_contract/i18n/fr.po'
--- hr_timesheet_cost_contract/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ hr_timesheet_cost_contract/i18n/fr.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,29 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * hr_timesheet_cost_contract
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-10-02 15:04+0000\n"
+"PO-Revision-Date: 2012-10-02 15:04+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: hr_timesheet_cost_contract
+#: code:addons\hr_timesheet_cost_contract\hr_timesheet_cost_contract.py:57
+#, python-format
+msgid "Error !"
+msgstr "Erreur !"
+
+#. module: hr_timesheet_cost_contract
+#: code:addons\hr_timesheet_cost_contract\hr_timesheet_cost_contract.py:57
+#, python-format
+msgid "No contract defined for employee %s on timesheet date %s"
+msgstr "Aucun contrat n'est défini pour l'employé %s à la date de prestation du %s"
+
=== added file 'hr_timesheet_cost_contract/i18n/hr_timesheet_cost_contract.pot'
--- hr_timesheet_cost_contract/i18n/hr_timesheet_cost_contract.pot 1970-01-01 00:00:00 +0000
+++ hr_timesheet_cost_contract/i18n/hr_timesheet_cost_contract.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,29 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * hr_timesheet_cost_contract
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-10-02 15:04+0000\n"
+"PO-Revision-Date: 2012-10-02 15:04+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: hr_timesheet_cost_contract
+#: code:addons\hr_timesheet_cost_contract\hr_timesheet_cost_contract.py:57
+#, python-format
+msgid "Error !"
+msgstr ""
+
+#. module: hr_timesheet_cost_contract
+#: code:addons\hr_timesheet_cost_contract\hr_timesheet_cost_contract.py:57
+#, python-format
+msgid "No contract defined for employee %s on timesheet date %s"
+msgstr ""
+
=== added directory 'project_category'
=== renamed directory 'project_category' => 'project_category.moved'
=== added file 'project_category/__init__.py'
--- project_category/__init__.py 1970-01-01 00:00:00 +0000
+++ project_category/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import analytic_account_category
+import account_analytic_account
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_category/__openerp__.py'
--- project_category/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_category/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# <contact@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+ "name": "Project Management",
+ "version": "1.0",
+ "author": "Eficent, Nervia Consultores",
+ "website": "",
+ "category": "Generic Modules/Projects & Services",
+ "depends": [
+ "base",
+ "account",
+ "analytic",
+ "project",
+ ],
+ "description": """ This module intrododuces the possibility to associate categories to analytic accounts and projects.
+ Manage the analytic account categories in order to better classify them for tracking and analysis purposes.
+ An analytic account may belong to several categories and categories have a hierarchy structure: an analytic account belonging to a category also belong to her parent category.
+ """,
+ "init_xml": [
+ ],
+ "update_xml": [
+ "analytic_account_category.xml",
+ "analytic_account_view.xml",
+ "project_view.xml",
+ "security/ir.model.access.csv",
+ ],
+ 'demo_xml': [
+
+ ],
+ 'test':[
+ ],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_category/account_analytic_account.py'
--- project_category/account_analytic_account.py 1970-01-01 00:00:00 +0000
+++ project_category/account_analytic_account.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,67 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# <contact@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from lxml import etree
+import time
+from datetime import datetime, date, timedelta
+import decimal_precision as dp
+from tools.translate import _
+from osv import fields, osv
+import netsvc
+import tools
+
+class account_analytic_account(osv.osv):
+
+ def _categories_name_calc(self, cr, uid, ids, name, args, context=None):
+
+ if not ids:
+ return []
+ res = []
+
+ accounts_br = self.browse(cr, uid, ids, context=context)
+
+ for account in accounts_br:
+ data =[]
+ categories_br = account.category_id
+ if categories_br:
+ for category_br in categories_br:
+ cat_name = category_br.complete_name or ''
+ data.insert(0, cat_name)
+ data.sort(cmp=None, key=None, reverse=False)
+ data_str = ', '.join(map(tools.ustr,data))
+
+ else:
+ data_str = ''
+
+
+ res.append((account.id, data_str))
+
+ return dict(res)
+
+ _inherit = 'account.analytic.account'
+ _columns = {
+
+ 'category_id': fields.many2many('analytic.account.category', 'analytic_account_category_rel', 'account_id', 'category_id', 'Categories'),
+ 'categories_name_str': fields.function(_categories_name_calc, method=True, type='text', string='Categories', help='Analytic account categories'),
+
+ }
+
+account_analytic_account()
\ No newline at end of file
=== added file 'project_category/analytic_account_category.py'
--- project_category/analytic_account_category.py 1970-01-01 00:00:00 +0000
+++ project_category/analytic_account_category.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# <contact@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import tools
+from osv import fields, osv
+from tools.translate import _
+
+
+class analytic_account_category(osv.osv):
+ def name_get(self, cr, uid, ids, context=None):
+ if not len(ids):
+ return []
+ reads = self.read(cr, uid, ids, ['name','parent_id'], context=context)
+ res = []
+ for record in reads:
+ name = record['name']
+ if record['parent_id']:
+ name = record['parent_id'][1]+' / '+name
+ res.append((record['id'], name))
+ return res
+
+ def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
+ if not args:
+ args=[]
+ if context is None:
+ context={}
+ if name:
+ # Be sure name_search is symetric to name_get
+ name = name.split(' / ')[-1]
+ ids = self.search(cr, uid, [('name', operator, name)] + args, limit=limit, context=context)
+ else:
+ ids = self.search(cr, uid, args, limit=limit, context=context)
+ return self.name_get(cr, uid, ids, context)
+
+
+ def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
+ res = self.name_get(cr, uid, ids, context=context)
+ return dict(res)
+
+ _description='Analytic account & project Categories'
+ _name = 'analytic.account.category'
+ _columns = {
+ 'name': fields.char('Category Name', required=True, size=64, translate=True),
+ 'parent_id': fields.many2one('analytic.account.category', 'Parent Category', select=True, ondelete='cascade'),
+ 'complete_name': fields.function(_name_get_fnc, method=True, type="char", string='Full Name'),
+ 'child_ids': fields.one2many('analytic.account.category', 'parent_id', 'Child Categories'),
+ 'active' : fields.boolean('Active', help="The active field allows you to hide the category without removing it."),
+ 'parent_left' : fields.integer('Left parent', select=True),
+ 'parent_right' : fields.integer('Right parent', select=True),
+ 'account_ids': fields.many2many('account.analytic.account', 'analytic_account_category_rel', 'category_id', 'account_id', 'Categories'),
+ }
+ _constraints = [
+ (osv.osv._check_recursion, 'Error ! You can not create recursive categories.', ['parent_id'])
+ ]
+ _defaults = {
+ 'active' : lambda *a: 1,
+ }
+ _parent_store = True
+ _parent_order = 'name'
+ _order = 'parent_left'
+
+analytic_account_category()
\ No newline at end of file
=== added file 'project_category/analytic_account_category.xml'
--- project_category/analytic_account_category.xml 1970-01-01 00:00:00 +0000
+++ project_category/analytic_account_category.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!--
+ ======================
+ Categories
+ ======================
+ -->
+ <record id="view_analytic_account_category_form" model="ir.ui.view">
+ <field name="name">Analytic Account Categories</field>
+ <field name="model">analytic.account.category</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Analytic Account Category">
+ <field name="name" select="1"/>
+ <field name="active" groups="base.group_erp_manager"/>
+ <field name="parent_id"/>
+ <separator colspan="4" string="Analytic Accounts"/>
+ <field colspan="4" name="account_ids" nolabel="1"/>
+ </form>
+ </field>
+ </record>
+ <record id="view_analytic_account_category_list" model="ir.ui.view">
+ <field name="name">Analytic Account Categories</field>
+ <field name="model">analytic.account.category</field>
+ <field name="type">tree</field>
+ <field eval="6" name="priority"/>
+ <field name="arch" type="xml">
+ <tree string="Analytic Account Categories">
+ <field name="complete_name"/>
+ </tree>
+ </field>
+ </record>
+ <record id="view_analytic_account_category_tree" model="ir.ui.view">
+ <field name="name">analytic.account.category.tree</field>
+ <field name="model">analytic.account.category</field>
+ <field name="type">tree</field>
+ <field name="field_parent">child_ids</field>
+ <field name="arch" type="xml">
+ <tree toolbar="1" string="Analytic Account Categories">
+ <field name="name"/>
+ </tree>
+ </field>
+ </record>
+
+
+ <record id="action_analytic_account_by_category" model="ir.actions.act_window">
+ <field name="name">Analytic Account Categories</field>
+ <field name="res_model">account.analytic.account</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="domain">[('category_id','child_of', [active_id])]</field>
+ <field name="context">{'category_id':active_id}</field>
+ <field name="search_view_id" ref="account.view_account_analytic_account_search"/>
+ </record>
+
+
+ <record id="ir_action_analytic_account_by_category" model="ir.values">
+ <field eval="'tree_but_open'" name="key2"/>
+ <field eval="'analytic.account.category'" name="model"/>
+ <field name="name">Open analytic accounts</field>
+ <field eval="'ir.actions.act_window,%d'%action_analytic_account_by_category" name="value"/>
+ <field eval="True" name="object"/>
+ </record>
+
+ <record id="action_analytic_account_category_form" model="ir.actions.act_window">
+ <field name="name">Analytic Account Categories</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">analytic.account.category</field>
+ <field name="view_type">form</field>
+ <field name="help">Manage the analytic account categories in order to better classify them for tracking and analysis purposes. An analytic account may belong to several categories and categories have a hierarchy structure: an analytic account belonging to a category also belong to her parent category.</field>
+ </record>
+
+ <menuitem action="action_analytic_account_category_form" id="menu_analytic_account_category_form" name="Analytic Account Categories" sequence="4" parent="account.menu_analytic_accounting"/>
+ <menuitem action="action_analytic_account_category_form" id="menu_project_category_form" name="Project Categories" sequence="4" parent="base.menu_definitions"/>
+
+
+ </data>
+</openerp>
=== added file 'project_category/analytic_account_view.xml'
--- project_category/analytic_account_view.xml 1970-01-01 00:00:00 +0000
+++ project_category/analytic_account_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+#---------------------------------------------------------------------------------------------------------
+# Extend the analytic account
+#---------------------------------------------------------------------------------------------------------
+ <record id="view_account_analytic_account_list" model="ir.ui.view">
+ <field name="name">account.analytic.account.list</field>
+ <field name="model">account.analytic.account</field>
+ <field name="type">tree</field>
+ <field eval="8" name="priority"/>
+ <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
+ <field name="arch" type="xml">
+ <field name="code" position="after">
+ <field name="category_id"/>
+ </field>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_account_search" model="ir.ui.view">
+ <field name="name">account.analytic.account.search</field>
+ <field name="model">account.analytic.account</field>
+ <field name="type">search</field>
+ <field name="inherit_id" ref="account.view_account_analytic_account_search"/>
+ <field name="arch" type="xml">
+ <field name="name" position="after">
+ <field name="category_id" select="1"/>
+ </field>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_account_tree" model="ir.ui.view">
+ <field name="name">account.analytic.account.tree</field>
+ <field name="model">account.analytic.account</field>
+ <field name="type">tree</field>
+ <field name="field_parent">child_complete_ids</field>
+ <field name="inherit_id" ref="account.view_account_analytic_account_tree"/>
+ <field name="arch" type="xml">
+ <field name="name" position="after">
+ <field name="categories_name_str"/>
+ </field>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_account_form" model="ir.ui.view">
+ <field name="name">account.analytic.account.form</field>
+ <field name="model">account.analytic.account</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
+ <field name="arch" type="xml">
+ <form string="Analytic Account" version="7.0">
+ <sheet string="Analytic Account">
+ <notebook>
+ <page string="Account Data" position="after">
+ <page string="Categories">
+ <field colspan="4" name="category_id" nolabel="1"/>
+ </page>
+ </page>
+ </notebook>
+ </sheet>
+ </form>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'project_category/i18n'
=== added file 'project_category/i18n/es.po'
--- project_category/i18n/es.po 1970-01-01 00:00:00 +0000
+++ project_category/i18n/es.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,134 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_category
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-10-18 22:49+0000\n"
+"PO-Revision-Date: 2012-10-19 01:04+0100\n"
+"Last-Translator: Jordi Ballester <jordi.ballester@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: project_category
+#: field:analytic.account.category,parent_left:0
+msgid "Left parent"
+msgstr "Padre izquierdo"
+
+#. module: project_category
+#: view:project.project:0
+msgid "Administration"
+msgstr "Administración"
+
+#. module: project_category
+#: field:analytic.account.category,child_ids:0
+msgid "Child Categories"
+msgstr "Categorías hijas"
+
+#. module: project_category
+#: view:analytic.account.category:0
+msgid "Analytic Account Category"
+msgstr "Categoría Cuenta Analítica"
+
+#. module: project_category
+#: field:analytic.account.category,name:0
+msgid "Category Name"
+msgstr "Nombre Categoría"
+
+#. module: project_category
+#: model:ir.actions.act_window,help:project_category.action_analytic_account_category_form
+msgid "Manage the analytic account categories in order to better classify them for tracking and analysis purposes. An analytic account may belong to several categories and categories have a hierarchy structure: an analytic account belonging to a category also belong to her parent category."
+msgstr "Gestione las categorías de cuentas analíticas para clasificarlas mejor con el objetivo de realizar su seguimiento y análisis. Una cuenta analítica puede pertenecer a varias categorías. Éstas conforman una estructura jerárquica, de modo que si una cuenta analítica o proyecto pertenece a una categoría también pertenecerá a la categoría padre."
+
+#. module: project_category
+#: model:ir.ui.menu,name:project_category.menu_project_category_form
+msgid "Project Categories"
+msgstr "Categorías de Proyecto"
+
+#. module: project_category
+#: model:ir.model,name:project_category.model_analytic_account_category
+msgid "Analytic account & project Categories"
+msgstr "Categorías de cuenta analítica y proyecto"
+
+#. module: project_category
+#: view:analytic.account.category:0
+#: model:ir.actions.act_window,name:project_category.action_analytic_account_by_category
+#: model:ir.actions.act_window,name:project_category.action_analytic_account_category_form
+#: model:ir.ui.menu,name:project_category.menu_analytic_account_category_form
+msgid "Analytic Account Categories"
+msgstr "Categorías Cuenta Analítica"
+
+#. module: project_category
+#: field:analytic.account.category,active:0
+msgid "Active"
+msgstr "Activa"
+
+#. module: project_category
+#: view:account.analytic.account:0
+#: field:account.analytic.account,categories_name_str:0
+#: field:account.analytic.account,category_id:0
+#: field:analytic.account.category,account_ids:0
+#: view:project.project:0
+msgid "Categories"
+msgstr "Categorías"
+
+#. module: project_category
+#: view:analytic.account.category:0
+msgid "Analytic Accounts"
+msgstr "Cuentas Analíticas"
+
+#. module: project_category
+#: field:analytic.account.category,parent_id:0
+msgid "Parent Category"
+msgstr "Categoría Padre"
+
+#. module: project_category
+#: constraint:account.analytic.account:0
+msgid "Error! The currency has to be the same as the currency of the selected company"
+msgstr "¡Error! La divisa tiene que ser la misma que la establecida en la compañía seleccionada"
+
+#. module: project_category
+#: field:analytic.account.category,complete_name:0
+msgid "Full Name"
+msgstr "Nombre Completo"
+
+#. module: project_category
+#: view:account.analytic.account:0
+msgid "Account Data"
+msgstr "Datos de la cuenta"
+
+#. module: project_category
+#: constraint:analytic.account.category:0
+msgid "Error ! You can not create recursive categories."
+msgstr "¡Error! No puede crear categorías recursivas."
+
+#. module: project_category
+#: help:account.analytic.account,categories_name_str:0
+msgid "Analytic account categories"
+msgstr "Categorías de cuenta analítica"
+
+#. module: project_category
+#: model:ir.model,name:project_category.model_account_analytic_account
+msgid "Analytic Account"
+msgstr "Cuenta analítica"
+
+#. module: project_category
+#: help:analytic.account.category,active:0
+msgid "The active field allows you to hide the category without removing it."
+msgstr "El campo activo le permite ocultar la categoría sin tener que eliminarla."
+
+#. module: project_category
+#: constraint:account.analytic.account:0
+msgid "Error! You can not create recursive analytic accounts."
+msgstr "¡Error! No puede crear cuentas analíticas recursivas."
+
+#. module: project_category
+#: field:analytic.account.category,parent_right:0
+msgid "Right parent"
+msgstr "Padre derecho"
+
=== added file 'project_category/i18n/project_category.pot'
--- project_category/i18n/project_category.pot 1970-01-01 00:00:00 +0000
+++ project_category/i18n/project_category.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,134 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_category
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-10-18 22:49+0000\n"
+"PO-Revision-Date: 2012-10-18 22:49+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: project_category
+#: field:analytic.account.category,parent_left:0
+msgid "Left parent"
+msgstr ""
+
+#. module: project_category
+#: view:project.project:0
+msgid "Administration"
+msgstr ""
+
+#. module: project_category
+#: field:analytic.account.category,child_ids:0
+msgid "Child Categories"
+msgstr ""
+
+#. module: project_category
+#: view:analytic.account.category:0
+msgid "Analytic Account Category"
+msgstr ""
+
+#. module: project_category
+#: field:analytic.account.category,name:0
+msgid "Category Name"
+msgstr ""
+
+#. module: project_category
+#: model:ir.actions.act_window,help:project_category.action_analytic_account_category_form
+msgid "Manage the analytic account categories in order to better classify them for tracking and analysis purposes. An analytic account may belong to several categories and categories have a hierarchy structure: an analytic account belonging to a category also belong to her parent category."
+msgstr ""
+
+#. module: project_category
+#: model:ir.ui.menu,name:project_category.menu_project_category_form
+msgid "Project Categories"
+msgstr ""
+
+#. module: project_category
+#: model:ir.model,name:project_category.model_analytic_account_category
+msgid "Analytic account & project Categories"
+msgstr ""
+
+#. module: project_category
+#: view:analytic.account.category:0
+#: model:ir.actions.act_window,name:project_category.action_analytic_account_by_category
+#: model:ir.actions.act_window,name:project_category.action_analytic_account_category_form
+#: model:ir.ui.menu,name:project_category.menu_analytic_account_category_form
+msgid "Analytic Account Categories"
+msgstr ""
+
+#. module: project_category
+#: field:analytic.account.category,active:0
+msgid "Active"
+msgstr ""
+
+#. module: project_category
+#: view:account.analytic.account:0
+#: field:account.analytic.account,categories_name_str:0
+#: field:account.analytic.account,category_id:0
+#: field:analytic.account.category,account_ids:0
+#: view:project.project:0
+msgid "Categories"
+msgstr ""
+
+#. module: project_category
+#: view:analytic.account.category:0
+msgid "Analytic Accounts"
+msgstr ""
+
+#. module: project_category
+#: field:analytic.account.category,parent_id:0
+msgid "Parent Category"
+msgstr ""
+
+#. module: project_category
+#: constraint:account.analytic.account:0
+msgid "Error! The currency has to be the same as the currency of the selected company"
+msgstr ""
+
+#. module: project_category
+#: field:analytic.account.category,complete_name:0
+msgid "Full Name"
+msgstr ""
+
+#. module: project_category
+#: view:account.analytic.account:0
+msgid "Account Data"
+msgstr ""
+
+#. module: project_category
+#: constraint:analytic.account.category:0
+msgid "Error ! You can not create recursive categories."
+msgstr ""
+
+#. module: project_category
+#: help:account.analytic.account,categories_name_str:0
+msgid "Analytic account categories"
+msgstr ""
+
+#. module: project_category
+#: model:ir.model,name:project_category.model_account_analytic_account
+msgid "Analytic Account"
+msgstr ""
+
+#. module: project_category
+#: help:analytic.account.category,active:0
+msgid "The active field allows you to hide the category without removing it."
+msgstr ""
+
+#. module: project_category
+#: constraint:account.analytic.account:0
+msgid "Error! You can not create recursive analytic accounts."
+msgstr ""
+
+#. module: project_category
+#: field:analytic.account.category,parent_right:0
+msgid "Right parent"
+msgstr ""
+
=== added file 'project_category/project_view.xml'
--- project_category/project_view.xml 1970-01-01 00:00:00 +0000
+++ project_category/project_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+
+#---------------------------------------------------------------------------------------------------------
+# Extend the project
+#---------------------------------------------------------------------------------------------------------
+
+ <record id="view_project_project_filter" model="ir.ui.view">
+ <field name="name">project.project.select</field>
+ <field name="model">project.project</field>
+ <field name="type">search</field>
+ <field name="inherit_id" ref="project.view_project_project_filter"/>
+ <field name="arch" type="xml">
+ <field name="name" position="after">
+ <field name="category_id" select="1"/>
+ </field>
+ </field>
+ </record>
+
+
+ <record id="view_project" model="ir.ui.view">
+ <field name="name">project.project.tree</field>
+ <field name="model">project.project</field>
+ <field name="type">tree</field>
+ <field name="inherit_id" ref="project.view_project"/>
+ <field name="field_parent">child_ids</field>
+ <field name="arch" type="xml">
+ <field name="name" position="after">
+ <field name="categories_name_str"/>
+ </field>
+ </field>
+ </record>
+
+
+ <record id="edit_project" model="ir.ui.view">
+ <field name="name">project.project.form</field>
+ <field name="model">project.project</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="project.edit_project"/>
+ <field name="arch" type="xml">
+ <page string="Other Info" position="after">
+ <page string="Categories">
+ <field colspan="4" name="category_id" nolabel="1"/>
+ </page>
+ </page>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'project_category/security'
=== added file 'project_category/security/ir.model.access.csv'
--- project_category/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ project_category/security/ir.model.access.csv 2013-01-22 10:02:35 +0000
@@ -0,0 +1,5 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_analytic_account_category_project_user","analytic_account_category project user","model_analytic_account_category","project.group_project_user",1,0,0,0
+"access_analytic_account_category_project_manager","analytic_account_category project manager","model_analytic_account_category","project.group_project_manager",1,1,1,1
+"access_analytic_account_category_account_user","analytic_account_category account user","model_analytic_account_category","account.group_account_user",1,0,0,0
+"access_analytic_account_category_account_manager","analytic_account_category account manager","model_analytic_account_category","account.group_account_manager",1,1,1,1
=== added directory 'project_communications_mailgate'
=== renamed directory 'project_communications_mailgate' => 'project_communications_mailgate.moved'
=== added file 'project_communications_mailgate/__init__.py'
--- project_communications_mailgate/__init__.py 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import project_communications_mailgate
+import project
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_communications_mailgate/__openerp__.py'
--- project_communications_mailgate/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+ "name": "Project MailGateWay for Projects",
+ "version": "1.0",
+ "author": "Eficent, Nervia Consultores",
+ "website": "",
+ "category": "Generic Modules/Projects & Services",
+ "depends": ["project", "mail"],
+ "description": """This module is an interface that synchronises mails with OpenERP Project.
+
+It allows updating projects as soon as a new mail arrives in our configured mail server.
+Moreover, it keeps track of all further communications and project states.
+ """,
+ "init_xml": [],
+ "update_xml": [
+ "project_communications_mailgate_view.xml",
+ ],
+ 'demo_xml': [
+ ],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added directory 'project_communications_mailgate/i18n'
=== added file 'project_communications_mailgate/i18n/es.po'
--- project_communications_mailgate/i18n/es.po 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate/i18n/es.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,102 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_communications_mailgate
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-01-26 13:31+0000\n"
+"PO-Revision-Date: 2012-01-26 14:34+0100\n"
+"Last-Translator: Jordi Ballester <jordi.ballester@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: project_communications_mailgate
+#: view:project.project:0
+msgid "History Information"
+msgstr "Información histórica"
+
+#. module: project_communications_mailgate
+#: model:ir.module.module,description:project_communications_mailgate.module_meta_information
+msgid ""
+"This module is an interface that synchronises mails with OpenERP Project.\n"
+"\n"
+"It allows updating projects as soon as a new mail arrives in our configured mail server.\n"
+"Moreover, it keeps track of all further communications and project states.\n"
+" "
+msgstr "Este módulo es una interfaz que sincroniza los correos con un proyecto en OpenERP.Permite la actualización de los proyectos al llegar un nuevo correo en nuestro servidor de correo configurado.Además, realiza un seguimiento de todas las comunicaciones y los estados del proyecto."
+
+#. module: project_communications_mailgate
+#: view:project.project:0
+msgid "Attachments"
+msgstr "Archivos adjuntos"
+
+#. module: project_communications_mailgate
+#: field:project.project,message_ids:0
+msgid "Messages"
+msgstr "Mensajes"
+
+#. module: project_communications_mailgate
+#: model:ir.model,name:project_communications_mailgate.model_project_project
+msgid "Project"
+msgstr "Proyecto"
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:46
+#, python-format
+msgid "Pending"
+msgstr "Pendiente"
+
+#. module: project_communications_mailgate
+#: model:ir.module.module,shortdesc:project_communications_mailgate.module_meta_information
+msgid "Project MailGateWay for Projects"
+msgstr "Pasarela de correos para proyectos"
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:34
+#, python-format
+msgid "Draft"
+msgstr "Borrador"
+
+#. module: project_communications_mailgate
+#: view:project.project:0
+msgid "Details"
+msgstr "Detalles"
+
+#. module: project_communications_mailgate
+#: constraint:project.project:0
+msgid "Error! You cannot assign escalation to the same project!"
+msgstr "¡Error! No puede asignar un escalado al mismo proyecto."
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:58
+#, python-format
+msgid "Cancel"
+msgstr "Cancelado"
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:52
+#, python-format
+msgid "Done"
+msgstr "Realizado"
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:40
+#, python-format
+msgid "Open"
+msgstr "Abierto"
+
+#. module: project_communications_mailgate
+#: constraint:project.project:0
+msgid "Error! project start-date must be lower then project end-date."
+msgstr "¡Error! La fecha de inicio del proyecto debe ser anterior a la fecha final del proyecto."
+
+#. module: project_communications_mailgate
+#: view:project.project:0
+msgid "History"
+msgstr "Historial"
+
=== added file 'project_communications_mailgate/i18n/project_communications_mailgate.pot'
--- project_communications_mailgate/i18n/project_communications_mailgate.pot 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate/i18n/project_communications_mailgate.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,101 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_communications_mailgate
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-01-26 13:31+0000\n"
+"PO-Revision-Date: 2012-01-26 13:31+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: project_communications_mailgate
+#: view:project.project:0
+msgid "History Information"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: model:ir.module.module,description:project_communications_mailgate.module_meta_information
+msgid "This module is an interface that synchronises mails with OpenERP Project.\n"
+"\n"
+"It allows updating projects as soon as a new mail arrives in our configured mail server.\n"
+"Moreover, it keeps track of all further communications and project states.\n"
+" "
+msgstr ""
+
+#. module: project_communications_mailgate
+#: view:project.project:0
+msgid "Attachments"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: field:project.project,message_ids:0
+msgid "Messages"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: model:ir.model,name:project_communications_mailgate.model_project_project
+msgid "Project"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:46
+#, python-format
+msgid "Pending"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: model:ir.module.module,shortdesc:project_communications_mailgate.module_meta_information
+msgid "Project MailGateWay for Projects"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:34
+#, python-format
+msgid "Draft"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: view:project.project:0
+msgid "Details"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: constraint:project.project:0
+msgid "Error! You cannot assign escalation to the same project!"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:58
+#, python-format
+msgid "Cancel"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:52
+#, python-format
+msgid "Done"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: code:addons/project_communications_mailgate/project.py:40
+#, python-format
+msgid "Open"
+msgstr ""
+
+#. module: project_communications_mailgate
+#: constraint:project.project:0
+msgid "Error! project start-date must be lower then project end-date."
+msgstr ""
+
+#. module: project_communications_mailgate
+#: view:project.project:0
+msgid "History"
+msgstr ""
+
=== added file 'project_communications_mailgate/project.py'
--- project_communications_mailgate/project.py 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate/project.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import orm
+from openerp.tools.translate import _
+
+
+class project(orm.Model):
+
+ _inherit = "project.project"
+
+ def set_draft(self, cr, uid, ids, context=None):
+ res = super(project, self).set_draft(cr, uid, ids, context=context)
+ projects = self.browse(cr, uid, ids, context=context)
+ self.message_append(cr, uid, projects, _('Draft'), context=context)
+ return res
+
+ def set_open(self, cr, uid, ids, context=None):
+ res = super(project, self).set_open(cr, uid, ids, context=context)
+ projects = self.browse(cr, uid, ids, context=context)
+ self.message_append(cr, uid, projects, _('Open'), context=context)
+ return res
+
+ def set_pending(self, cr, uid, ids, context=None):
+ res = super(project, self).set_pending(cr, uid, ids, context=context)
+ projects = self.browse(cr, uid, ids, context=context)
+ self.message_append(cr, uid, projects, _('Pending'), context=context)
+ return res
+
+ def set_done(self, cr, uid, ids, context=None):
+ res = super(project, self).set_done(cr, uid, ids, context=context)
+ projects = self.browse(cr, uid, ids, context=context)
+ self.message_append(cr, uid, projects, _('Done'), context=context)
+ return res
+
+ def set_cancel(self, cr, uid, ids, context=None):
+ res = super(project, self).set_cancel(cr, uid, ids, context=context)
+ projects = self.browse(cr, uid, ids, context=context)
+ self.message_append(cr, uid, projects, _('Cancel'), context=context)
+ return res
+
+
+#project()
+
=== added file 'project_communications_mailgate/project_communications_mailgate.py'
--- project_communications_mailgate/project_communications_mailgate.py 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate/project_communications_mailgate.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, orm
+
+
+class project_communications_mail(orm.Model):
+ _name = "project.project"
+ _inherit = ['mail.thread','project.project']
+
+ _columns={
+ 'message_ids': fields.one2many(
+ 'mail.message', 'res_id', 'Messages',
+ domain=[('model','=',_name)], readonly=True),
+ }
+
+ def message_thread_followers(self, cr, uid, ids, context=None):
+ if not ids:
+ return {}
+ if isinstance(ids, (int, long)):
+ ids= [ids]
+
+ res = {}
+
+ for project in self.browse(cr, uid, select, context=context):
+ user_email = (project.user_id and project.user_id.address_id
+ and project.user_id.address_id.email) or False
+ if user_email:
+ res.setdefault(project.id, []).append(user_email)
+
+ return res
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_communications_mailgate/project_communications_mailgate_view.xml'
--- project_communications_mailgate/project_communications_mailgate_view.xml 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate/project_communications_mailgate_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <openerp>
+ <data>
+ <record id="edit_project" model="ir.ui.view">
+ <field name="name">project.project.form</field>
+ <field name="model">project.project</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="project.edit_project"/>
+ <field name="arch" type="xml">
+ <xpath expr="/form/sheet/notebook/page[@string='Other Info']" position="after">
+ <page string="History">
+ <field name="message_ids" colspan="4" nolabel="1" mode="tree">
+ <tree string="History">
+ <field name="email_from" invisible="1"/>
+ </tree>
+ </field>
+ </page>
+ </xpath>
+ <xpath expr="/form/header/button[@name='set_cancel']" position="after">
+ <!-- attrs="{'invisible': [('email_from', '=', False)]}" -->
+ <button
+ string="Reply"
+ name="%(mail.action_email_compose_message_wizard)d"
+ context="{'mail.compose.message.mode':'reply', 'message_id':active_id}"
+ icon="terp-mail-replied" type="action" />
+ </xpath>
+ </field>
+ </record>
+ </data>
+</openerp>
\ No newline at end of file
=== added directory 'project_communications_mailgate/security'
=== added file 'project_communications_mailgate/security/ir.model.access.csv'
=== added directory 'project_communications_mailgate_note'
=== renamed directory 'project_communications_mailgate_note' => 'project_communications_mailgate_note.moved'
=== added file 'project_communications_mailgate_note/__init__.py'
--- project_communications_mailgate_note/__init__.py 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# project_mailgate_note module for OpenERP, Add buttons to add notes and send mail into history tab
+# Copyright (C) 2011 SYLEAM Info Services (<http://www.Syleam.fr/>)
+# Sylvain Garancher <sylvain.garancher@xxxxxxxxx>
+#
+# This file is a part of project_mailgate_note
+#
+# project_mailgate_note is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# project_mailgate_note is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+import wizard
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_communications_mailgate_note/__openerp__.py'
--- project_communications_mailgate_note/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+ 'name': 'Project Mailgate Note for Projects',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Projects & Services',
+ 'description': """This module allows to add a note or send an email from the history tab in the project form view.""",
+ "author": "Eficent, Nervia Consultores",
+ "website": "",
+ 'depends': [
+ 'base',
+ 'crm',
+ 'project_communications_mailgate',
+ ],
+ 'init_xml': [],
+ 'images': [
+ 'images/accueil.png',
+ 'images/send_mail.png',
+ 'images/history.png',
+ ],
+ 'update_xml': [
+ #'security/ir.model.access.csv',
+ #'wizard/wizard.xml',
+ 'wizard/project_communications_add_note_view.xml',
+ 'wizard/project_communications_send_email_view.xml',
+ 'project_communications_mailgate_note_view.xml',
+ ],
+ 'demo_xml': [],
+ 'test': [],
+ #'external_dependancies': {'python': ['kombu'], 'bin': ['which']},
+ 'installable': True,
+ 'active': False,
+ 'license': 'AGPL-3',
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added directory 'project_communications_mailgate_note/i18n'
=== added file 'project_communications_mailgate_note/i18n/es.po'
--- project_communications_mailgate_note/i18n/es.po 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/i18n/es.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,286 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_communications_mailgate_note
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-09-03 11:48+0000\n"
+"PO-Revision-Date: 2011-09-03 20:03+0100\n"
+"Last-Translator: Jordi Ballester Alomar (Avangard Enterprise Information Systems) <jordi.ballester@xxxxxxxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "In Progress"
+msgstr "En curso"
+
+#. module: project_communications_mailgate_note
+#: help:project.send.mail,email_cc:0
+msgid "These addresses will receive a copy of this email. To modify the permanent CC list, edit the global CC field of this case"
+msgstr "Estas direcciones recibirán una copia de este correo electrónico. Para modificar la lista de CC permanente, edite el campo CC global de este caso"
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,email_from:0
+msgid "From"
+msgstr "De"
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "History Information"
+msgstr "Información de la Historia"
+
+#. module: project_communications_mailgate_note
+#: help:project.send.mail,html:0
+msgid "Select this if you want to send email with HTML formatting."
+msgstr "Seleccione esta opción si desea enviar correo electrónico con formato HTML."
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail.attachment,wizard_id:0
+msgid "Wizard"
+msgstr "Asistente"
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:38
+#: view:project.add.note:0
+#, python-format
+msgid "Note"
+msgstr "Nota"
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,email_to:0
+msgid "To"
+msgstr "Para"
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "Send New Email"
+msgstr "Enviar nuevo mensaje"
+
+#. module: project_communications_mailgate_note
+#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_add_note
+#: view:project.add.note:0
+msgid "Add Note"
+msgstr "Añadir nota"
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Draft"
+msgstr "Borrador"
+
+#. module: project_communications_mailgate_note
+#: view:project.add.note:0
+#: view:project.send.mail:0
+#: field:project.send.mail.attachment,binary:0
+msgid "Attachment"
+msgstr "Fichero adjunto"
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "Reply"
+msgstr "Respuesta"
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,html:0
+msgid "HTML formatting?"
+msgstr "Formato HTML?"
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Pending"
+msgstr "Pendiente"
+
+#. module: project_communications_mailgate_note
+#: view:project.send.mail:0
+msgid " "
+msgstr " "
+
+#. module: project_communications_mailgate_note
+#: field:project.add.note,attachment_ids:0
+#: field:project.send.mail,attachment_ids:0
+msgid "unknown"
+msgstr "desconocido"
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:24
+#, python-format
+msgid "Can not add note!"
+msgstr "No se puede agregar la nota!"
+
+#. module: project_communications_mailgate_note
+#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_reply_mail
+#: view:project.send.mail:0
+msgid "Reply to last Mail"
+msgstr "Responder al último e-mail"
+
+#. module: project_communications_mailgate_note
+#: model:ir.module.module,description:project_communications_mailgate_note.module_meta_information
+msgid "This module allows to add a note or send an email from the history tab in the task form view."
+msgstr "Este módulo permite agregar una nota o enviar un correo electrónico de la ficha de la historia en la vista Formulario de tareas."
+
+#. module: project_communications_mailgate_note
+#: help:project.send.mail,reply_to:0
+msgid "Reply-to of the Sales team defined on this case"
+msgstr "Responder al equipo de ventas que se define en este caso"
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:143
+#, python-format
+msgid "Unable to send mail. Please check SMTP is configured properly."
+msgstr "No se puede enviar por correo. Por favor, compruebe que el SMTP está configurado correctamente."
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,subject:0
+msgid "Subject"
+msgstr "Asunto"
+
+#. module: project_communications_mailgate_note
+#: model:ir.model,name:project_communications_mailgate_note.model_project_add_note
+#: view:project.project:0
+msgid "Add Internal Note"
+msgstr "Añadir nota interna"
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail.attachment,name:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,email_cc:0
+msgid "CC"
+msgstr "CC"
+
+#. module: project_communications_mailgate_note
+#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_send_mail
+#: view:project.send.mail:0
+msgid "Send Mail"
+msgstr "Enviar correo"
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:143
+#, python-format
+msgid "Error!"
+msgstr "Error!"
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:24
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:74
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:169
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:288
+#, python-format
+msgid "Error"
+msgstr "Error"
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Cancelled"
+msgstr "Cancelado"
+
+#. module: project_communications_mailgate_note
+#: field:project.add.note,body:0
+msgid "Note Body"
+msgstr "Cuerpo de la Nota"
+
+#. module: project_communications_mailgate_note
+#: view:project.send.mail:0
+msgid "_Send Reply"
+msgstr "_Enviar Respuesta"
+
+#. module: project_communications_mailgate_note
+#: model:ir.module.module,shortdesc:project_communications_mailgate_note.module_meta_information
+msgid "Project Mailgate Note for Projects"
+msgstr "Project Mailgate Note for Projects"
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "History"
+msgstr "Historia"
+
+#. module: project_communications_mailgate_note
+#: view:project.add.note:0
+#: view:project.project:0
+#: view:project.send.mail:0
+msgid "Attachments"
+msgstr "Ficheros Adjuntos"
+
+#. module: project_communications_mailgate_note
+#: model:ir.model,name:project_communications_mailgate_note.model_project_send_mail_attachment
+msgid "project.send.mail.attachment"
+msgstr "project.send.mail.attachment"
+
+#. module: project_communications_mailgate_note
+#: view:project.send.mail:0
+msgid "_Send"
+msgstr "_Enviar"
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:74
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:169
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:288
+#, python-format
+msgid "Can not send mail!"
+msgstr "No se puede enviar el correo!"
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Unchanged"
+msgstr "Sin cambios"
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,body:0
+msgid "Message Body"
+msgstr "Cuerpo del Mensaje"
+
+#. module: project_communications_mailgate_note
+#: model:ir.model,name:project_communications_mailgate_note.model_project_send_mail
+msgid "Send new email"
+msgstr "Enviar nuevo email"
+
+#. module: project_communications_mailgate_note
+#: view:project.add.note:0
+msgid "_Add"
+msgstr "_Añadir"
+
+#. module: project_communications_mailgate_note
+#: field:project.add.note,state:0
+#: field:project.send.mail,state:0
+msgid "Set New State To"
+msgstr "Fijar Nuevo Estado A"
+
+#. module: project_communications_mailgate_note
+#: view:project.add.note:0
+#: view:project.send.mail:0
+msgid "_Cancel"
+msgstr "_Cancelar"
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Close"
+msgstr "Cerrar"
+
+#. module: project_communications_mailgate_note
+#: view:project.send.mail:0
+msgid "Message"
+msgstr "Mensaje"
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,reply_to:0
+msgid "Reply To"
+msgstr "Responder A"
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "Details"
+msgstr "Detalles"
+
=== added file 'project_communications_mailgate_note/i18n/project_communications_mailgate_note.pot'
--- project_communications_mailgate_note/i18n/project_communications_mailgate_note.pot 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/i18n/project_communications_mailgate_note.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,286 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_communications_mailgate_note
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-09-03 11:48+0000\n"
+"PO-Revision-Date: 2011-09-03 11:48+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "In Progress"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: help:project.send.mail,email_cc:0
+msgid "These addresses will receive a copy of this email. To modify the permanent CC list, edit the global CC field of this case"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,email_from:0
+msgid "From"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "History Information"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: help:project.send.mail,html:0
+msgid "Select this if you want to send email with HTML formatting."
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail.attachment,wizard_id:0
+msgid "Wizard"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:38
+#: view:project.add.note:0
+#, python-format
+msgid "Note"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,email_to:0
+msgid "To"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "Send New Email"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_add_note
+#: view:project.add.note:0
+msgid "Add Note"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.add.note:0
+#: view:project.send.mail:0
+#: field:project.send.mail.attachment,binary:0
+msgid "Attachment"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "Reply"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,html:0
+msgid "HTML formatting?"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Pending"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.send.mail:0
+msgid " "
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.add.note,attachment_ids:0
+#: field:project.send.mail,attachment_ids:0
+msgid "unknown"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:24
+#, python-format
+msgid "Can not add note!"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_reply_mail
+#: view:project.send.mail:0
+msgid "Reply to last Mail"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: model:ir.module.module,description:project_communications_mailgate_note.module_meta_information
+msgid "This module allows to add a note or send an email from the history tab in the task form view."
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: help:project.send.mail,reply_to:0
+msgid "Reply-to of the Sales team defined on this case"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:143
+#, python-format
+msgid "Unable to send mail. Please check SMTP is configured properly."
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,subject:0
+msgid "Subject"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: model:ir.model,name:project_communications_mailgate_note.model_project_add_note
+#: view:project.project:0
+msgid "Add Internal Note"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail.attachment,name:0
+msgid "Name"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,email_cc:0
+msgid "CC"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_send_mail
+#: view:project.send.mail:0
+msgid "Send Mail"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:143
+#, python-format
+msgid "Error!"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:24
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:74
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:169
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:288
+#, python-format
+msgid "Error"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Cancelled"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.add.note,body:0
+msgid "Note Body"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.send.mail:0
+msgid "_Send Reply"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: model:ir.module.module,shortdesc:project_communications_mailgate_note.module_meta_information
+msgid "Project Mailgate Note for Projects"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "History"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.add.note:0
+#: view:project.project:0
+#: view:project.send.mail:0
+msgid "Attachments"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: model:ir.model,name:project_communications_mailgate_note.model_project_send_mail_attachment
+msgid "project.send.mail.attachment"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.send.mail:0
+msgid "_Send"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:74
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:169
+#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:288
+#, python-format
+msgid "Can not send mail!"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Unchanged"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,body:0
+msgid "Message Body"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: model:ir.model,name:project_communications_mailgate_note.model_project_send_mail
+msgid "Send new email"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.add.note:0
+msgid "_Add"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.add.note,state:0
+#: field:project.send.mail,state:0
+msgid "Set New State To"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.add.note:0
+#: view:project.send.mail:0
+msgid "_Cancel"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: selection:project.add.note,state:0
+#: selection:project.send.mail,state:0
+msgid "Close"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.send.mail:0
+msgid "Message"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: field:project.send.mail,reply_to:0
+msgid "Reply To"
+msgstr ""
+
+#. module: project_communications_mailgate_note
+#: view:project.project:0
+msgid "Details"
+msgstr ""
+
=== added directory 'project_communications_mailgate_note/images'
=== added file 'project_communications_mailgate_note/images/accueil.png'
Binary files project_communications_mailgate_note/images/accueil.png 1970-01-01 00:00:00 +0000 and project_communications_mailgate_note/images/accueil.png 2013-01-22 10:02:35 +0000 differ
=== added file 'project_communications_mailgate_note/images/history.png'
Binary files project_communications_mailgate_note/images/history.png 1970-01-01 00:00:00 +0000 and project_communications_mailgate_note/images/history.png 2013-01-22 10:02:35 +0000 differ
=== added file 'project_communications_mailgate_note/images/send_mail.png'
Binary files project_communications_mailgate_note/images/send_mail.png 1970-01-01 00:00:00 +0000 and project_communications_mailgate_note/images/send_mail.png 2013-01-22 10:02:35 +0000 differ
=== added file 'project_communications_mailgate_note/project_communications_mailgate_note_view.xml'
--- project_communications_mailgate_note/project_communications_mailgate_note_view.xml 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/project_communications_mailgate_note_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+ <data>
+
+ <record id="view_project_mailgate_form2" model="ir.ui.view">
+ <field name="name">project.mailgate.form</field>
+ <field name="model">project.project</field>
+ <field name="type">form</field>
+ <field eval="40" name="priority"/>
+ <field name="inherit_id" ref="project.edit_project"/>
+ <field name="arch" type="xml">
+ <xpath expr="/form/sheet/notebook/page[@string='Other Info']" position="replace">
+ <page string="History">
+ <field name="message_ids" colspan="4" nolabel="1" mode="tree">
+ <tree string="History">
+ <field name="email_from" invisible="1"/>
+ <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
+ </tree>
+ </field>
+ </page>
+ </xpath>
+ <xpath expr="/form/header/button[@name='set_cancel']" position="after">
+ <button string="Add Internal Note"
+ name="%(action_project_add_note)d"
+ context="{'model': 'project.project' }"
+ icon="terp-document-new" type="action" />
+ <button string="Send New Email"
+ name="%(action_project_send_mail)d"
+ context="{'mail':'new', 'model': 'project.project'}"
+ icon="terp-mail-message-new" type="action" />
+ </xpath>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'project_communications_mailgate_note/security'
=== added file 'project_communications_mailgate_note/security/ir.model.access.csv'
--- project_communications_mailgate_note/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/security/ir.model.access.csv 2013-01-22 10:02:35 +0000
@@ -0,0 +1,1 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
=== added directory 'project_communications_mailgate_note/wizard'
=== added file 'project_communications_mailgate_note/wizard/__init__.py'
--- project_communications_mailgate_note/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/wizard/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# project_mailgate_note module for OpenERP, Add buttons to add notes and send mail into history tab
+# Copyright (C) 2011 SYLEAM Info Services (<http://www.Syleam.fr/>)
+# Sylvain Garancher <sylvain.garancher@xxxxxxxxx>
+#
+# This file is a part of project_mailgate_note
+#
+# project_mailgate_note is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# project_mailgate_note is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+import project_communications_add_note
+import project_communications_send_email
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_communications_mailgate_note/wizard/project_communications_add_note.py'
--- project_communications_mailgate_note/wizard/project_communications_add_note.py 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/wizard/project_communications_add_note.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,59 @@
+from osv import fields, osv
+from tools.translate import _
+import base64
+
+AVAILABLE_STATES = [('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('close', 'Close'), ('unchanged', 'Unchanged')]
+
+class project_add_note(osv.osv_memory):
+ """Adds a new note to the case."""
+ _name = 'project.add.note'
+ _description = "Add Internal Note"
+
+ _columns = {
+ 'body': fields.text('Note Body', required=True),
+ 'state': fields.selection(AVAILABLE_STATES, string='Set New State To',
+ required=True),
+ 'attachment_ids' : fields.one2many('project.send.mail.attachment', 'wizard_id'),
+ }
+
+ def action_add(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+
+ if not context.get('active_model'):
+ raise osv.except_osv(_('Error'), _('Can not add note!'))
+
+ model = context.get('active_model')
+ case_pool = self.pool.get(model)
+
+ for obj in self.browse(cr, uid, ids, context=context):
+ case_list = case_pool.browse(cr, uid, context['active_ids'],
+ context=context)
+ case = case_list[0]
+ user_obj = self.pool.get('res.users')
+ user_name = user_obj.browse(cr, uid, [uid], context=context)[0].name
+ attach = [
+ (x.name, base64.decodestring(x.binary)) for x in obj.attachment_ids
+ ]
+ case_pool.history(cr, uid, [case], _("Note"), history=False,
+ details=obj.body, email_from=user_name, attach=attach)
+
+ if obj.state == 'unchanged':
+ pass
+ elif obj.state == 'close':
+ case_pool.do_close(cr, uid, [case.id])
+ elif obj.state in ['draft', 'cancel', 'open', 'pending']:
+ act = 'do_' + obj.state
+ getattr(case_pool, act)(cr, uid, [case.id])
+
+ return {'type': 'ir.actions.act_window_close'}
+
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ This function gets default values
+ """
+ return {'state': u'unchanged'}
+
+
+project_add_note()
+
=== added file 'project_communications_mailgate_note/wizard/project_communications_add_note_view.xml'
--- project_communications_mailgate_note/wizard/project_communications_add_note_view.xml 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/wizard/project_communications_add_note_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+
+<!-- Add New Note view -->
+
+ <record model="ir.ui.view" id="project_add_new_note_view">
+ <field name="name">project.new.add.note.form</field>
+ <field name="model">project.add.note</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Add Note" col="4">
+ <separator string="Add Note" colspan="6"/>
+ <notebook colspan="6">
+ <page string="Note">
+ <field name="body" nolabel="1" colspan="4" default_focus="1"/>
+ </page>
+ <page string="Attachments">
+ <field name="attachment_ids" colspan="4" nolabel="1">
+ <form string="Attachment">
+ <field name="binary" filename="name" />
+ <field name="name" />
+ </form>
+ <tree string="Attachments">
+ <field name="name" />
+ </tree>
+ </field>
+ </page>
+ </notebook>
+ <separator string="" colspan="6"/>
+ <group colspan="6" col="4" >
+ <field name="state" />
+ <button string="_Cancel" icon="gtk-cancel" special="cancel" />
+ <button name="action_add" type="object" string="_Add" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+<!-- Add New Note action -->
+
+ <record model="ir.actions.act_window" id="action_project_add_note">
+ <field name="name">Add Note</field>
+ <field name="res_model">project.add.note</field>
+ <field name="domain">[('state','=','unchanged')]</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="project_add_new_note_view"/>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
+
=== added file 'project_communications_mailgate_note/wizard/project_communications_send_email.py'
--- project_communications_mailgate_note/wizard/project_communications_send_email.py 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/wizard/project_communications_send_email.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,292 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+import base64
+import itertools
+import tools
+import re
+
+
+AVAILABLE_STATES = [('unchanged', 'Unchanged'),('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('close', 'Close')]
+
+
+class project_send_new_email_attachment(osv.osv_memory):
+ _name = 'project.send.mail.attachment'
+
+ _columns = {
+ 'binary' : fields.binary('Attachment', required=True),
+ 'name' : fields.char('Name', size=128, required=True),
+ 'wizard_id' : fields.many2one('project.send.mail', 'Wizard', required=True),
+ }
+
+
+
+project_send_new_email_attachment()
+
+class project_send_new_email(osv.osv_memory):
+ """ Sends new email for the case"""
+ _name = "project.send.mail"
+ _description = "Send new email"
+
+ _columns = {
+ 'email_to' : fields.char('To', size=512, required=True),
+ 'email_from' : fields.char('From', size=128, required=True),
+ 'reply_to' : fields.char('Reply To', size=128, required=True, help="Reply-to of the Sales team defined on this case"),
+ 'email_cc' : fields.char('CC', size=512, help="These addresses will receive a copy of this email. To modify the permanent CC list, edit the global CC field of this case"),
+ 'subject': fields.char('Subject', size=512, required=True),
+ 'body': fields.text('Message Body', required=True),
+ 'state': fields.selection(AVAILABLE_STATES, string='Set New State To', required=True),
+ 'attachment_ids' : fields.one2many('project.send.mail.attachment', 'wizard_id'),
+ 'html': fields.boolean('HTML formatting?', help="Select this if you want to send email with HTML formatting."),
+ }
+
+
+ def action_send(self, cr, uid, ids, context=None):
+ """ This sends an email to ALL the addresses of the selected partners.
+ """
+ hist_obj = self.pool.get('mailgate.message')
+
+ if context is None:
+ context = {}
+
+ if not context.get('active_model'):
+ raise osv.except_osv(_('Error'), _('Can not send mail!'))
+
+ model = context.get('active_model')
+ case_pool = self.pool.get(model)
+ res_id = context and context.get('active_id', False) or False
+
+ for obj in self.browse(cr, uid, ids, context=context):
+ attach = [
+ (x.name, base64.decodestring(x.binary)) for x in obj.attachment_ids
+ ]
+
+ subtype = 'plain'
+ message_id = None
+ ref_id = None
+
+ case = case_pool.browse(cr, uid, res_id, context=context)
+ if context.get('mail', 'new') == 'new':
+ if case.message_ids:
+ message_id = case.message_ids[0].message_id
+ elif context.get('mail') == 'forward':
+ # extract attachements from case and emails according to mode
+ attachments = []
+ attach_pool = self.pool.get('ir.attachment')
+ direct_attachments = attach_pool.search(cr, uid, [('res_model', '=', 'crm.lead'), ('res_id', '=', res_id)], context=context)
+ attachments += attach_pool.browse(cr, uid, direct_attachments, context=context)
+ if obj.history in ['latest', 'whole'] and case.message_ids:
+ msgs = case.message_ids
+ if obj.history == 'latest':
+ msgs = msgs[:1]
+ attachments.extend(itertools.chain(*[m.attachment_ids for m in msgs]))
+ attach_all = [(a.datas_fname or a.name, base64.decodestring(a.datas)) for a in attachments if a.datas]
+ attach += attach_all
+
+ else:
+ hist = hist_obj.browse(cr, uid, res_id, context=context)
+ message_id = hist.message_id
+ model = hist.model
+ case_pool = self.pool.get(model)
+ res_id = hist.res_id
+ ref_id = hist.ref_id
+ case = case_pool.browse(cr, uid, res_id, context=context)
+ emails = re.findall(r'([^ ,<@]+@[^> ,]+)', obj.email_to or '')
+ email_cc = re.findall(r'([^ ,<@]+@[^> ,]+)', obj.email_cc or '')
+ emails = filter(None, emails)
+ body = obj.body
+
+ body = body and tools.ustr(body) or ''
+ email_from = getattr(obj, 'email_from', False)
+ x_headers = {}
+ if message_id:
+ x_headers['References'] = "%s" % (message_id)
+
+ if obj.html:
+ subtype = 'html'
+
+ flag = tools.email_send(
+ email_from,
+ emails,
+ obj.subject,
+ body,
+ email_cc=email_cc,
+ attach=attach,
+ subtype=subtype,
+ reply_to=obj.reply_to,
+ openobject_id=str(case.id),
+ x_headers=x_headers
+ )
+
+ if not flag:
+ raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))
+
+ msg_dict = {'new': 'Send', 'reply': 'Reply', 'forward': 'Forward'}
+ case_pool.history(cr, uid, [case], _(msg_dict[context.get('mail', 'new')]), history=True, \
+ email=obj.email_to, details=body, \
+ subject=obj.subject, email_from=email_from, \
+ email_cc=', '.join(email_cc), message_id=message_id, \
+ references=ref_id or message_id, attach=attach)
+ if obj.state == 'unchanged':
+ pass
+ elif obj.state == 'done':
+ case_pool.do_close(cr, uid, [case.id])
+ elif obj.state in ['draft', 'cancel', 'open', 'pending']:
+ act = 'do_' + obj.state
+ getattr(case_pool, act)(cr, uid, [case.id])
+
+ return {'type': 'ir.actions.act_window_close'}
+
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ This function gets default values
+ """
+ if context is None:
+ context = {}
+
+ if not context.get('active_model'):
+ raise osv.except_osv(_('Error'), _('Can not send mail!'))
+
+ res = super(project_send_new_email, self).default_get(cr, uid, fields, context=context)
+
+ if context.get('mail') == 'reply':
+ res.update(self.get_reply_defaults(cr, uid, fields, context=context))
+ return res
+
+ model = context.get('active_model')
+ mod_obj = self.pool.get(model)
+ res_id = context and context.get('active_ids', []) or []
+
+ user_obj = self.pool.get('res.users')
+ user_mail_from = user_obj._get_email_from(cr, uid, [uid], context=context)[uid]
+
+
+ for case in mod_obj.browse(cr, uid, res_id, context=context):
+ if 'email_to' in fields:
+ user_mail_to = ''
+ if case.members:
+ for member in case.members:
+ if not user_mail_to :
+ user_mail_to = user_obj._get_email_from(cr, uid, [member.id], context=context)[member.id]
+ else:
+ user_mail_to += ', ' + user_obj._get_email_from(cr, uid, [member.id], context=context)[member.id]
+ res.update({'email_to': user_mail_to and tools.ustr(user_mail_to) or ''})
+ if 'email_from' in fields:
+ res.update({'email_from': user_mail_from and tools.ustr(user_mail_from) or ''})
+ if 'subject' in fields:
+ if case:
+ subject = '[' + case.complete_name + '] '
+ else:
+ subject = case.name
+ res.update({'subject': tools.ustr(context.get('subject', subject) or '')})
+ if 'email_cc' in fields:
+ user_mail_cc = ''
+ if case:
+ user_mail_cc = user_obj._get_email_from(cr, uid, [case.user_id.id], context=context)[case.user_id.id]
+ res.update({'email_cc': user_mail_cc and tools.ustr(user_mail_cc) or ''})
+ if 'body' in fields:
+ res.update({'body': u'\n'+(tools.ustr(case.user_id.signature or ''))})
+ if 'state' in fields:
+ res.update({'state': u'pending'})
+
+ return res
+
+ def get_reply_defaults(self, cr, uid, fields, context=None):
+ """
+ This function gets default values for reply mail
+ """
+ hist_obj = self.pool.get('mailgate.message')
+ res_ids = context and context.get('active_ids', []) or []
+
+ user_obj = self.pool.get('res.users')
+ user_mail_from = user_obj._get_email_from(cr, uid, [uid], context=context)[uid]
+
+ include_original = context and context.get('include_original', False) or False
+ res = {}
+ for hist in hist_obj.browse(cr, uid, res_ids, context=context):
+ model = hist.model
+
+ # In the case where the project does not exist in the database
+ if not model:
+ return {'type': 'ir.actions.act_window_close'}
+
+ model_pool = self.pool.get(model)
+ res_id = hist.res_id
+ case = model_pool.browse(cr, uid, res_id)
+ if 'email_to' in fields:
+ user_mail_to = ''
+ if case and case.members:
+ for member in case.members:
+ if not user_mail_to :
+ user_mail_to = user_obj._get_email_from(cr, uid, [member.id], context=context)[member.id]
+ else:
+ user_mail_to += ', ' + user_obj._get_email_from(cr, uid, [member.id], context=context)[member.id]
+ res.update({'email_to': user_mail_to and tools.ustr(user_mail_to) or ''})
+ if 'email_from' in fields:
+ res.update({'email_from': user_mail_from and tools.ustr(user_mail_from) or False})
+
+ signature = u'\n' + (tools.ustr(case.user_id.signature or '')) + u'\n'
+ original = [signature]
+
+ if include_original == True and 'body' in fields:
+ header = u'-------- Original Message --------'
+ sender = u'From: %s' %(tools.ustr(hist.email_from or ''))
+ to = u'To: %s' % (tools.ustr(hist.email_to or ''))
+ sentdate = u'Date: %s' % (tools.ustr(hist.date))
+ desc = u'\n%s'%(tools.ustr(hist.description))
+
+ original = [signature, header, sender, to, sentdate, desc]
+
+ res['body']= u'\n' + u'\n'.join(original)
+
+ if 'subject' in fields:
+ res.update({u'subject': u'Re: %s' %(tools.ustr(hist.name or ''))})
+ if 'email_cc' in fields:
+ user_mail_cc = ''
+ if case:
+ user_mail_cc = user_obj._get_email_from(cr, uid, [case.user_id.id], context=context)[case.user_id.id]
+ res.update({'email_cc': user_mail_cc and tools.ustr(user_mail_cc) or ''})
+ if 'state' in fields:
+ res['state'] = u'pending'
+ return res
+
+ def view_init(self, cr, uid, fields_list, context=None):
+ """
+ This function checks for precondition before wizard executes
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param fields: List of fields for default value
+ @param context: A standard dictionary for contextual values
+
+ """
+ if context is None:
+ context = {}
+
+ if not context.get('active_model'):
+ raise osv.except_osv(_('Error'), _('Can not send mail!'))
+ return True
+
+project_send_new_email()
+
=== added file 'project_communications_mailgate_note/wizard/project_communications_send_email_view.xml'
--- project_communications_mailgate_note/wizard/project_communications_send_email_view.xml 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/wizard/project_communications_send_email_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+
+<!-- Send New Mail view -->
+
+ <record model="ir.ui.view" id="project_send_new_mail_view">
+ <field name="name">project.new.send.mail.form</field>
+ <field name="model">project.send.mail</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Send Mail" col="4">
+ <group colspan="4" col="2">
+ <field name="email_from"/>
+ <field name="reply_to"/>
+ <field name="email_to" />
+ <field name="email_cc"/>
+ <field name="subject"/>
+ <field name="html"/>
+ </group>
+ <notebook colspan="6">
+ <page string="Message">
+ <field name="body" nolabel="1" colspan="4" default_focus="1"/>
+ </page>
+ <page string="Attachments">
+ <field name="attachment_ids" colspan="4" nolabel="1">
+ <form string="Attachment">
+ <field name="binary" filename="name" />
+ <field name="name" />
+ </form>
+ <tree string="Attachments">
+ <field name="name" />
+ </tree>
+ </field>
+ </page>
+ </notebook>
+ <separator string="" colspan="6"/>
+ <group colspan="6" col="4" >
+ <field name="state" />
+ <button string="_Cancel" icon="gtk-cancel" special="cancel" />
+ <button name="action_send" type="object" string="_Send" icon="gtk-go-forward" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+<!-- Send New Mail action -->
+
+ <record model="ir.actions.act_window" id="action_project_send_mail">
+ <field name="name">Send Mail</field>
+ <field name="res_model">project.send.mail</field>
+ <field name="domain">[('state','=','unchanged')]</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="project_send_new_mail_view"/>
+ <field name="target">new</field>
+ </record>
+
+
+ <!-- Reply to Mail view -->
+
+ <record model="ir.ui.view" id="project_reply_mail_view">
+ <field name="name">project.mail.reply.form</field>
+ <field name="model">project.send.mail</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Reply to last Mail" col="2">
+ <field name="email_from" />
+ <field name="email_to" />
+ <field name="email_cc" />
+ <field name="subject" />
+ <field name="attachment_ids" colspan="4" nolabel="1">
+ <form string="Attachment">
+ <field name="binary" filename="name" />
+ <field name="name" />
+ </form>
+ <tree string="Attachments">
+ <field name="name" />
+ </tree>
+ </field>
+ <separator string="" colspan="4"/>
+ <field name="body" nolabel="1" colspan="4"/>
+ <separator string=" " colspan="4"/>
+ <group colspan="4" col="3" >
+ <label string=" " />
+ <button string="_Cancel" icon="gtk-cancel" special="cancel" />
+ <button name="action_send" type="object" string="_Send Reply" icon="gtk-go-forward" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+<!-- Reply to Mail action -->
+
+ <record model="ir.actions.act_window" id="action_project_reply_mail">
+ <field name="name">Reply to last Mail</field>
+ <field name="res_model">project.send.mail</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="project_reply_mail_view"/>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
=== added file 'project_communications_mailgate_note/wizard/wizard.xml'
--- project_communications_mailgate_note/wizard/wizard.xml 1970-01-01 00:00:00 +0000
+++ project_communications_mailgate_note/wizard/wizard.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+ <data>
+##############################################################################
+#
+# project_mailgate_note module for OpenERP, Add buttons to add notes and send mail into history tab
+# Copyright (C) 2011 SYLEAM Info Services ([http://www.Syleam.fr/])
+# Sylvain Garancher [sylvain.garancher@xxxxxxxxx]
+#
+# This file is a part of project_mailgate_note
+#
+# project_mailgate_note is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# project_mailgate_note is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see [http://www.gnu.org/licenses/].
+#
+##############################################################################
+
+
+ </data>
+</openerp>
\ No newline at end of file
=== added directory 'project_cost'
=== renamed directory 'project_cost' => 'project_cost.moved'
=== added file 'project_cost/__init__.py'
--- project_cost/__init__.py 1970-01-01 00:00:00 +0000
+++ project_cost/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_analytic_account
+import account_analytic_journal_plan
+import account_analytic_journal_commit
+import account_analytic_line
+import account_analytic_line_plan
+import account_analytic_line_commit
+import report
+import wizard
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost/__openerp__.py'
--- project_cost/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_cost/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ "name": "Project Management",
+ "version": "1.0",
+ "author": "Eficent, Nervia Consultores",
+ "website": "",
+ "category": "Generic Modules/Projects & Services",
+ "depends": ["account","product", "analytic", "board", "project", "purchase","hr_timesheet", "sale"],
+ "description": """Eficent Project Management. Project Cost Planning
+ - A planning analytic journal object is created. It is similar to the analytic journal, but used for planning purposes
+ - The planning analytic journals can be configured
+ - A planning analytic journal lines object is created, with the exceptions of referencing
+ to the planning analytic journal instead of the analytic journal, and considering
+ that the general account is not a required entry.
+ - The new object is visible as a separate entity, accesible from the Accounting area, with the corresponding search, tree, form views.
+ - New analytic account attributes: cumulated planned costs, cummulated planned earnings and cumulated balance.
+ The attributes are calculated based on the planning analytic journal lines.
+ The new attributes are visible on the following views:
+ − Analytic account forms: cumulated planned costs, cumulated planned earnings and cumulated balance
+ − Budget positions: cumulated planned costs
+
+ """,
+ "init_xml": [],
+ "update_xml": [
+ "account_analytic_journal_plan_view.xml",
+ "account_analytic_journal_commit_view.xml",
+ "account_analytic_journal_plan_report.xml",
+ "account_analytic_journal_commit_report.xml",
+ "account_analytic_line_view.xml",
+ "account_analytic_line_plan_view.xml",
+ "account_analytic_line_commit_view.xml",
+ "account_analytic_account_view.xml",
+ "wizard/account_analytic_journal_plan_report_view.xml",
+ "wizard/account_analytic_journal_commit_report_view.xml",
+ "project_view.xml",
+ "security/ir.model.access.csv",
+ "security/project_cost_security.xml",
+ "account_analytic_journal_plan_data.xml",
+ "account_analytic_journal_commit_data.xml",
+ ],
+ 'demo_xml': [
+
+ ],
+ 'test':[
+ ],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost/account_analytic_account.py'
--- project_cost/account_analytic_account.py 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_account.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,212 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from lxml import etree
+import time
+from datetime import datetime, date, timedelta
+import decimal_precision as dp
+from tools.translate import _
+from osv import fields, osv
+import netsvc
+import tools
+
+class account_analytic_account(osv.osv):
+
+ _inherit = 'account.analytic.account'
+
+ def _compute_level_tree_plan(self, cr, uid, ids, child_ids, res, field_names, context=None):
+ def recursive_computation(account_id, res, repeated_account_ids=None):
+ if repeated_account_ids is None:
+ repeated_account_ids = []
+ currency_obj = self.pool.get('res.currency')
+ account = self.browse(cr, uid, account_id)
+ for son in account.child_ids:
+ if son.id in repeated_account_ids:
+ continue
+ res = recursive_computation(son.id, res)
+ repeated_account_ids.append(son.id)
+ for field in field_names:
+ if account.currency_id.id == son.currency_id.id or field=='quantity_plan':
+ res[account.id][field] += res[son.id][field]
+ else:
+ res[account.id][field] += currency_obj.compute(cr, uid, son.currency_id.id, account.currency_id.id, res[son.id][field], context=context)
+ return res
+ for account in self.browse(cr, uid, ids, context=context):
+ if account.id not in child_ids:
+ continue
+ res = recursive_computation(account.id, res)
+ return res
+
+ def _compute_level_tree_commit(self, cr, uid, ids, child_ids, res, field_names, context=None):
+ def recursive_computation(account_id, res, repeated_account_ids=[]):
+ currency_obj = self.pool.get('res.currency')
+ account = self.browse(cr, uid, account_id)
+ for son in account.child_ids:
+ if son.id in repeated_account_ids:
+ continue
+ res = recursive_computation(son.id, res)
+ repeated_account_ids.append(son.id)
+ for field in field_names:
+ if account.currency_id.id == son.currency_id.id or field=='quantity_commit':
+ res[account.id][field] += res[son.id][field]
+ else:
+ res[account.id][field] += currency_obj.compute(cr, uid, son.currency_id.id, account.currency_id.id, res[son.id][field], context=context)
+ return res
+ for account in self.browse(cr, uid, ids, context=context):
+ if account.id not in child_ids:
+ continue
+ res = recursive_computation(account.id, res)
+ return res
+
+ def _debit_credit_bal_qtty_plan(self, cr, uid, ids, name, arg, context=None):
+ res = {}
+ if context is None:
+ context = {}
+ child_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
+ for i in child_ids:
+ res[i] = {}
+ for n in name:
+ res[i][n] = 0.0
+
+ if not child_ids:
+ return res
+
+ where_date = ''
+ where_clause_args = [tuple(child_ids)]
+ if context.get('from_date', False):
+ where_date += " AND l.date >= %s"
+ where_clause_args += [context['from_date']]
+ if context.get('to_date', False):
+ where_date += " AND l.date <= %s"
+ where_clause_args += [context['to_date']]
+ cr.execute("""
+ SELECT a.id,
+ sum(
+ CASE WHEN l.amount > 0
+ THEN l.amount
+ ELSE 0.0
+ END
+ ) as debit,
+ sum(
+ CASE WHEN l.amount < 0
+ THEN -l.amount
+ ELSE 0.0
+ END
+ ) as credit,
+ COALESCE(SUM(l.amount),0) AS balance,
+ COALESCE(SUM(l.unit_amount),0) AS quantity
+ FROM account_analytic_account a
+ LEFT JOIN account_analytic_line_plan l ON (a.id = l.account_id)
+ WHERE a.id IN %s
+ """ + where_date + """
+ GROUP BY a.id""", where_clause_args)
+ for ac_id, debit, credit, balance, quantity in cr.fetchall():
+ res[ac_id] = {'debit_plan': debit, 'credit_plan': credit, 'balance_plan': balance, 'quantity_plan': quantity}
+ return self._compute_level_tree_plan(cr, uid, ids, child_ids, res, ['debit_plan', 'credit_plan', 'balance_plan', 'quantity_plan'], context)
+
+ def _debit_credit_bal_qtty_commit(self, cr, uid, ids, name, arg, context=None):
+ res = {}
+ if context is None:
+ context = {}
+ child_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
+ for i in child_ids:
+ res[i] = {}
+ for n in name:
+ res[i][n] = 0.0
+
+ if not child_ids:
+ return res
+
+ where_date = ''
+ where_clause_args = [tuple(child_ids)]
+ if context.get('from_date', False):
+ where_date += " AND l.date >= %s"
+ where_clause_args += [context['from_date']]
+ if context.get('to_date', False):
+ where_date += " AND l.date <= %s"
+ where_clause_args += [context['to_date']]
+ cr.execute("""
+ SELECT a.id,
+ sum(
+ CASE WHEN l.amount > 0
+ THEN l.amount
+ ELSE 0.0
+ END
+ ) as debit,
+ sum(
+ CASE WHEN l.amount < 0
+ THEN -l.amount
+ ELSE 0.0
+ END
+ ) as credit,
+ COALESCE(SUM(l.amount),0) AS balance,
+ COALESCE(SUM(l.unit_amount),0) AS quantity
+ FROM account_analytic_account a
+ LEFT JOIN account_analytic_line_commit l ON (a.id = l.account_id)
+ WHERE a.id IN %s
+ """ + where_date + """
+ GROUP BY a.id""", where_clause_args)
+ for ac_id, debit, credit, balance, quantity in cr.fetchall():
+ res[ac_id] = {'debit_commit': debit, 'credit_commit': credit, 'balance_commit': balance, 'quantity_commit': quantity}
+ return self._compute_level_tree_commit(cr, uid, ids, child_ids, res, ['debit_commit', 'credit_commit', 'balance_commit', 'quantity_commit'], context)
+
+
+ _columns = {
+
+ #In case that the parent is deleted, we also delete this entity
+ 'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2, ondelete='cascade'),
+
+ 'balance_plan': fields.function(_debit_credit_bal_qtty_plan, method=True, type='float', string='Planned Balance', multi='debit_credit_bal_qtty_plan', digits_compute=dp.get_precision('Account')),
+ 'balance_commit': fields.function(_debit_credit_bal_qtty_commit, method=True, type='float', string='Commitment Balance', multi='debit_credit_bal_qtty_commit', digits_compute=dp.get_precision('Account')),
+ 'debit_plan': fields.function(_debit_credit_bal_qtty_plan, method=True, type='float', string='Planned Debit', multi='debit_credit_bal_qtty_plan', digits_compute=dp.get_precision('Account')),
+ 'debit_commit': fields.function(_debit_credit_bal_qtty_commit, method=True, type='float', string='Planned Commitments', multi='debit_credit_bal_qtty_commit', digits_compute=dp.get_precision('Account')),
+ 'credit_plan': fields.function(_debit_credit_bal_qtty_plan, method=True, type='float', string='Planned Credit', multi='debit_credit_bal_qtty_plan', digits_compute=dp.get_precision('Account')),
+ 'credit_commit': fields.function(_debit_credit_bal_qtty_commit, method=True, type='float', string='Commitments Credit', multi='debit_credit_bal_qtty_commit', digits_compute=dp.get_precision('Account')),
+ 'state': fields.selection([('draft','Draft'),('ready','Ready'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Closed'),('template', 'Template')], 'State', required=True,
+ help='* When an account is created its in \'Draft\' state.\
+ \n* When is ready to be used, it can be in \'Ready\' state.\
+ \n* If any associated partner is there, it can be in \'Open\' state.\
+ \n* If any pending balance is there it can be in \'Pending\'. \
+ \n* And finally when all the transactions are over, it can be in \'Close\' state. \
+ \n* The project can be in either if the states \'Template\' and \'Running\'.\n If it is template then we can make projects based on the template projects. If its in \'Running\' state it is a normal project.\
+ \n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'),
+ 'plan_line_ids': fields.one2many('account.analytic.line.plan', 'account_id', 'Analytic Entries'),
+ 'commit_line_ids': fields.one2many('account.analytic.line.commit', 'account_id', 'Commitment Analytic Entries'),
+
+ }
+
+ _defaults = {
+ 'state': 'draft',
+ }
+
+ def set_ready(self, cr, uid, ids, context=None):
+ self.write(cr, uid, ids, {'state':'ready'}, context=context)
+ return True
+
+ def copy(self, cr, uid, id, default=None, context=None):
+ if default is None:
+ default = {}
+ default['plan_line_ids'] = []
+ default['commit_line_ids'] = []
+ return super(account_analytic_account, self).copy(cr, uid, id, default, context=context)
+
+
+account_analytic_account()
\ No newline at end of file
=== added file 'project_cost/account_analytic_account_view.xml'
--- project_cost/account_analytic_account_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_account_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+#---------------------------------------------------------------------------------------------------------
+# Extend the menus
+#---------------------------------------------------------------------------------------------------------
+ <menuitem id="project_cost_analytic_account_menu"
+ name="Analytic Accounting"
+ parent="project.menu_project_management"
+ sequence="2"
+ groups="analytic.group_analytic_accounting"/>
+
+ <menuitem action="account.action_account_analytic_account_form" id="account_analytic_def_account"
+ parent="project_cost_analytic_account_menu"
+ groups="analytic.group_analytic_accounting"/>
+
+ <menuitem groups="analytic.group_analytic_accounting"
+ action="action_account_analytic_journal_plan_open_form"
+ id="account_analytic_journal_plan_entries_2"
+ parent="project_cost_analytic_account_menu"/>
+
+---------------------------------------------------------------------------------------------------------
+# Extend the analytic account
+#---------------------------------------------------------------------------------------------------------
+
+
+ <record id="view_account_analytic_account_tree_inh" model="ir.ui.view">
+ <field name="name">account.analytic.account.tree</field>
+ <field name="model">account.analytic.account</field>
+ <field name="type">tree</field>
+ <field name="field_parent">child_complete_ids</field>
+ <field name="inherit_id" ref="account.view_account_analytic_account_tree"/>
+ <field name="arch" type="xml">
+ <field name="balance" position="after">
+ <field name="debit_plan"/>
+ <field name="credit_plan"/>
+ <field name="balance_plan"/>
+ <field name="debit_commit"/>
+ <field name="credit_commit"/>
+ <field name="balance_commit"/>
+ </field>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_account_form" model="ir.ui.view">
+ <field name="name">account.analytic.account.form</field>
+ <field name="model">account.analytic.account</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
+ <field name="arch" type="xml">
+ <form string="Analytic Account" version="7.0">
+ <sheet string="Analytic Account">
+ <notebook>
+ <page string="Description" position="after">
+ <page string="Costs">
+ <field colspan="4" name="line_ids" nolabel="1" context="{'default_account_id': active_id}"/>
+ <field colspan="4" name="plan_line_ids" nolabel="1" context="{'default_account_id': active_id}">
+ <tree string="Planned analytic lines">
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="ref" />
+ <field name="name"/>
+ <field name="journal_id" invisible="False"/>
+ <field name="amount" sum="Total" />
+ <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" />
+ <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" />
+ <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
+ <field name="general_account_id" />
+ <field name="user_id" invisible="True"/>
+ </tree>
+ <form string="Planned analytic lines">
+ <group colspan="4" col="6">
+ <field name="name"/>
+ <field name="ref"/>
+ <field name="account_id" invisible="True"/>
+ <field name="journal_id"/>
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Amount" colspan="4"/>
+ <field name="amount" colspan="4"/>
+ <field name="amount_currency" colspan="2"/>
+ <field name="currency_id" colspan="2" nolabel="1"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Product Information" colspan="4"/>
+ <field name="product_id" colspan="4" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="unit_amount" colspan="2" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="product_uom_id" colspan="2" nolabel="1" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ </group>
+ <group colspan="2" col="2" groups="base.group_erp_manager">
+ <separator string="General Accounting" colspan="2"/>
+ <field name="general_account_id"/>
+ <field name="move_id" readonly="1"/>
+ </group>
+ </form>
+ </field>
+ <field colspan="4" name="commit_line_ids" nolabel="1" context="{'default_account_id': active_id}">
+ <tree string="Commitment analytic lines">
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="ref" />
+ <field name="name"/>
+ <field name="journal_id" invisible="False"/>
+ <field name="amount" sum="Total" />
+ <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" />
+ <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" />
+ <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
+ <field name="general_account_id" />
+ <field name="user_id" invisible="True"/>
+ </tree>
+ <form string="Commitment analytic lines">
+ <group colspan="4" col="6">
+ <field name="name"/>
+ <field name="ref"/>
+ <field name="account_id" invisible="True"/>
+ <field name="journal_id"/>
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Amount" colspan="4"/>
+ <field name="amount" colspan="4"/>
+ <field name="amount_currency" colspan="2"/>
+ <field name="currency_id" colspan="2" nolabel="1"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Product Information" colspan="4"/>
+ <field name="product_id" colspan="4" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="unit_amount" colspan="2" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="product_uom_id" colspan="2" nolabel="1" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ </group>
+ <group colspan="2" col="2" groups="base.group_erp_manager">
+ <separator string="General Accounting" colspan="2"/>
+ <field name="general_account_id"/>
+ <field name="move_id" readonly="1"/>
+ </group>
+ </form>
+ </field>
+ </page>
+ </page>
+ </notebook>
+ </sheet>
+ </form>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added file 'project_cost/account_analytic_journal_commit.py'
--- project_cost/account_analytic_journal_commit.py 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_journal_commit.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from lxml import etree
+import time
+from datetime import datetime, date, timedelta
+import decimal_precision as dp
+from tools.translate import _
+from osv import fields, osv
+import netsvc
+import tools
+
+
+
+class account_analytic_journal_commit(osv.osv):
+
+ _name = 'account.analytic.journal.commit'
+ _description = 'Analytic Journal Commitments'
+ _columns = {
+ 'name': fields.char('Commitments Journal Name', size=64, required=True),
+ 'code': fields.char('Commitments Journal Code', size=8),
+ 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
+ 'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
+ 'line_ids': fields.one2many('account.analytic.line.commit', 'journal_id', 'Lines'),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'analytic_journal': fields.many2one('account.analytic.journal', 'Actual Analytic journal', required=False),
+ }
+ _defaults = {
+ 'active': True,
+ 'type': 'general',
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
+ }
+
+
+account_analytic_journal_commit()
=== added file 'project_cost/account_analytic_journal_commit_data.xml'
--- project_cost/account_analytic_journal_commit_data.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_journal_commit_data.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data noupdate="1">
+ <record id="analytic_journal_commit_sale" model="account.analytic.journal.commit">
+ <field name="code">SAL</field>
+ <field name="name">Sales</field>
+ <field name="type">sale</field>
+ </record>
+ <record id="analytic_journal_commit_purchase" model="account.analytic.journal.commit">
+ <field name="code">PUR</field>
+ <field name="name">Purchases</field>
+ <field name="type">purchase</field>
+ </record>
+ <record id="analytic_journal_commit_time" model="account.analytic.journal.commit">
+ <field name="code">TS</field>
+ <field name="name">Timesheet</field>
+ <field name="type">general</field>
+ </record>
+
+ </data>
+</openerp>
=== added file 'project_cost/account_analytic_journal_commit_report.xml'
--- project_cost/account_analytic_journal_commit_report.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_journal_commit_report.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <report auto="False" id="account_analytic_journal_commit_print1" menu="False"
+ model="account.analytic.journal.commit" name="account.analytic.account.journal.commit"
+ rml="project_cost/report/account_analytic_journal_commit.rml" string="Commitments Analytic Journal"/>
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'project_cost/account_analytic_journal_commit_view.xml'
--- project_cost/account_analytic_journal_commit_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_journal_commit_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+#---------------------------------------------------------------------------------------------------------
+# Analytic Journal
+#---------------------------------------------------------------------------------------------------------
+ <record id="view_account_analytic_journal_commit_tree" model="ir.ui.view">
+ <field name="name">account.analytic.journal.commit.tree</field>
+ <field name="model">account.analytic.journal.commit</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Analytic Journal">
+ <field name="code"/>
+ <field name="name"/>
+ <field name="type"/>
+ <field name="analytic_journal"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_journal_commit_search" model="ir.ui.view">
+ <field name="name">account.analytic.journal.commit.search</field>
+ <field name="model">account.analytic.journal.commit</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Analytic Journals">
+ <group>
+ <field name="code"/>
+ <field name="name"/>
+ <field name="type"/>
+ <field name="analytic_journal"/>
+ </group>
+ <newline/>
+ <group expand="0" string="Group By...">
+ <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_journal_commit_form" model="ir.ui.view">
+ <field name="name">account.analytic.journal.commit.form</field>
+ <field name="model">account.analytic.journal.commit</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Analytic Journal">
+ <field name="name" select="1"/>
+ <field name="code" select="1"/>
+ <field name="type" select="2"/>
+ <field name="active" select="2"/>
+ <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+ <field name="analytic_journal"/>
+ </form>
+ </field>
+ </record>
+ <record id="action_account_analytic_journal_commit_form" model="ir.actions.act_window">
+ <field name="name">Commitment Analytic Journals</field>
+ <field name="res_model">account.analytic.journal.commit</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_account_analytic_journal_commit_search" />
+ </record>
+ <menuitem groups="analytic.group_analytic_accounting"
+ action="action_account_analytic_journal_commit_form"
+ id="account_def_analytic_journal_commit"
+ parent="account.menu_analytic_accounting" sequence="6"/>
+
+
+#---------------------------------------------------------------------------------------------------------
+# Reporting
+#---------------------------------------------------------------------------------------------------------
+
+ <record id="action_account_analytic_journal_commit_tree" model="ir.actions.act_window">
+ <field name="name">Print Commitment Analytic Journals</field>
+ <field name="res_model">account.analytic.journal.commit</field>
+ <field name="view_type">tree</field>
+ <field name="help">To print a commitments analytics (or costs) journal for a given period. The report give code, move name, account number, general amount and analytic amount.</field>
+ </record>
+ <menuitem groups="analytic.group_analytic_accounting"
+ action="action_account_analytic_journal_commit_tree"
+ id="account_analytic_journal_commit_print" parent="account.next_id_40"/>
+
+
+ </data>
+</openerp>
=== added file 'project_cost/account_analytic_journal_plan.py'
--- project_cost/account_analytic_journal_plan.py 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_journal_plan.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from lxml import etree
+import time
+from datetime import datetime, date, timedelta
+import decimal_precision as dp
+from tools.translate import _
+from osv import fields, osv
+import netsvc
+import tools
+
+
+
+class account_analytic_journal_plan(osv.osv):
+
+ _name = 'account.analytic.journal.plan'
+ _description = 'Analytic Journal Plan'
+ _columns = {
+ 'name': fields.char('Planning Journal Name', size=64, required=True),
+ 'code': fields.char('Planning Journal Code', size=8),
+ 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
+ 'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
+ 'line_ids': fields.one2many('account.analytic.line.plan', 'journal_id', 'Lines'),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'analytic_journal': fields.many2one('account.analytic.journal', 'Actual Analytic journal', required=False),
+
+ }
+ _defaults = {
+ 'active': True,
+ 'type': 'general',
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
+ }
+
+
+account_analytic_journal_plan()
+
=== added file 'project_cost/account_analytic_journal_plan_data.xml'
--- project_cost/account_analytic_journal_plan_data.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_journal_plan_data.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data noupdate="1">
+ <record id="analytic_journal_plan_sale" model="account.analytic.journal.plan">
+ <field name="code">SAL</field>
+ <field name="name">Sales</field>
+ <field name="type">sale</field>
+ </record>
+ <record id="analytic_journal_plan_purchase" model="account.analytic.journal.plan">
+ <field name="code">PUR</field>
+ <field name="name">Purchases</field>
+ <field name="type">purchase</field>
+ </record>
+ <record id="analytic_journal_plan_time" model="account.analytic.journal.plan">
+ <field name="code">TS</field>
+ <field name="name">Timesheet</field>
+ <field name="type">general</field>
+ </record>
+
+ </data>
+</openerp>
=== added file 'project_cost/account_analytic_journal_plan_report.xml'
--- project_cost/account_analytic_journal_plan_report.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_journal_plan_report.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <report auto="False" id="account_analytic_journal_plan_print1" menu="False"
+ model="account.analytic.journal.plan" name="account.analytic.account.journal.plan"
+ rml="project_cost/report/account_analytic_journal_plan.rml" string="Planning Analytic Journal"/>
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'project_cost/account_analytic_journal_plan_view.xml'
--- project_cost/account_analytic_journal_plan_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_journal_plan_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+#---------------------------------------------------------------------------------------------------------
+# Analytic Journal
+#---------------------------------------------------------------------------------------------------------
+ <record id="view_account_analytic_journal_plan_tree" model="ir.ui.view">
+ <field name="name">account.analytic.journal.plan.tree</field>
+ <field name="model">account.analytic.journal.plan</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Analytic Journal">
+ <field name="code"/>
+ <field name="name"/>
+ <field name="type"/>
+ <field name="analytic_journal"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_journal_plan_search" model="ir.ui.view">
+ <field name="name">account.analytic.journal.plan.search</field>
+ <field name="model">account.analytic.journal.plan</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Analytic Journals">
+ <group>
+ <field name="code"/>
+ <field name="name"/>
+ <field name="type"/>
+ <field name="analytic_journal"/>
+ </group>
+ <newline/>
+ <group expand="0" string="Group By...">
+ <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_journal_plan_form" model="ir.ui.view">
+ <field name="name">account.analytic.journal.plan.form</field>
+ <field name="model">account.analytic.journal.plan</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Analytic Journal">
+ <field name="name" select="1"/>
+ <field name="code" select="1"/>
+ <field name="type" select="2"/>
+ <field name="active" select="2"/>
+ <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+ <field name="analytic_journal"/>
+ </form>
+ </field>
+ </record>
+ <record id="action_account_analytic_journal_plan_form" model="ir.actions.act_window">
+ <field name="name">Planning Analytic Journals</field>
+ <field name="res_model">account.analytic.journal.plan</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_account_analytic_journal_plan_search" />
+ </record>
+ <menuitem groups="analytic.group_analytic_accounting"
+ action="action_account_analytic_journal_plan_form"
+ id="account_def_analytic_journal_plan"
+ parent="account.menu_analytic_accounting" sequence="6"/>
+
+
+#---------------------------------------------------------------------------------------------------------
+# Reporting
+#---------------------------------------------------------------------------------------------------------
+
+ <record id="action_account_analytic_journal_plan_tree" model="ir.actions.act_window">
+ <field name="name">Print Planning Analytic Journals</field>
+ <field name="res_model">account.analytic.journal.plan</field>
+ <field name="view_type">tree</field>
+ <field name="help">To print a planning analytics (or costs) journal for a given period. The report give code, move name, account number, general amount and analytic amount.</field>
+ </record>
+ <menuitem groups="analytic.group_analytic_accounting"
+ action="action_account_analytic_journal_plan_tree"
+ id="account_analytic_journal_plan_print" parent="account.next_id_40"/>
+
+
+ </data>
+</openerp>
=== added file 'project_cost/account_analytic_line.py'
--- project_cost/account_analytic_line.py 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_line.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+import time
+
+from osv import fields
+from osv import osv
+from tools.translate import _
+
+
+
+class account_analytic_line(osv.osv):
+
+ _inherit = 'account.analytic.line'
+
+ def _get_period(self, cr, uid, context=None):
+ periods = self.pool.get('account.period').find(cr, uid)
+ if periods:
+ return periods[0]
+ return False
+
+ _columns = {
+ 'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
+ }
+
+ _defaults = {
+ 'period_id': _get_period,
+ }
+
+
+account_analytic_line()
\ No newline at end of file
=== added file 'project_cost/account_analytic_line_commit.py'
--- project_cost/account_analytic_line_commit.py 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_line_commit.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,184 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from lxml import etree
+import time
+from datetime import datetime, date, timedelta
+import decimal_precision as dp
+from tools.translate import _
+from osv import fields, osv
+import netsvc
+import tools
+
+class account_analytic_line_commit(osv.osv):
+ _name = 'account.analytic.line.commit'
+ _description = 'Analytic Line Commitment'
+
+
+
+ def _get_period(self, cr, uid, context=None):
+ periods = self.pool.get('account.period').find(cr, uid)
+ if periods:
+ return periods[0]
+ return False
+
+ _columns = {
+ 'name': fields.char('Description', size=256, required=True),
+ 'date': fields.date('Date', required=True, select=True),
+ 'amount': fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.', digits_compute=dp.get_precision('Account')),
+ 'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.'),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True, domain=[('type','<>','view')]),
+ 'user_id': fields.many2one('res.users', 'User'),
+ 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
+ 'product_uom_id': fields.many2one('product.uom', 'UoM'),
+ 'product_id': fields.many2one('product.product', 'Product'),
+ 'general_account_id': fields.many2one('account.account', 'General Account', required=False, ondelete='restrict'),
+ 'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='restrict', select=True),
+ 'journal_id': fields.many2one('account.analytic.journal.commit', 'Commitment Analytic Journal', required=True, ondelete='restrict', select=True),
+ 'code': fields.char('Code', size=8),
+ 'ref': fields.char('Ref.', size=64),
+ 'currency_id': fields.many2one('res.currency', 'Currency'),
+ 'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')),
+ 'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
+
+ }
+
+ _defaults = {
+ 'date': lambda *a: time.strftime('%Y-%m-%d'),
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
+ 'amount': 0.00,
+ 'period_id': _get_period,
+ }
+ _order = 'date desc'
+
+ def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
+ if context is None:
+ context = {}
+ if context.get('from_date',False):
+ args.append(['date', '>=', context['from_date']])
+ if context.get('to_date',False):
+ args.append(['date','<=', context['to_date']])
+ return super(account_analytic_line_commit, self).search(cr, uid, args, offset, limit,
+ order, context=context, count=count)
+
+ def _check_company(self, cr, uid, ids, context=None):
+ lines = self.browse(cr, uid, ids, context=context)
+ for l in lines:
+ if l.move_id and not l.account_id.company_id.id == l.move_id.account_id.company_id.id:
+ return False
+ return True
+
+ # Compute the cost based on the price type define into company
+ # property_valuation_price_type property
+ def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, company_id,
+ unit=False, journal_id=False, context=None):
+
+ res={}
+
+ if context==None:
+ context={}
+
+ product_obj = self.pool.get('product.product')
+
+ if prod_id:
+ prod = product_obj.browse(cr, uid, prod_id, context=context)
+ res['value']={ }
+# 'product_uom_id': prod.uom_id.id,
+# 'unit_amount': quantity or 1.0
+# }
+
+ if not journal_id:
+ j_ids = self.pool.get('account.analytic.journal.commit').search(cr, uid, [('type','=','purchase')])
+ journal_id = j_ids and j_ids[0] or False
+ if not journal_id or not prod_id:
+ return res
+
+ analytic_journal_obj =self.pool.get('account.analytic.journal.commit')
+ product_price_type_obj = self.pool.get('product.price.type')
+ j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
+
+ result = 0.0
+
+ if j_id.type <> 'sale':
+ a = prod.product_tmpl_id.property_account_expense.id
+ if not a:
+ a = prod.categ_id.property_account_expense_categ.id
+ if not a:
+ raise osv.except_osv(_('Error !'),
+ _('There is no expense account defined ' \
+ 'for this product: "%s" (id:%d)') % \
+ (prod.name, prod.id,))
+ else:
+ a = prod.product_tmpl_id.property_account_income.id
+ if not a:
+ a = prod.categ_id.property_account_income_categ.id
+ if not a:
+ raise osv.except_osv(_('Error !'),
+ _('There is no income account defined ' \
+ 'for this product: "%s" (id:%d)') % \
+ (prod.name, prod_id,))
+
+ flag = False
+ # Compute based on pricetype
+ product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context=context)
+ pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
+ if journal_id:
+ journal = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
+ if journal.type == 'sale':
+ product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
+ if product_price_type_ids:
+ pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
+ # Take the company currency as the reference one
+ if pricetype.field == 'list_price':
+ flag = True
+ ctx = context.copy()
+ if unit:
+ # price_get() will respect a 'uom' in its context, in order
+ # to return a default price for those units
+ ctx['uom'] = unit
+ amount_unit = prod.price_get(pricetype.field, context=ctx)[prod.id]
+ prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
+ amount = amount_unit * quantity or 1.0
+ result = round(amount, prec)
+
+ if not flag:
+ result *= -1
+
+ res['value'].update({
+ 'amount': result,
+ 'general_account_id': a,
+ })
+
+ return res
+
+ def view_header_get(self, cr, user, view_id, view_type, context=None):
+ if context is None:
+ context = {}
+ if context.get('account_id', False):
+ # account_id in context may also be pointing to an account.account.id
+ cr.execute('select name from account_analytic_account where id=%s', (context['account_id'],))
+ res = cr.fetchone()
+ if res:
+ res = _('Entries: ')+ (res[0] or '')
+ return res
+ return False
+
+account_analytic_line_commit()
\ No newline at end of file
=== added file 'project_cost/account_analytic_line_commit_view.xml'
--- project_cost/account_analytic_line_commit_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_line_commit_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+#---------------------------------------------------------------------------------------------------------
+# Add Commitment analytic account lines
+#---------------------------------------------------------------------------------------------------------
+ <record id="view_account_analytic_line_commit_form" model="ir.ui.view">
+ <field name="name">account.analytic.line.commit.form</field>
+ <field name="model">account.analytic.line.commit</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Analytic Entry">
+ <group colspan="4" col="6">
+ <field name="name"/>
+ <field name="ref"/>
+ <field name="account_id"/>
+ <field name="journal_id"/>
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Amount" colspan="4"/>
+ <field name="amount" colspan="4"/>
+ <field name="amount_currency" colspan="2"/>
+ <field name="currency_id" colspan="2" nolabel="1"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Product Information" colspan="4"/>
+ <field name="product_id" colspan="4"/>
+ <field name="unit_amount" colspan="2"/>
+ <field name="product_uom_id" colspan="2" nolabel="1"/>
+ <field name="user_id" colspan="2"/>
+ </group>
+ </form>
+ </field>
+ </record>
+ <record id="view_account_analytic_line_commit_tree" model="ir.ui.view">
+ <field name="name">account.analytic.line.commit.tree</field>
+ <field name="model">account.analytic.line.commit</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree editable="top" string="Analytic Entries">
+ <field name="date"/>
+ <field name="ref" invisible="False"/>
+ <field name="name"/>
+ <field name="journal_id" invisible="False"/>
+ <field name="amount" sum="Total" invisible="False"/>
+ <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" invisible="False"/>
+ <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" invisible="False"/>
+ <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" invisible="False"/>
+ <field domain="[('type','=','normal')]" name="account_id"/>
+ <field name="user_id" invisible="1"/>
+ </tree>
+ </field>
+ </record>
+ <record id="view_account_analytic_line_commit_filter" model="ir.ui.view">
+ <field name="name">account.analytic.line.commit.select</field>
+ <field name="model">account.analytic.line.commit</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Search Analytic Lines">
+ <group col='6' colspan='4'>
+ <field name="date"/>
+ <field name="name"/>
+ <field name="account_id"/>
+ <field name="user_id"/>
+ </group>
+ <newline/>
+ <group expand="0" string="Extended Filters...">
+ <field name="journal_id" widget="selection"/>
+ <field name="product_id" widget="selection"/>
+ <field name="amount" select="1"/>
+ </group>
+ <newline/>
+ </search>
+ </field>
+ </record>
+ <record id="action_account_analytic_line_commit_form" model="ir.actions.act_window">
+ <field name="name">Commitment Analytic Entries</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">account.analytic.line.commit</field>
+ <field name="view_type">form</field>
+ <field name="context">{"search_default_user_id":uid}</field>
+ <field name="view_id" ref="view_account_analytic_line_commit_tree"/>
+ </record>
+
+
+#---------------------------------------------------------------------------------------------------------
+# Open journal entries
+#---------------------------------------------------------------------------------------------------------
+
+ <record id="action_account_analytic_journal_commit_open_form" model="ir.actions.act_window">
+ <field name="name">Analytic Journal Commitment Items</field>
+ <field name="res_model">account.analytic.line.commit</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_account_analytic_line_commit_filter" />
+ </record>
+ <menuitem groups="analytic.group_analytic_accounting"
+ action="action_account_analytic_journal_commit_open_form"
+ id="account_analytic_journal_commit_entries"
+ parent="account.menu_finance_entries"
+ sequence="7"/>
+
+
+ </data>
+</openerp>
=== added file 'project_cost/account_analytic_line_plan.py'
--- project_cost/account_analytic_line_plan.py 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_line_plan.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,186 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from lxml import etree
+import time
+from datetime import datetime, date, timedelta
+import decimal_precision as dp
+from tools.translate import _
+from osv import fields, osv
+import netsvc
+import tools
+
+class account_analytic_line_plan(osv.osv):
+ _name = 'account.analytic.line.plan'
+ _description = 'Analytic Line Plan'
+
+
+
+ def _get_period(self, cr, uid, context=None):
+ periods = self.pool.get('account.period').find(cr, uid)
+ if periods:
+ return periods[0]
+ return False
+
+ _columns = {
+ 'name': fields.char('Description', size=256, required=True),
+ 'date': fields.date('Date', required=True, select=True),
+ 'amount': fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.', digits_compute=dp.get_precision('Account')),
+ 'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.'),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True, domain=[('type','<>','view')]),
+ 'user_id': fields.many2one('res.users', 'User'),
+ 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
+ 'product_uom_id': fields.many2one('product.uom', 'UoM'),
+ 'product_id': fields.many2one('product.product', 'Product'),
+ 'general_account_id': fields.many2one('account.account', 'General Account', required=False, ondelete='restrict'),
+ 'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='restrict', select=True),
+ 'journal_id': fields.many2one('account.analytic.journal.plan', 'Planning Analytic Journal', required=True, ondelete='restrict', select=True),
+ 'code': fields.char('Code', size=8),
+ 'ref': fields.char('Ref.', size=64),
+ 'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
+ 'amount_currency': fields.related('move_id', 'amount_currency', type='float', string='Amount currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True),
+ 'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
+ 'notes': fields.text('Notes'),
+ }
+
+ _defaults = {
+ 'date': lambda *a: time.strftime('%Y-%m-%d'),
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
+ 'amount': 0.00,
+ 'period_id': _get_period,
+ 'journal_id': lambda self, cr, uid, context : context['journal_id'] if context and 'journal_id' in context else None,
+ }
+ _order = 'date desc'
+
+ def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
+ if context is None:
+ context = {}
+ if context.get('from_date',False):
+ args.append(['date', '>=', context['from_date']])
+ if context.get('to_date',False):
+ args.append(['date','<=', context['to_date']])
+ return super(account_analytic_line_plan, self).search(cr, uid, args, offset, limit,
+ order, context=context, count=count)
+
+ def _check_company(self, cr, uid, ids, context=None):
+ lines = self.browse(cr, uid, ids, context=context)
+ for l in lines:
+ if l.move_id and not l.account_id.company_id.id == l.move_id.account_id.company_id.id:
+ return False
+ return True
+
+ # Compute the cost based on the price type define into company
+ # property_valuation_price_type property
+ def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, company_id,
+ unit=False, journal_id=False, context=None):
+
+ res={}
+
+ if context==None:
+ context={}
+
+ product_obj = self.pool.get('product.product')
+
+ if prod_id:
+ prod = product_obj.browse(cr, uid, prod_id, context=context)
+ res['value']={ }
+# 'product_uom_id': prod.uom_id.id,
+# 'unit_amount': quantity or 1.0
+# }
+
+ if not journal_id:
+ j_ids = self.pool.get('account.analytic.journal.plan').search(cr, uid, [('type','=','purchase')])
+ journal_id = j_ids and j_ids[0] or False
+ if not journal_id or not prod_id:
+ return res
+
+ analytic_journal_obj =self.pool.get('account.analytic.journal.plan')
+ product_price_type_obj = self.pool.get('product.price.type')
+ j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
+
+ result = 0.0
+
+ if j_id.type <> 'sale':
+ a = prod.product_tmpl_id.property_account_expense.id
+ if not a:
+ a = prod.categ_id.property_account_expense_categ.id
+ if not a:
+ raise osv.except_osv(_('Error !'),
+ _('There is no expense account defined ' \
+ 'for this product: "%s" (id:%d)') % \
+ (prod.name, prod.id,))
+ else:
+ a = prod.product_tmpl_id.property_account_income.id
+ if not a:
+ a = prod.categ_id.property_account_income_categ.id
+ if not a:
+ raise osv.except_osv(_('Error !'),
+ _('There is no income account defined ' \
+ 'for this product: "%s" (id:%d)') % \
+ (prod.name, prod_id,))
+
+ flag = False
+ # Compute based on pricetype
+ product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context=context)
+ pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
+ if journal_id:
+ journal = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
+ if journal.type == 'sale':
+ product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
+ if product_price_type_ids:
+ pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
+ # Take the company currency as the reference one
+ if pricetype.field == 'list_price':
+ flag = True
+ ctx = context.copy()
+ if unit:
+ # price_get() will respect a 'uom' in its context, in order
+ # to return a default price for those units
+ ctx['uom'] = unit
+ amount_unit = prod.price_get(pricetype.field, context=ctx)[prod.id]
+ prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
+ amount = amount_unit * quantity or 1.0
+ result = round(amount, prec)
+
+ if not flag:
+ result *= -1
+
+ res['value'].update({
+ 'amount': result,
+ 'general_account_id': a,
+ })
+
+ return res
+
+ def view_header_get(self, cr, user, view_id, view_type, context=None):
+ if context is None:
+ context = {}
+ if context.get('account_id', False):
+ # account_id in context may also be pointing to an account.account.id
+ cr.execute('select name from account_analytic_account where id=%s', (context['account_id'],))
+ res = cr.fetchone()
+ if res:
+ res = _('Entries: ')+ (res[0] or '')
+ return res
+
+ return False
+
+account_analytic_line_plan()
\ No newline at end of file
=== added file 'project_cost/account_analytic_line_plan_view.xml'
--- project_cost/account_analytic_line_plan_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_line_plan_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+#---------------------------------------------------------------------------------------------------------
+# Add Plan analytic account lines
+#---------------------------------------------------------------------------------------------------------
+ <record id="view_account_analytic_line_plan_form" model="ir.ui.view">
+ <field name="name">account.analytic.line.plan.form</field>
+ <field name="model">account.analytic.line.plan</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Analytic Entry">
+ <group colspan="4" col="6">
+ <field name="name"/>
+ <field name="ref"/>
+ <field name="account_id"/>
+ <field name="journal_id"/>
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Amount" colspan="4"/>
+ <field name="amount" colspan="4"/>
+ <field name="amount_currency" colspan="2"/>
+ <field name="currency_id" colspan="2" nolabel="1"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Product Information" colspan="4"/>
+ <field name="product_id" colspan="4"/>
+ <field name="unit_amount" colspan="2"/>
+ <field name="product_uom_id" colspan="2" nolabel="1"/>
+ <field name="user_id" colspan="2"/>
+ </group>
+ <group colspan="2" col="2" groups="base.group_erp_manager">
+ <separator string="General Accounting" colspan="2"/>
+ <field name="general_account_id"/>
+ <field name="move_id" readonly="1"/>
+ </group>
+ </form>
+ </field>
+ </record>
+ <record id="view_account_analytic_line_plan_tree" model="ir.ui.view">
+ <field name="name">account.analytic.line.plan.tree</field>
+ <field name="model">account.analytic.line.plan</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree editable="top" string="Analytic Entries">
+ <field name="date"/>
+ <field name="ref" invisible="False"/>
+ <field name="name"/>
+ <field name="journal_id" invisible="False"/>
+ <field name="amount" sum="Total" invisible="False"/>
+ <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" invisible="False"/>
+ <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" invisible="False"/>
+ <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" invisible="False"/>
+ <field domain="[('type','=','normal')]" name="account_id"/>
+ <field name="general_account_id" invisible="False"/>
+ <field name="user_id" invisible="1"/>
+ </tree>
+ </field>
+ </record>
+ <record id="view_account_analytic_line_plan_filter" model="ir.ui.view">
+ <field name="name">account.analytic.line.plan.select</field>
+ <field name="model">account.analytic.line.plan</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Search Analytic Lines">
+ <group col='6' colspan='5'>
+ <filter name="edit"
+ string="Edit" context="{'set_editable':True,'seq_visible': True}"
+ icon="gtk-execute"
+ groups="base.group_erp_manager"/>
+ <field name="date"/>
+ <field name="name"/>
+ <field name="account_id"/>
+ <field name="user_id"/>
+ </group>
+ <newline/>
+ <group expand="0" string="Extended Filters...">
+ <field name="journal_id" widget="selection"/>
+ <field name="product_id" widget="selection"/>
+ <field name="amount" select="1"/>
+ </group>
+ <newline/>
+ </search>
+ </field>
+ </record>
+ <record id="action_account_analytic_line_plan_form" model="ir.actions.act_window">
+ <field name="name">Planning Analytic Entries</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">account.analytic.line.plan</field>
+ <field name="view_type">form</field>
+ <field name="context">{"search_default_user_id":uid}</field>
+ <field name="view_id" ref="view_account_analytic_line_plan_tree"/>
+ </record>
+
+
+#---------------------------------------------------------------------------------------------------------
+# Open journal entries
+#---------------------------------------------------------------------------------------------------------
+
+ <record id="action_account_analytic_journal_plan_open_form" model="ir.actions.act_window">
+ <field name="name">Analytic Journal Plan Items</field>
+ <field name="res_model">account.analytic.line.plan</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_account_analytic_line_plan_filter" />
+ </record>
+ <menuitem groups="analytic.group_analytic_accounting"
+ action="action_account_analytic_journal_plan_open_form"
+ id="account_analytic_journal_plan_entries"
+ parent="account.menu_finance_entries"
+ sequence="7"/>
+
+
+ </data>
+</openerp>
=== added file 'project_cost/account_analytic_line_view.xml'
--- project_cost/account_analytic_line_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost/account_analytic_line_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+#---------------------------------------------------------------------------------------------------------
+# Extend the analytic line
+#---------------------------------------------------------------------------------------------------------
+
+
+ <record id="view_account_analytic_line_form" model="ir.ui.view">
+ <field name="name">account.analytic.line.form</field>
+ <field name="model">account.analytic.line</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.view_account_analytic_line_form"/>
+ <field name="arch" type="xml">
+ <field name="date" position="after">
+ <field name="period_id"/>
+ </field>
+ </field>
+ </record>
+
+
+
+ </data>
+</openerp>
+
+
+
\ No newline at end of file
=== added directory 'project_cost/i18n'
=== added file 'project_cost/i18n/es.mo'
Binary files project_cost/i18n/es.mo 1970-01-01 00:00:00 +0000 and project_cost/i18n/es.mo 2013-01-22 10:02:35 +0000 differ
=== added file 'project_cost/i18n/es.po'
--- project_cost/i18n/es.po 1970-01-01 00:00:00 +0000
+++ project_cost/i18n/es.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,613 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_cost
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-08-29 23:33+0000\n"
+"PO-Revision-Date: 2012-08-30 01:34+0100\n"
+"Last-Translator: Jordi Ballester <jordi.ballester@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: project_cost
+#: model:ir.module.module,description:project_cost.module_meta_information
+msgid ""
+"Eficent Project Management. Project Cost Planning\n"
+" - A planning analytic journal object is created. It is similar to the analytic journal, but used for planning purposes\n"
+" - The planning analytic journals can be configured\n"
+" - A planning analytic journal lines object is created, with the exceptions of referencing \n"
+" to the planning analytic journal instead of the analytic journal, and considering \n"
+" that the general account is not a required entry.\n"
+" - The new object is visible as a separate entity, accesible from the Accounting area, with the corresponding search, tree, form views.\n"
+" - New analytic account attributes: cumulated planned costs, cummulated planned earnings and cumulated balance.\n"
+" The attributes are calculated based on the planning analytic journal lines. \n"
+" The new attributes are visible on the following views:\n"
+" − Analytic account forms: cumulated planned costs, cumulated planned earnings and cumulated balance\n"
+" − Budget positions: cumulated planned costs\n"
+" \n"
+" "
+msgstr ""
+"Eficent Project Management. Project Cost Planning\n"
+" - A planning analytic journal object is created. It is similar to the analytic journal, but used for planning purposes\n"
+" - The planning analytic journals can be configured\n"
+" - A planning analytic journal lines object is created, with the exceptions of referencing \n"
+" to the planning analytic journal instead of the analytic journal, and considering \n"
+" that the general account is not a required entry.\n"
+" - The new object is visible as a separate entity, accesible from the Accounting area, with the corresponding search, tree, form views.\n"
+" - New analytic account attributes: cumulated planned costs, cummulated planned earnings and cumulated balance.\n"
+" The attributes are calculated based on the planning analytic journal lines. \n"
+" The new attributes are visible on the following views:\n"
+" − Analytic account forms: cumulated planned costs, cumulated planned earnings and cumulated balance\n"
+" − Budget positions: cumulated planned costs\n"
+" \n"
+" "
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_plan_open_form
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_plan_entries
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_plan_entries_2
+msgid "Analytic Journal Plan Items"
+msgstr "Posiciones del Diario Analítico de Planificación"
+
+#. module: project_cost
+#: view:account.analytic.journal.commit:0
+#: view:account.analytic.journal.plan:0
+msgid "Group By..."
+msgstr "Agrupar Por..."
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.plan:0
+#: view:project.project:0
+msgid "General Accounting"
+msgstr "Contabilidad General"
+
+#. module: project_cost
+#: model:ir.actions.act_window,help:project_cost.action_account_analytic_journal_plan_tree
+msgid "To print a planning analytics (or costs) journal for a given period. The report give code, move name, account number, general amount and analytic amount."
+msgstr "Para imprimir un diario de análisis de la planificación (o costes) durante un período determinado. El informe da el código, el nombre del movimiento, número de cuenta, el importe real y el importe analítico."
+
+#. module: project_cost
+#: view:account.analytic.journal.commit:0
+#: view:account.analytic.journal.plan:0
+msgid "Analytic Journal"
+msgstr "Diario Analítico"
+
+#. module: project_cost
+#: field:account.analytic.Journal.commit.report,date1:0
+#: field:account.analytic.Journal.plan.report,date1:0
+msgid "Start of period"
+msgstr "Inicio de periodo"
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,company_id:0
+#: field:account.analytic.journal.plan,company_id:0
+#: field:account.analytic.line.commit,company_id:0
+#: field:account.analytic.line.plan,company_id:0
+msgid "Company"
+msgstr "Compañía"
+
+#. module: project_cost
+#: field:account.analytic.line.plan,currency_id:0
+msgid "Account currency"
+msgstr "Divisa de la Cuenta"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,product_uom_id:0
+#: field:account.analytic.line.plan,product_uom_id:0
+msgid "UoM"
+msgstr "UdM"
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "Purchase"
+msgstr "Compra"
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_plan_form
+#: model:ir.ui.menu,name:project_cost.account_def_analytic_journal_plan
+msgid "Planning Analytic Journals"
+msgstr "Diarios Analíticos para Planificación"
+
+#. module: project_cost
+#: field:account.analytic.account,debit_plan:0
+msgid "Planned Debit"
+msgstr "Débito Planificado"
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.commit:0
+#: field:account.analytic.line.commit,amount:0
+#: view:account.analytic.line.plan:0
+#: field:account.analytic.line.plan,amount:0
+#: view:project.project:0
+msgid "Amount"
+msgstr "Importe"
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_journal_commit
+msgid "Analytic Journal Commitments"
+msgstr "Diario Analítico para Comprometidos"
+
+#. module: project_cost
+#: code:addons/project_cost/account_analytic_line_commit.py:180
+#: code:addons/project_cost/account_analytic_line_plan.py:181
+#, python-format
+msgid "Entries: "
+msgstr "Entradas: "
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_journal_plan
+msgid "Analytic Journal Plan"
+msgstr "Diario Analítico para Planificación"
+
+#. module: project_cost
+#: field:account.analytic.line.plan,journal_id:0
+msgid "Planning Analytic Journal"
+msgstr "Diario Analítico para Planificación"
+
+#. module: project_cost
+#: help:account.analytic.line.plan,amount_currency:0
+msgid "The amount expressed in the related account currency if not equal to the company one."
+msgstr "La cantidad expresada en la divisa de la cuenta relacionada, si no es igual a la de la empresa."
+
+#. module: project_cost
+#: field:account.analytic.line.commit,account_id:0
+#: field:account.analytic.line.plan,account_id:0
+#: model:ir.model,name:project_cost.model_account_analytic_account
+msgid "Analytic Account"
+msgstr "Cuenta Analítica"
+
+#. module: project_cost
+#: constraint:account.analytic.account:0
+msgid "Error! You can not create recursive analytic accounts."
+msgstr "¡Error! No puede crear cuentas analíticas recursivas."
+
+#. module: project_cost
+#: help:account.analytic.line.commit,unit_amount:0
+#: help:account.analytic.line.plan,unit_amount:0
+msgid "Specifies the amount of quantity to count."
+msgstr "Especifica el importe de la cantidad para contar."
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_commit_form
+#: model:ir.ui.menu,name:project_cost.account_def_analytic_journal_commit
+msgid "Commitment Analytic Journals"
+msgstr "Diarios Analíticos para Comprometidos"
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_commit_open_form
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_commit_entries
+msgid "Analytic Journal Commitment Items"
+msgstr "Posiciones Diario Analítico para Comprometidos"
+
+#. module: project_cost
+#: view:account.analytic.Journal.commit.report:0
+#: view:account.analytic.Journal.plan.report:0
+msgid "Print"
+msgstr "Imprimir"
+
+#. module: project_cost
+#: view:account.analytic.journal.commit:0
+#: field:account.analytic.journal.commit,type:0
+#: view:account.analytic.journal.plan:0
+#: field:account.analytic.journal.plan,type:0
+msgid "Type"
+msgstr "Tipo"
+
+#. module: project_cost
+#: field:account.analytic.account,commit_line_ids:0
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_line_commit_form
+msgid "Commitment Analytic Entries"
+msgstr "Entradas Analíticas Comprometido"
+
+#. module: project_cost
+#: code:addons/project_cost/account_analytic_line_commit.py:125
+#: code:addons/project_cost/account_analytic_line_commit.py:134
+#: code:addons/project_cost/account_analytic_line_plan.py:126
+#: code:addons/project_cost/account_analytic_line_plan.py:135
+#, python-format
+msgid "Error !"
+msgstr "Error !"
+
+#. module: project_cost
+#: help:account.analytic.journal.commit,type:0
+#: help:account.analytic.journal.plan,type:0
+msgid "Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."
+msgstr "Ofrece el tipo de diario analítico. Cuando necesita un documento (p.ej. factura) para crear entradas analíticas, OpenERP buscará un diario asociado del mismo tipo."
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,name:0
+msgid "Commitments Journal Name"
+msgstr "Nombre Diario de Comprometidos"
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_line_plan
+msgid "Analytic Line Plan"
+msgstr "Posición Analítica de Planificación"
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_commit_tree
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_commit_print
+msgid "Print Commitment Analytic Journals"
+msgstr "Imprimir Diarios Analíticos para Comprometidos"
+
+#. module: project_cost
+#: field:account.analytic.account,credit_plan:0
+msgid "Planned Credit"
+msgstr "Crédito Planificado"
+
+#. module: project_cost
+#: field:account.analytic.journal.plan,code:0
+msgid "Planning Journal Code"
+msgstr "Código de Diario para Planificación"
+
+#. module: project_cost
+#: model:ir.ui.menu,name:project_cost.project_cost_plan_menu
+msgid "Plan Costs and Revenues"
+msgstr "Planificar Costes e Ingresos"
+
+#. module: project_cost
+#: model:ir.module.module,shortdesc:project_cost.module_meta_information
+msgid "Project Management"
+msgstr "Proyectos"
+
+#. module: project_cost
+#: help:account.analytic.line.commit,amount_currency:0
+msgid "The amount expressed in an optional other currency if it is a multi-currency entry."
+msgstr "El importe expresadio en una moneda alternativa si es una entrada multi-moneda."
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_Journal_commit_report
+msgid "Account Analytic Commitment Journal"
+msgstr "Diario de Cuenta Analítica para Comprometido"
+
+#. module: project_cost
+#: field:account.analytic.account,plan_line_ids:0
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+msgid "Analytic Entries"
+msgstr "Entradas Analíticas"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,currency_id:0
+msgid "Currency"
+msgstr "Moneda"
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_commit
+msgid "Analytic Commitments Journal"
+msgstr "Diario Analítico para Compromisos"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,journal_id:0
+msgid "Commitment Analytic Journal"
+msgstr "Diario Analítico para Compromisos"
+
+#. module: project_cost
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+msgid "Analytic Entry"
+msgstr "Entrada Analítica"
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:project.project:0
+msgid "Commitment analytic lines"
+msgstr "Líneas analíticas comprometido"
+
+#. module: project_cost
+#: field:account.analytic.account,credit_commit:0
+msgid "Commitments Credit"
+msgstr "Crédito Comprometidos"
+
+#. module: project_cost
+#: view:project.project:0
+msgid "Administration"
+msgstr "Administración"
+
+#. module: project_cost
+#: field:account.analytic.account,debit_commit:0
+msgid "Planned Commitments"
+msgstr "Comprometidos Planificados"
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,analytic_journal:0
+#: field:account.analytic.journal.plan,analytic_journal:0
+msgid "Actual Analytic journal"
+msgstr "Diario Analítico Actual"
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_line
+msgid "Analytic Line"
+msgstr "Línea analítica"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,user_id:0
+#: field:account.analytic.line.plan,user_id:0
+msgid "User"
+msgstr "Usuario"
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,code:0
+msgid "Commitments Journal Code"
+msgstr "Código Diario Comprometidos"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,date:0
+#: field:account.analytic.line.plan,date:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: project_cost
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+msgid "Extended Filters..."
+msgstr "Filtros Extendidos..."
+
+#. module: project_cost
+#: code:addons/project_cost/account_analytic_line_commit.py:126
+#: code:addons/project_cost/account_analytic_line_plan.py:127
+#, python-format
+msgid "There is no expense account defined for this product: \"%s\" (id:%d)"
+msgstr "No hay una cuenta de gastos definida para este producto: \"%s\" (id:%d)"
+
+#. module: project_cost
+#: help:account.analytic.line.commit,amount:0
+#: help:account.analytic.line.plan,amount:0
+msgid "Calculated by multiplying the quantity and the price given in the Product's cost price. Always expressed in the company main currency."
+msgstr "Calculado multiplicando la cantidad y el precio fijado en el precio de coste del Producto. Siempre expresado en la moneda principal."
+
+#. module: project_cost
+#: model:ir.ui.menu,name:project_cost.account_analytic_def_account
+msgid "Analytic Accounts"
+msgstr "Cuentas analíticas"
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_line_commit
+msgid "Analytic Line Commitment"
+msgstr "Línea Analítica Comprometido"
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,active:0
+#: field:account.analytic.journal.plan,active:0
+msgid "Active"
+msgstr "Activo"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,amount_currency:0
+msgid "Amount Currency"
+msgstr "Moneda Importe"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,move_id:0
+#: field:account.analytic.line.plan,move_id:0
+msgid "Move Line"
+msgstr "Apunte"
+
+#. module: project_cost
+#: constraint:account.analytic.account:0
+msgid "Error! The currency has to be the same as the currency of the selected company"
+msgstr "¡Error! La divisa tiene que ser la misma que la establecida en la compañía seleccionada"
+
+#. module: project_cost
+#: field:account.analytic.Journal.commit.report,date2:0
+#: field:account.analytic.Journal.plan.report,date2:0
+msgid "End of period"
+msgstr "Fin de periodo"
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "Situation"
+msgstr "Situación"
+
+#. module: project_cost
+#: field:account.analytic.account,balance_plan:0
+msgid "Planned Balance"
+msgstr "Balance Planificado"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,unit_amount:0
+#: field:account.analytic.line.plan,unit_amount:0
+msgid "Quantity"
+msgstr "Cantidad"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,general_account_id:0
+#: field:account.analytic.line.plan,general_account_id:0
+msgid "General Account"
+msgstr "Cuenta General"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,code:0
+#: field:account.analytic.line.plan,code:0
+msgid "Code"
+msgstr "Código"
+
+#. module: project_cost
+#: field:account.analytic.line,period_id:0
+#: field:account.analytic.line.commit,period_id:0
+#: field:account.analytic.line.plan,period_id:0
+msgid "Period"
+msgstr "Periodo"
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "General"
+msgstr "General"
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_line_plan_form
+msgid "Planning Analytic Entries"
+msgstr "Entradas de Analíticas para Planificación"
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_plan_tree
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_plan_print
+msgid "Print Planning Analytic Journals"
+msgstr "Imprimir Diarios Analíticos para Planificación"
+
+#. module: project_cost
+#: view:account.analytic.Journal.commit.report:0
+#: view:account.analytic.Journal.plan.report:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: project_cost
+#: field:account.analytic.account,balance_commit:0
+msgid "Commitment Balance"
+msgstr "Balance Comprometido"
+
+#. module: project_cost
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+msgid "Search Analytic Lines"
+msgstr "Buscar Líneas Analíticas"
+
+#. module: project_cost
+#: model:ir.ui.menu,name:project_cost.project_cost_analytic_account_menu
+msgid "Analytic Accounting"
+msgstr "Contabilidad analítica"
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+#: view:project.project:0
+msgid "Product Information"
+msgstr "Información sobre el producto"
+
+#. module: project_cost
+#: help:account.analytic.line.plan,currency_id:0
+msgid "The related account currency if not equal to the company one."
+msgstr "La divisa de la cuenta relacionada si no es igual a la de la compañía."
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:project.project:0
+msgid "Planned analytic lines"
+msgstr "Posiciones de Planificación Analíticas"
+
+#. module: project_cost
+#: field:account.analytic.line.commit,product_id:0
+#: field:account.analytic.line.plan,product_id:0
+msgid "Product"
+msgstr "Producto"
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+#: view:project.project:0
+msgid "Total Quantity"
+msgstr "Cantidad Total"
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: field:account.analytic.line.commit,name:0
+#: field:account.analytic.line.plan,name:0
+msgid "Description"
+msgstr "Descripción"
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_Journal_plan_report
+msgid "Account Analytic Planning Journal"
+msgstr "Diario de Cuenta Analítica para Planificación"
+
+#. module: project_cost
+#: field:account.analytic.journal.plan,name:0
+msgid "Planning Journal Name"
+msgstr "Nombre del Diario para Planificación"
+
+#. module: project_cost
+#: help:account.analytic.journal.commit,active:0
+#: help:account.analytic.journal.plan,active:0
+msgid "If the active field is set to False, it will allow you to hide the analytic journal without removing it."
+msgstr "Si el campo activo se fija a Falso, permitirá ocultar el diario analítico sin borrarlo."
+
+#. module: project_cost
+#: field:account.analytic.line.commit,ref:0
+#: field:account.analytic.line.plan,ref:0
+msgid "Ref."
+msgstr "Ref."
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_plan
+msgid "Analytic Planning Journal"
+msgstr "Diario Analítico para Planificación"
+
+#. module: project_cost
+#: view:account.analytic.Journal.commit.report:0
+#: view:account.analytic.Journal.plan.report:0
+msgid "Select Period"
+msgstr "Seleccionar Periodo"
+
+#. module: project_cost
+#: view:account.analytic.line.plan:0
+msgid "Edit"
+msgstr "Editar"
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,line_ids:0
+#: field:account.analytic.journal.plan,line_ids:0
+msgid "Lines"
+msgstr "Líneas"
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "Cash"
+msgstr "Efectivo"
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "Sale"
+msgstr "Venta"
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:project.project:0
+msgid "Costs"
+msgstr "Costes"
+
+#. module: project_cost
+#: model:ir.actions.act_window,help:project_cost.action_account_analytic_journal_commit_tree
+msgid "To print a commitments analytics (or costs) journal for a given period. The report give code, move name, account number, general amount and analytic amount."
+msgstr "Para imprimir un diario analítico de comprometodos para un periodo dado El informe presenta el código, nombre de movimiento, número de cuenta, importe general e importe analítico."
+
+#. module: project_cost
+#: code:addons/project_cost/account_analytic_line_commit.py:135
+#: code:addons/project_cost/account_analytic_line_plan.py:136
+#, python-format
+msgid "There is no income account defined for this product: \"%s\" (id:%d)"
+msgstr "No hay cuenta de ingresos definida para este producto: \"%s\" (id:%d)"
+
+#. module: project_cost
+#: field:account.analytic.line.plan,amount_currency:0
+msgid "Amount currency"
+msgstr "Divisa del Importe"
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+#: view:project.project:0
+msgid "Total"
+msgstr "Total"
+
+#. module: project_cost
+#: view:account.analytic.journal.commit:0
+#: view:account.analytic.journal.plan:0
+msgid "Analytic Journals"
+msgstr "Diarios Analíticos"
+
=== added file 'project_cost/i18n/project_cost.pot'
--- project_cost/i18n/project_cost.pot 1970-01-01 00:00:00 +0000
+++ project_cost/i18n/project_cost.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,598 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_cost
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-08-29 23:32+0000\n"
+"PO-Revision-Date: 2012-08-29 23:32+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: project_cost
+#: model:ir.module.module,description:project_cost.module_meta_information
+msgid "Eficent Project Management. Project Cost Planning\n"
+" - A planning analytic journal object is created. It is similar to the analytic journal, but used for planning purposes\n"
+" - The planning analytic journals can be configured\n"
+" - A planning analytic journal lines object is created, with the exceptions of referencing \n"
+" to the planning analytic journal instead of the analytic journal, and considering \n"
+" that the general account is not a required entry.\n"
+" - The new object is visible as a separate entity, accesible from the Accounting area, with the corresponding search, tree, form views.\n"
+" - New analytic account attributes: cumulated planned costs, cummulated planned earnings and cumulated balance.\n"
+" The attributes are calculated based on the planning analytic journal lines. \n"
+" The new attributes are visible on the following views:\n"
+" − Analytic account forms: cumulated planned costs, cumulated planned earnings and cumulated balance\n"
+" − Budget positions: cumulated planned costs\n"
+" \n"
+" "
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_plan_open_form
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_plan_entries
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_plan_entries_2
+msgid "Analytic Journal Plan Items"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.journal.commit:0
+#: view:account.analytic.journal.plan:0
+msgid "Group By..."
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.plan:0
+#: view:project.project:0
+msgid "General Accounting"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,help:project_cost.action_account_analytic_journal_plan_tree
+msgid "To print a planning analytics (or costs) journal for a given period. The report give code, move name, account number, general amount and analytic amount."
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.journal.commit:0
+#: view:account.analytic.journal.plan:0
+msgid "Analytic Journal"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.Journal.commit.report,date1:0
+#: field:account.analytic.Journal.plan.report,date1:0
+msgid "Start of period"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,company_id:0
+#: field:account.analytic.journal.plan,company_id:0
+#: field:account.analytic.line.commit,company_id:0
+#: field:account.analytic.line.plan,company_id:0
+msgid "Company"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.plan,currency_id:0
+msgid "Account currency"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,product_uom_id:0
+#: field:account.analytic.line.plan,product_uom_id:0
+msgid "UoM"
+msgstr ""
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "Purchase"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_plan_form
+#: model:ir.ui.menu,name:project_cost.account_def_analytic_journal_plan
+msgid "Planning Analytic Journals"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.account,debit_plan:0
+msgid "Planned Debit"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.commit:0
+#: field:account.analytic.line.commit,amount:0
+#: view:account.analytic.line.plan:0
+#: field:account.analytic.line.plan,amount:0
+#: view:project.project:0
+msgid "Amount"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_journal_commit
+msgid "Analytic Journal Commitments"
+msgstr ""
+
+#. module: project_cost
+#: code:addons/project_cost/account_analytic_line_commit.py:180
+#: code:addons/project_cost/account_analytic_line_plan.py:181
+#, python-format
+msgid "Entries: "
+msgstr ""
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_journal_plan
+msgid "Analytic Journal Plan"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.plan,journal_id:0
+msgid "Planning Analytic Journal"
+msgstr ""
+
+#. module: project_cost
+#: help:account.analytic.line.plan,amount_currency:0
+msgid "The amount expressed in the related account currency if not equal to the company one."
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,account_id:0
+#: field:account.analytic.line.plan,account_id:0
+#: model:ir.model,name:project_cost.model_account_analytic_account
+msgid "Analytic Account"
+msgstr ""
+
+#. module: project_cost
+#: constraint:account.analytic.account:0
+msgid "Error! You can not create recursive analytic accounts."
+msgstr ""
+
+#. module: project_cost
+#: help:account.analytic.line.commit,unit_amount:0
+#: help:account.analytic.line.plan,unit_amount:0
+msgid "Specifies the amount of quantity to count."
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_commit_form
+#: model:ir.ui.menu,name:project_cost.account_def_analytic_journal_commit
+msgid "Commitment Analytic Journals"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_commit_open_form
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_commit_entries
+msgid "Analytic Journal Commitment Items"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.Journal.commit.report:0
+#: view:account.analytic.Journal.plan.report:0
+msgid "Print"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.journal.commit:0
+#: field:account.analytic.journal.commit,type:0
+#: view:account.analytic.journal.plan:0
+#: field:account.analytic.journal.plan,type:0
+msgid "Type"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.account,commit_line_ids:0
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_line_commit_form
+msgid "Commitment Analytic Entries"
+msgstr ""
+
+#. module: project_cost
+#: code:addons/project_cost/account_analytic_line_commit.py:125
+#: code:addons/project_cost/account_analytic_line_commit.py:134
+#: code:addons/project_cost/account_analytic_line_plan.py:126
+#: code:addons/project_cost/account_analytic_line_plan.py:135
+#, python-format
+msgid "Error !"
+msgstr ""
+
+#. module: project_cost
+#: help:account.analytic.journal.commit,type:0
+#: help:account.analytic.journal.plan,type:0
+msgid "Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,name:0
+msgid "Commitments Journal Name"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_line_plan
+msgid "Analytic Line Plan"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_commit_tree
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_commit_print
+msgid "Print Commitment Analytic Journals"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.account,credit_plan:0
+msgid "Planned Credit"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.journal.plan,code:0
+msgid "Planning Journal Code"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.ui.menu,name:project_cost.project_cost_plan_menu
+msgid "Plan Costs and Revenues"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.module.module,shortdesc:project_cost.module_meta_information
+msgid "Project Management"
+msgstr ""
+
+#. module: project_cost
+#: help:account.analytic.line.commit,amount_currency:0
+msgid "The amount expressed in an optional other currency if it is a multi-currency entry."
+msgstr ""
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_Journal_commit_report
+msgid "Account Analytic Commitment Journal"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.account,plan_line_ids:0
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+msgid "Analytic Entries"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,currency_id:0
+msgid "Currency"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_commit
+msgid "Analytic Commitments Journal"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,journal_id:0
+msgid "Commitment Analytic Journal"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+msgid "Analytic Entry"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:project.project:0
+msgid "Commitment analytic lines"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.account,credit_commit:0
+msgid "Commitments Credit"
+msgstr ""
+
+#. module: project_cost
+#: view:project.project:0
+msgid "Administration"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.account,debit_commit:0
+msgid "Planned Commitments"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,analytic_journal:0
+#: field:account.analytic.journal.plan,analytic_journal:0
+msgid "Actual Analytic journal"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_line
+msgid "Analytic Line"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,user_id:0
+#: field:account.analytic.line.plan,user_id:0
+msgid "User"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,code:0
+msgid "Commitments Journal Code"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,date:0
+#: field:account.analytic.line.plan,date:0
+msgid "Date"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+msgid "Extended Filters..."
+msgstr ""
+
+#. module: project_cost
+#: code:addons/project_cost/account_analytic_line_commit.py:126
+#: code:addons/project_cost/account_analytic_line_plan.py:127
+#, python-format
+msgid "There is no expense account defined for this product: \"%s\" (id:%d)"
+msgstr ""
+
+#. module: project_cost
+#: help:account.analytic.line.commit,amount:0
+#: help:account.analytic.line.plan,amount:0
+msgid "Calculated by multiplying the quantity and the price given in the Product's cost price. Always expressed in the company main currency."
+msgstr ""
+
+#. module: project_cost
+#: model:ir.ui.menu,name:project_cost.account_analytic_def_account
+msgid "Analytic Accounts"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_line_commit
+msgid "Analytic Line Commitment"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,active:0
+#: field:account.analytic.journal.plan,active:0
+msgid "Active"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,amount_currency:0
+msgid "Amount Currency"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,move_id:0
+#: field:account.analytic.line.plan,move_id:0
+msgid "Move Line"
+msgstr ""
+
+#. module: project_cost
+#: constraint:account.analytic.account:0
+msgid "Error! The currency has to be the same as the currency of the selected company"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.Journal.commit.report,date2:0
+#: field:account.analytic.Journal.plan.report,date2:0
+msgid "End of period"
+msgstr ""
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "Situation"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.account,balance_plan:0
+msgid "Planned Balance"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,unit_amount:0
+#: field:account.analytic.line.plan,unit_amount:0
+msgid "Quantity"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,general_account_id:0
+#: field:account.analytic.line.plan,general_account_id:0
+msgid "General Account"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,code:0
+#: field:account.analytic.line.plan,code:0
+msgid "Code"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line,period_id:0
+#: field:account.analytic.line.commit,period_id:0
+#: field:account.analytic.line.plan,period_id:0
+msgid "Period"
+msgstr ""
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "General"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_line_plan_form
+msgid "Planning Analytic Entries"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_plan_tree
+#: model:ir.ui.menu,name:project_cost.account_analytic_journal_plan_print
+msgid "Print Planning Analytic Journals"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.Journal.commit.report:0
+#: view:account.analytic.Journal.plan.report:0
+msgid "Cancel"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.account,balance_commit:0
+msgid "Commitment Balance"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+msgid "Search Analytic Lines"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.ui.menu,name:project_cost.project_cost_analytic_account_menu
+msgid "Analytic Accounting"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+#: view:project.project:0
+msgid "Product Information"
+msgstr ""
+
+#. module: project_cost
+#: help:account.analytic.line.plan,currency_id:0
+msgid "The related account currency if not equal to the company one."
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:project.project:0
+msgid "Planned analytic lines"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,product_id:0
+#: field:account.analytic.line.plan,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+#: view:project.project:0
+msgid "Total Quantity"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: field:account.analytic.line.commit,name:0
+#: field:account.analytic.line.plan,name:0
+msgid "Description"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.model,name:project_cost.model_account_analytic_Journal_plan_report
+msgid "Account Analytic Planning Journal"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.journal.plan,name:0
+msgid "Planning Journal Name"
+msgstr ""
+
+#. module: project_cost
+#: help:account.analytic.journal.commit,active:0
+#: help:account.analytic.journal.plan,active:0
+msgid "If the active field is set to False, it will allow you to hide the analytic journal without removing it."
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.commit,ref:0
+#: field:account.analytic.line.plan,ref:0
+msgid "Ref."
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,name:project_cost.action_account_analytic_journal_plan
+msgid "Analytic Planning Journal"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.Journal.commit.report:0
+#: view:account.analytic.Journal.plan.report:0
+msgid "Select Period"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.line.plan:0
+msgid "Edit"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.journal.commit,line_ids:0
+#: field:account.analytic.journal.plan,line_ids:0
+msgid "Lines"
+msgstr ""
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "Cash"
+msgstr ""
+
+#. module: project_cost
+#: selection:account.analytic.journal.commit,type:0
+#: selection:account.analytic.journal.plan,type:0
+msgid "Sale"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:project.project:0
+msgid "Costs"
+msgstr ""
+
+#. module: project_cost
+#: model:ir.actions.act_window,help:project_cost.action_account_analytic_journal_commit_tree
+msgid "To print a commitments analytics (or costs) journal for a given period. The report give code, move name, account number, general amount and analytic amount."
+msgstr ""
+
+#. module: project_cost
+#: code:addons/project_cost/account_analytic_line_commit.py:135
+#: code:addons/project_cost/account_analytic_line_plan.py:136
+#, python-format
+msgid "There is no income account defined for this product: \"%s\" (id:%d)"
+msgstr ""
+
+#. module: project_cost
+#: field:account.analytic.line.plan,amount_currency:0
+msgid "Amount currency"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.account:0
+#: view:account.analytic.line.commit:0
+#: view:account.analytic.line.plan:0
+#: view:project.project:0
+msgid "Total"
+msgstr ""
+
+#. module: project_cost
+#: view:account.analytic.journal.commit:0
+#: view:account.analytic.journal.plan:0
+msgid "Analytic Journals"
+msgstr ""
+
=== added file 'project_cost/project_view.xml'
--- project_cost/project_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost/project_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+#---------------------------------------------------------------------------------------------------------
+# Extend the project
+#---------------------------------------------------------------------------------------------------------
+ <menuitem id="project_cost_plan_menu" name="Plan Costs and Revenues"
+ parent="project.menu_project_management"
+ groups="project.group_project_manager,project.group_project_user"/>
+
+
+ <record id="edit_project_cost_view" model="ir.ui.view">
+ <field name="name">project.project.form</field>
+ <field name="model">project.project</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="project.edit_project"/>
+ <field name="arch" type="xml">
+ <page string='Other Info' position="after">
+ <page string="Costs">
+ <field colspan="4" name="line_ids" nolabel="1" readonly="True" context="{'default_account_id': active_id}"/>
+ <field colspan="4" name="plan_line_ids" nolabel="1" context="{'default_account_id': active_id}">
+ <tree string="Planned analytic lines">
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="ref" />
+ <field name="name"/>
+ <field name="journal_id" invisible="False"/>
+ <field name="amount" sum="Total"/>
+ <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" />
+ <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" />
+ <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
+ <field name="general_account_id" />
+ <field name="user_id"/>
+ </tree>
+ <form string="Planned analytic lines">
+ <group colspan="4" col="6">
+ <field name="name"/>
+ <field name="ref"/>
+ <field name="account_id" invisible="True"/>
+ <field name="journal_id"/>
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="company_id" groups="base.group_multi_company" invisible="True"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Amount" colspan="4"/>
+ <field name="amount" colspan="4"/>
+ <field name="amount_currency" colspan="2"/>
+ <field name="currency_id" colspan="2" nolabel="1"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Product Information" colspan="4"/>
+ <field name="product_id" colspan="4" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="unit_amount" colspan="2" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="product_uom_id" colspan="2" nolabel="1" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="user_id" colspan="2"/>
+ </group>
+ <group colspan="2" col="2" groups="base.group_erp_manager">
+ <separator string="General Accounting" colspan="2"/>
+ <field name="general_account_id" invisible="True"/>
+ <field name="move_id" readonly="1" invisible="True"/>
+ </group>
+ </form>
+ </field>
+ <field colspan="4" name="commit_line_ids" nolabel="1" context="{'default_account_id': active_id}">
+ <tree string="Commitment analytic lines">
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="ref" />
+ <field name="name"/>
+ <field name="journal_id" invisible="False"/>
+ <field name="amount" sum="Total"/>
+ <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" />
+ <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" />
+ <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
+ <field name="general_account_id" />
+ <field name="user_id"/>
+ </tree>
+ <form string="Commitment analytic lines">
+ <group colspan="4" col="6">
+ <field name="name"/>
+ <field name="ref"/>
+ <field name="account_id" invisible="True"/>
+ <field name="journal_id"/>
+ <field name="date"/>
+ <field name="period_id"/>
+ <field name="company_id" groups="base.group_multi_company" invisible="True"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Amount" colspan="4"/>
+ <field name="amount" colspan="4"/>
+ <field name="amount_currency" colspan="2"/>
+ <field name="currency_id" colspan="2" nolabel="1"/>
+ </group>
+ <group colspan="2" col="4">
+ <separator string="Product Information" colspan="4"/>
+ <field name="product_id" colspan="4" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="unit_amount" colspan="2" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="product_uom_id" colspan="2" nolabel="1" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <field name="user_id" colspan="2"/>
+ </group>
+ <group colspan="2" col="2" groups="base.group_erp_manager">
+ <separator string="General Accounting" colspan="2"/>
+ <field name="general_account_id" invisible="True"/>
+ <field name="move_id" readonly="1" invisible="True"/>
+ </group>
+ </form>
+ </field>
+ </page>
+ </page>
+
+ </field>
+ </record>
+
+
+ </data>
+</openerp>
=== added directory 'project_cost/report'
=== added file 'project_cost/report/__init__.py'
--- project_cost/report/__init__.py 1970-01-01 00:00:00 +0000
+++ project_cost/report/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import account_analytic_journal_plan
+import account_analytic_journal_commit
+
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'project_cost/report/account_analytic_journal_commit.py'
--- project_cost/report/account_analytic_journal_commit.py 1970-01-01 00:00:00 +0000
+++ project_cost/report/account_analytic_journal_commit.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+import pooler
+from report import report_sxw
+
+#
+# Use period and Journal for selection or resources
+#
+class account_analytic_journal_commit(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(account_analytic_journal_commit, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update( {
+ 'time': time,
+ 'lines': self._lines,
+ 'lines_a': self._lines_a,
+ 'sum_general': self._sum_general,
+ 'sum_analytic': self._sum_analytic,
+ })
+
+ def _lines(self, journal_id, date1, date2):
+ self.cr.execute('SELECT DISTINCT move_id FROM account_analytic_line_commit WHERE (date>=%s) AND (date<=%s) AND (journal_id=%s) AND (move_id is not null)', (date1, date2, journal_id,))
+ ids = map(lambda x: x[0], self.cr.fetchall())
+ return self.pool.get('account.move.line').browse(self.cr, self.uid, ids)
+
+ def _lines_a(self, move_id, journal_id, date1, date2):
+ ids = self.pool.get('account.analytic.line.commit').search(self.cr, self.uid, [('move_id','=',move_id), ('journal_id','=',journal_id), ('date','>=',date1), ('date','<=',date2)])
+ if not ids:
+ return []
+ return self.pool.get('account.analytic.line.commit').browse(self.cr, self.uid, ids)
+
+ def _sum_general(self, journal_id, date1, date2):
+ self.cr.execute('SELECT SUM(debit-credit) FROM account_move_line WHERE id IN (SELECT move_id FROM account_analytic_line_commit WHERE (date>=%s) AND (date<=%s) AND (journal_id=%s) AND (move_id is not null))', (date1, date2, journal_id,))
+ return self.cr.fetchall()[0][0] or 0
+
+ def _sum_analytic(self, journal_id, date1, date2):
+ self.cr.execute("SELECT SUM(amount) FROM account_analytic_line_commit WHERE date>=%s AND date<=%s AND journal_id=%s", (date1, date2, journal_id))
+ res = self.cr.dictfetchone()
+ return res['sum'] or 0
+
+report_sxw.report_sxw('report.account.analytic.journal.commit', 'account.analytic.journal.commit', 'addons/project_cost/report/account_analytic_journal_commit.rml',parser=account_analytic_journal_commit,header="internal")
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'project_cost/report/account_analytic_journal_commit.rml'
--- project_cost/report/account_analytic_journal_commit.rml 1970-01-01 00:00:00 +0000
+++ project_cost/report/account_analytic_journal_commit.rml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,331 @@
+<?xml version="1.0"?>
+<document filename="test.pdf">
+ <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
+ <pageTemplate id="first">
+ <frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
+ </pageTemplate>
+ </template>
+ <stylesheet>
+ <blockTableStyle id="Standard_Outline">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table5">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table6">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table_detail_header">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table1">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table2">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table4">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table3">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <initialize>
+ <paraStyle name="all" alignment="justify"/>
+ </initialize>
+ <paraStyle name="P1" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Standard" fontName="Helvetica"/>
+ <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="Index" fontName="Helvetica"/>
+ <paraStyle name="Footer" fontName="Helvetica"/>
+ <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
+ <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_space" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="11.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <images/>
+ </stylesheet>
+ <story>
+ <pageBreak/>
+ <para style="P1">[[ repeatIn(objects,'o') ]]</para>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_header_Centre">Commitments Analytic Journal</para>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="180.0,180.0,180.0" style="Table5">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details_Centre">Period from</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Centre">Period to</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Centre">Currency</para>
+ </td>
+ </tr>
+ </blockTable>
+ <blockTable colWidths="180.0,180.0,180.0" style="Table6">
+ <tr>
+ <td>
+ <para style="terp_default_Centre_8">[[ formatLang(data['form']['date1'],date=True) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Centre_8">[[ formatLang(data['form']['date2'],date=True) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_space">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table_detail_header">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">Date</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Code</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Move Name</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Account n°</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">General</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">Analytic</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="118.0,28.0,168.0,73.0,74.0,77.0" style="Table1">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">[[ o.code ]] - [[ o.name ]]</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">[[ formatLang(sum_general(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">[[ formatLang(sum_analytic(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <section>
+ <para style="terp_default_8">[[ repeatIn(lines(o.id,data['form']['date1'],data['form']['date2']), 'move') ]]</para>
+ <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table2">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move.name ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move.account_id.complete_wbs_code ]] - [[ move.account_id.complete_wbs_name ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang(move.debit-move.credit) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <section>
+ <para style="terp_default_8">[[ repeatIn(lines_a(move.id,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
+ <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table4">
+ <tr>
+ <td>
+ <para style="terp_default_9">[[ (not move_a) and removeParentNode('blockTable') ]] [[ formatLang(move_a.date,date = True) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.code ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.name ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.account_id.complete_wbs_code ]] - [[ move_a.account_id.complete_wbs_name ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang( move_a.amount) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <section>
+ <para style="terp_default_8">[[ repeatIn(lines_a(False,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
+ <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table3">
+ <tr>
+ <td>
+ <para style="terp_default_9">[[ (not move_a) and removeParentNode('blockTable') ]] [[ formatLang(move_a.date,date = True) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.code ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.name ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.account_id.complete_wbs_code ]] - [[ move_a.account_id.complete_wbs_name ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang( move_a.amount) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ </story>
+</document>
=== added file 'project_cost/report/account_analytic_journal_commit.sxw'
Binary files project_cost/report/account_analytic_journal_commit.sxw 1970-01-01 00:00:00 +0000 and project_cost/report/account_analytic_journal_commit.sxw 2013-01-22 10:02:35 +0000 differ
=== added file 'project_cost/report/account_analytic_journal_plan.py'
--- project_cost/report/account_analytic_journal_plan.py 1970-01-01 00:00:00 +0000
+++ project_cost/report/account_analytic_journal_plan.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+import pooler
+from report import report_sxw
+
+#
+# Use period and Journal for selection or resources
+#
+class account_analytic_journal_plan(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(account_analytic_journal_plan, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update( {
+ 'time': time,
+ 'lines': self._lines,
+ 'lines_a': self._lines_a,
+ 'sum_general': self._sum_general,
+ 'sum_analytic': self._sum_analytic,
+ })
+
+ def _lines(self, journal_id, date1, date2):
+ self.cr.execute('SELECT DISTINCT move_id FROM account_analytic_line_plan WHERE (date>=%s) AND (date<=%s) AND (journal_id=%s) AND (move_id is not null)', (date1, date2, journal_id,))
+ ids = map(lambda x: x[0], self.cr.fetchall())
+ return self.pool.get('account.move.line').browse(self.cr, self.uid, ids)
+
+ def _lines_a(self, move_id, journal_id, date1, date2):
+ ids = self.pool.get('account.analytic.line.plan').search(self.cr, self.uid, [('move_id','=',move_id), ('journal_id','=',journal_id), ('date','>=',date1), ('date','<=',date2)])
+ if not ids:
+ return []
+ return self.pool.get('account.analytic.line.plan').browse(self.cr, self.uid, ids)
+
+ def _sum_general(self, journal_id, date1, date2):
+ self.cr.execute('SELECT SUM(debit-credit) FROM account_move_line WHERE id IN (SELECT move_id FROM account_analytic_line_plan WHERE (date>=%s) AND (date<=%s) AND (journal_id=%s) AND (move_id is not null))', (date1, date2, journal_id,))
+ return self.cr.fetchall()[0][0] or 0
+
+ def _sum_analytic(self, journal_id, date1, date2):
+ self.cr.execute("SELECT SUM(amount) FROM account_analytic_line_plan WHERE date>=%s AND date<=%s AND journal_id=%s", (date1, date2, journal_id))
+ res = self.cr.dictfetchone()
+ return res['sum'] or 0
+
+report_sxw.report_sxw('report.account.analytic.journal.plan', 'account.analytic.journal.plan', 'addons/project_cost/report/account_analytic_journal_plan.rml',parser=account_analytic_journal_plan,header="internal")
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'project_cost/report/account_analytic_journal_plan.rml'
--- project_cost/report/account_analytic_journal_plan.rml 1970-01-01 00:00:00 +0000
+++ project_cost/report/account_analytic_journal_plan.rml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,340 @@
+<?xml version="1.0"?>
+<document filename="test.pdf">
+ <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
+ <pageTemplate id="first">
+ <frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
+ </pageTemplate>
+ </template>
+ <stylesheet>
+ <blockTableStyle id="Standard_Outline">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table5">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table6">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table_detail_header">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table1">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table2">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table4">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table3">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <initialize>
+ <paraStyle name="all" alignment="justify"/>
+ </initialize>
+ <paraStyle name="P1" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P3" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P4" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Standard" fontName="Helvetica"/>
+ <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="Index" fontName="Helvetica"/>
+ <paraStyle name="Footer" fontName="Helvetica"/>
+ <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
+ <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_space" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="11.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <images/>
+ </stylesheet>
+ <story>
+ <para style="P2">[[ repeatIn(objects,'o') ]]</para>
+ <para style="P1">
+ <font color="white"> </font>
+ </para>
+ <para style="P5">
+ <font face="Helvetica">Planning Analitic Journal</font>
+ </para>
+ <para style="P1">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="180.0,180.0,180.0" style="Table5">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details_Centre">Period from</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Centre">Period to</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Centre">Currency</para>
+ </td>
+ </tr>
+ </blockTable>
+ <blockTable colWidths="180.0,180.0,180.0" style="Table6">
+ <tr>
+ <td>
+ <para style="terp_default_Centre_8">[[ formatLang(data['form']['date1'],date=True) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Centre_8">[[ formatLang(data['form']['date2'],date=True) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_space">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table_detail_header">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">Date</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Code</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Move Name</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Account n°</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">General</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">Analytic</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="118.0,28.0,168.0,73.0,74.0,77.0" style="Table1">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">[[ o.code ]] - [[ o.name ]]</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">[[ formatLang(sum_general(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">[[ formatLang(sum_analytic(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <section>
+ <para style="terp_default_8">[[ repeatIn(lines(o.id,data['form']['date1'],data['form']['date2']), 'move') ]]</para>
+ <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table2">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move.name ]]</para>
+ </td>
+ <td>
+ <para style="P3">[[ move.account_id.complete_wbs_code ]] - [[ move.account_id.complete_wbs_name ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang(move.debit-move.credit) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <section>
+ <para style="terp_default_8">[[ repeatIn(lines_a(move.id,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
+ <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table4">
+ <tr>
+ <td>
+ <para style="terp_default_9">[[ (not move_a) and removeParentNode('blockTable') ]] [[ formatLang(move_a.date,date = True) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.code ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.name ]]</para>
+ </td>
+ <td>
+ <para style="P4">
+ <font face="Helvetica">[[ move_a.account_id.complete_wbs_code ]] - [[ move_a.account_id.complete_wbs_name ]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang( move_a.amount) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ <section>
+ <para style="terp_default_8">[[ repeatIn(lines_a(False,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
+ <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table3">
+ <tr>
+ <td>
+ <para style="terp_default_9">[[ (not move_a) and removeParentNode('blockTable') ]] [[ formatLang(move_a.date,date = True) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.code ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ move_a.name ]]</para>
+ </td>
+ <td>
+ <para style="P4">
+ <font face="Helvetica">[[ move_a.account_id.complete_wbs_code ]] - [[ move_a.account_id.complete_wbs_name ]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang( move_a.amount) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ </story>
+</document>
=== added file 'project_cost/report/account_analytic_journal_plan.sxw'
Binary files project_cost/report/account_analytic_journal_plan.sxw 1970-01-01 00:00:00 +0000 and project_cost/report/account_analytic_journal_plan.sxw 2013-01-22 10:02:35 +0000 differ
=== added directory 'project_cost/security'
=== added file 'project_cost/security/avg_project_security.xml'
--- project_cost/security/avg_project_security.xml 1970-01-01 00:00:00 +0000
+++ project_cost/security/avg_project_security.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp><data>
+
+
+ <record id="analytic_journal_plan_comp_rule" model="ir.rule">
+ <field name="name">Planning Analytic journal multi-company</field>
+ <field model="ir.model" name="model_id" ref="model_account_analytic_journal_plan"/>
+ <field eval="True" name="global"/>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+ </record>
+
+ <record id="analytic_journal_plan_comp_rule_false" model="ir.rule">
+ <field name="name">Planning Analytic journal multi-company</field>
+ <field model="ir.model" name="model_id" ref="model_account_analytic_journal_plan"/>
+ <field eval="True" name="global"/>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+ </record>
+
+
+
+</data></openerp>
=== added file 'project_cost/security/ir.model.access.csv'
--- project_cost/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ project_cost/security/ir.model.access.csv 2013-01-22 10:02:35 +0000
@@ -0,0 +1,24 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_account_analytic_line_plan_project_user","account.analytic.line.plan project user","model_account_analytic_line_plan","project.group_project_user",1,1,1,1
+"access_account_period_project_user","account.period project user","account.model_account_period","project.group_project_user",1,0,0,0
+"access_account_period_project_manager","account.period project manager","account.model_account_period","project.group_project_manager",1,0,0,0
+"access_account_analytic_line_plan_project_manager","account.analytic.line.plan project manager","model_account_analytic_line_plan","project.group_project_manager",1,1,1,1
+"access_account_analytic_line_plan","account.analytic.line.plan","model_account_analytic_line_plan","account.group_account_user",1,1,1,1
+"access_account_analytic_line_plan_manager","account.analytic.line.plan.manager","model_account_analytic_line_plan","account.group_account_manager",1,1,1,1
+"access_account_analytic_journal_plan","account.analytic.journal.plan","model_account_analytic_journal_plan","account.group_account_user",1,1,1,1
+"access_account_analytic_journal_plan_manager","account.analytic.journal.plan","model_account_analytic_journal_plan","account.group_account_manager",1,1,1,1
+"access_account_analytic_journal_plan_project_user","account.analytic.journal.plan project user","model_account_analytic_journal_plan","project.group_project_user",1,0,0,0
+"access_account_analytic_journal_plan_project_manager","account.analytic.journal.plan project manager","model_account_analytic_journal_plan","project.group_project_manager",1,0,0,0
+"access_account_period_project_user","account.period project user","account.model_account_period","project.group_project_user",1,0,0,0
+"access_account_period_project_manager","account.period project manager","account.model_account_period","project.group_project_manager",1,0,0,0
+"access_account_analytic_line_commit_project_user","account.analytic.line.commit project user","model_account_analytic_line_commit","project.group_project_user",1,1,1,1
+"access_account_period_project_user","account.period project user","account.model_account_period","project.group_project_user",1,0,0,0
+"access_account_period_project_manager","account.period project manager","account.model_account_period","project.group_project_manager",1,0,0,0
+"access_account_analytic_line_commit_project_manager","account.analytic.line.commit project manager","model_account_analytic_line_commit","project.group_project_manager",1,1,1,1
+"access_account_analytic_line_commit","account.analytic.line.commit","model_account_analytic_line_commit","account.group_account_user",1,1,1,1
+"access_account_analytic_line_commit_manager","account.analytic.line.commit.manager","model_account_analytic_line_commit","account.group_account_manager",1,1,1,1
+"access_account_analytic_journal_commit","account.analytic.journal.commit","model_account_analytic_journal_commit","account.group_account_user",1,1,1,1
+"access_account_analytic_journal_commit_manager","account.analytic.journal.commit","model_account_analytic_journal_commit","account.group_account_manager",1,1,1,1
+"access_account_analytic_journal_commit_project_user","account.analytic.journal.commit project user","model_account_analytic_journal_commit","project.group_project_user",1,0,0,0
+"access_account_analytic_journal_commit_project_manager","account.analytic.journal.commit project manager","model_account_analytic_journal_commit","project.group_project_manager",1,0,0,0
+
=== added file 'project_cost/security/project_cost_security.xml'
--- project_cost/security/project_cost_security.xml 1970-01-01 00:00:00 +0000
+++ project_cost/security/project_cost_security.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp><data>
+
+
+
+</data></openerp>
=== added directory 'project_cost/wizard'
=== added file 'project_cost/wizard/__init__.py'
--- project_cost/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ project_cost/wizard/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_analytic_journal_plan_report
+import account_analytic_journal_commit_report
+
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost/wizard/account_analytic_journal_commit_report.py'
--- project_cost/wizard/account_analytic_journal_commit_report.py 1970-01-01 00:00:00 +0000
+++ project_cost/wizard/account_analytic_journal_commit_report.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import time
+
+from osv import osv, fields
+
+class account_analytic_journal_commit_report(osv.osv_memory):
+ _name = 'account_analytic_journal_commit_report'
+ _description = 'Account Analytic Commitment Journal'
+
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
+ }
+
+ _defaults = {
+ 'date1': lambda *a: time.strftime('%Y-01-01'),
+ 'date2': lambda *a: time.strftime('%Y-%m-%d')
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.journal.commit',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.journal.commit',
+ 'datas': datas,
+ }
+
+account_analytic_journal_commit_report()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added file 'project_cost/wizard/account_analytic_journal_commit_report_view.xml'
--- project_cost/wizard/account_analytic_journal_commit_report_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost/wizard/account_analytic_journal_commit_report_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="account_analytic_journal_commit_view" model="ir.ui.view">
+ <field name="name">Account Analytic Commitment Journal</field>
+ <field name="model">account_analytic_journal_commit_report</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Select Period">
+ <group colspan="4" col="6">
+ <field name="date1"/>
+ <field name="date2"/>
+ </group>
+ <separator colspan="4"/>
+ <group colspan="4" col="6">
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="check_report" string="Print" type="object" icon="gtk-print"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_account_analytic_journal_commit" model="ir.actions.act_window">
+ <field name="name">Analytic Commitments Journal</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">account_analytic_journal_commit_report</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="account_analytic_journal_commit_view"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="account_analytic_journal_commit_values">
+ <field name="model_id" ref="project_cost.model_account_analytic_journal_commit" />
+ <field name="object" eval="1" />
+ <field name="name">Account Analytic Journal</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_journal_commit'))" />
+ <field name="key">action</field>
+ <field name="model">account.analytic.journal.commit</field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'project_cost/wizard/account_analytic_journal_plan_report.py'
--- project_cost/wizard/account_analytic_journal_plan_report.py 1970-01-01 00:00:00 +0000
+++ project_cost/wizard/account_analytic_journal_plan_report.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import time
+
+from osv import osv, fields
+
+class account_analytic_journal_plan_report(osv.osv_memory):
+ _name = 'account_analytic_journal_plan_report'
+ _description = 'Account Analytic Planning Journal'
+
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
+ }
+
+ _defaults = {
+ 'date1': lambda *a: time.strftime('%Y-01-01'),
+ 'date2': lambda *a: time.strftime('%Y-%m-%d')
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.journal.plan',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.journal.plan',
+ 'datas': datas,
+ }
+
+account_analytic_journal_plan_report()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added file 'project_cost/wizard/account_analytic_journal_plan_report_view.xml'
--- project_cost/wizard/account_analytic_journal_plan_report_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost/wizard/account_analytic_journal_plan_report_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="account_analytic_journal_plan_view" model="ir.ui.view">
+ <field name="name">Account Analytic Planning Journal</field>
+ <field name="model">account_analytic_journal_plan_report</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Select Period">
+ <group colspan="4" col="6">
+ <field name="date1"/>
+ <field name="date2"/>
+ </group>
+ <separator colspan="4"/>
+ <group colspan="4" col="6">
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="check_report" string="Print" type="object" icon="gtk-print"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_account_analytic_journal_plan" model="ir.actions.act_window">
+ <field name="name">Analytic Planning Journal</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">account_analytic_journal_plan_report</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="account_analytic_journal_plan_view"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="account_analytic_journal_plan_values">
+ <field name="model_id" ref="project_cost.model_account_analytic_journal_plan" />
+ <field name="object" eval="1" />
+ <field name="name">Account Analytic Journal</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_journal_plan'))" />
+ <field name="key">action</field>
+ <field name="model">account.analytic.journal.plan</field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
=== added directory 'project_cost_analysis'
=== renamed directory 'project_cost_analysis' => 'project_cost_analysis.moved'
=== added file 'project_cost_analysis/__init__.py'
--- project_cost_analysis/__init__.py 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import report
+import wizard
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_analysis/__openerp__.py'
--- project_cost_analysis/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+ "name": "Project Management",
+ "version": "1.0",
+ "author": "Eficent, Nervia Consultores",
+ "website": "",
+ "category": "Generic Modules/Projects & Services",
+ "depends": ["account","account_budget", "product", "analytic", "board", "project","project_scope_wbs","project_cost"],
+ "description": """Eficent Project Management. Project Cost Analysis
+ - The aim is to enable the project manager can see at all times the relationshipbetween the planned cost, budget,
+ current theoretical cost actual cost of the project.
+ - A report for analytic account Cost Analysis is provided. For each analytical account associated (taking into account the child accounts) breaks down the following information:
+ * Analytical Account Code
+ * Analytical Account Name
+ * Planned Cost
+ * Budgeted Cost
+ * Current theoretical cost
+ * Current Actual Cost
+ - A report view to display the analytic resource usage. That is, comparing the planned and actual costs with the possibility to group by product, analytic account, period,...
+ """,
+ "init_xml": [
+ ],
+ "update_xml": [
+ "security/ir.model.access.csv",
+ "account_analytic_balance_plan_report.xml",
+ "wizard/account_analytic_balance_plan_report_view.xml",
+ "report/account_analytic_resource_usage_view.xml",
+ "report/account_analytic_resource_usage_product_view.xml",
+
+ ],
+ 'demo_xml': [
+
+ ],
+ 'test':[
+ ],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_analysis/account_analytic_balance_plan_report.xml'
--- project_cost_analysis/account_analytic_balance_plan_report.xml 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/account_analytic_balance_plan_report.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <report auto="False" id="account_analytic_balance_plan_print" menu="False"
+ model="account.analytic.account" name="account.analytic.balance.plan"
+ rml="project_cost_analysis/report/analytic_balance_plan.rml" string="Account Analytic Planning Balance"/>
+
+ </data>
+</openerp>
=== added directory 'project_cost_analysis/i18n'
=== added file 'project_cost_analysis/i18n/es.mo'
Binary files project_cost_analysis/i18n/es.mo 1970-01-01 00:00:00 +0000 and project_cost_analysis/i18n/es.mo 2013-01-22 10:02:35 +0000 differ
=== added file 'project_cost_analysis/i18n/es.po'
--- project_cost_analysis/i18n/es.po 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/i18n/es.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,558 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_cost_analysis
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-08-29 22:52+0000\n"
+"PO-Revision-Date: 2012-08-30 00:55+0100\n"
+"Last-Translator: Jordi Ballester <jordi.ballester@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Group By..."
+msgstr "Agrupar Por.."
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_credit_plan_commit:0
+msgid "Plan to Commit credit deviation"
+msgstr "G. plan-compro."
+
+#. module: project_cost_analysis
+#: model:ir.ui.menu,name:project_cost_analysis.menu_board_resource_usage_product
+msgid "Resource Usage by Product Dashboard"
+msgstr "Tablero de Análisis de Rentabilidad"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "March"
+msgstr "Marzo"
+
+#. module: project_cost_analysis
+#: field:account.analytic.balance.plan,date1:0
+msgid "Start of period"
+msgstr "Inicio de periodo"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_balance_plan
+msgid "Analytic Planning Balance"
+msgstr "Balance Analítico para Planificación"
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_debit_plan_commit:0
+msgid "Plan to Commit debit deviation"
+msgstr "I. plan-compro."
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.open_board_resource_usage_product
+msgid "Tablero de análisis de rentabilidad"
+msgstr "Tablero de análisis de rentabilidad"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,unit_amount_commit:0
+#: field:report.account.analytic.resource.usage.product,unit_amount_commit:0
+msgid "Commited Quantity"
+msgstr "Cantidad Comprometida"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,day:0
+msgid "Day"
+msgstr "Dia"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,product_uom_id:0
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,product_uom_id:0
+msgid "UoM"
+msgstr "UdM"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Account"
+msgstr "Cuenta"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Commited"
+msgstr "Comprometido"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_debit_plan:0
+msgid "Planned Debit"
+msgstr "I. plan."
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Code"
+msgstr "Código"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_amounts_graph
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_amounts_graph
+msgid "Resource Usage (Amounts)"
+msgstr "Análisis de Rentabilidad (Importes)"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_amounts_graph
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_quantities_graph
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_tree
+msgid "This report allows you to anlalyze and control the planned usage of resources of your projects."
+msgstr "Este informe le permite analizar y controlar la planificación de los recursos de sus proyectos."
+
+#. module: project_cost_analysis
+#: field:account.analytic.balance.plan,empty_acc:0
+msgid "Empty Accounts ? "
+msgstr "Cuentas Vacías ? "
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage,account_id:0
+#: field:report.account.analytic.resource.usage.product,account_id:0
+msgid "Analytic Account"
+msgstr "Cuenta Analítica"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,amount_real:0
+msgid "Real Amount"
+msgstr "Importe Real"
+
+#. module: project_cost_analysis
+#: help:report.account.analytic.resource.usage,unit_amount_commit:0
+#: help:report.account.analytic.resource.usage,unit_amount_plan:0
+#: help:report.account.analytic.resource.usage,unit_amount_real:0
+#: help:report.account.analytic.resource.usage.product,unit_amount_commit:0
+#: help:report.account.analytic.resource.usage.product,unit_amount_plan:0
+#: help:report.account.analytic.resource.usage.product,unit_amount_real:0
+msgid "Specifies the amount of quantity to count."
+msgstr "Especifica el importe de la cantidad a contar."
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_credit_plan_real:0
+msgid "Plan to Real credit deviation"
+msgstr "G. Plan-Real"
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_real_plan:0
+msgid "Real to Planned deviation"
+msgstr "Bal. real-plan"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_product_amounts_graph
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_product_quantities_graph
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_product_tree
+msgid "Este informe permite analizar y controlar el uso planificado de recursos de tus proyectos en base a los productos."
+msgstr "Este informe permite analizar y controlar el uso planificado de recursos de tus proyectos en base a los productos."
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Debit"
+msgstr "Débito"
+
+#. module: project_cost_analysis
+#: model:ir.actions.report.xml,name:project_cost_analysis.account_analytic_balance_plan_print
+#: model:ir.model,name:project_cost_analysis.model_account_analytic_balance_plan
+msgid "Account Analytic Planning Balance"
+msgstr "Balance de Cuenta Analítica para Planificación"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Resource Usage - Planned Amounts"
+msgstr "Análisis de Rentabilidad - Importes Planificados"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid ";Status:"
+msgstr ";Estado:"
+
+#. module: project_cost_analysis
+#: view:account.analytic.balance.plan:0
+msgid "Print"
+msgstr "Imprimir"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,unit_amount_plan:0
+#: field:report.account.analytic.resource.usage.product,unit_amount_plan:0
+msgid "Planned Quantity"
+msgstr "Cantidad Planificada"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "July"
+msgstr "Julio"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Real-Plan dev."
+msgstr "Bal. Real-Plan"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_credit_plan:0
+msgid "Planned Credit"
+msgstr "G. plan."
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+#: field:account.analytic.balance.plan,crossovered_budget_id:0
+msgid "Budget"
+msgstr "Presupuesto"
+
+#. module: project_cost_analysis
+#: view:account.analytic.balance.plan:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Start Date:"
+msgstr "Fecha comienzo:"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Resource Usage - Planned Quantities"
+msgstr "Análisis de Rentabilidad - Cantidades Planificadas"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "September"
+msgstr "Septiembre"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "December"
+msgstr "Diciembre"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,month:0
+msgid "Month"
+msgstr "Mes"
+
+#. module: project_cost_analysis
+#: model:ir.model,name:project_cost_analysis.model_report_account_analytic_resource_usage_product
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_pr_tree
+msgid "Resource Usage Analysis by Product"
+msgstr "Análisis de Rentabilidad"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,user_id:0
+msgid "User"
+msgstr "Usuario"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Resource usage"
+msgstr "Análisis de Rentabilidad"
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_debit_real_commit:0
+msgid "Commit to Real debit deviation"
+msgstr "I. Compro.-Real"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_tree
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_tree
+msgid "Resource Usage Analysis"
+msgstr "Análisis de Rentabilidad"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "August"
+msgstr "Agosto"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.open_board_resource_usage
+msgid "Project Resource Usage"
+msgstr "Análisis de Rentabilidad de Proyectos"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "June"
+msgstr "Junio"
+
+#. module: project_cost_analysis
+#: model:ir.ui.menu,name:project_cost_analysis.menu_board_resource_usage
+msgid "Resource Usage Dashboard"
+msgstr "Tablero de Análisis de Rentabiliad"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_commit:0
+msgid "Commited Balance"
+msgstr "Bal. Compro."
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Resource Usage Graph (Quantities)"
+msgstr "Gráfico de Uso de Recursos (Cantidades)"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Plan"
+msgstr "Plan"
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage,date:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_product_amounts_graph
+msgid "Análisis de Rentabilidad (Importes)"
+msgstr "Análisis de Rentabilidad (Importes)"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "November"
+msgstr "Noviembre"
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Resource Usage by Product Graph (Quantities)"
+msgstr "Gráfico de Análisis de Rentabilidad (Cantidades)"
+
+#. module: project_cost_analysis
+#: help:report.account.analytic.resource.usage,amount_commit:0
+#: help:report.account.analytic.resource.usage,amount_plan:0
+#: help:report.account.analytic.resource.usage,amount_real:0
+#: help:report.account.analytic.resource.usage.product,amount_commit:0
+#: help:report.account.analytic.resource.usage.product,amount_credit_commit:0
+#: help:report.account.analytic.resource.usage.product,amount_credit_plan:0
+#: help:report.account.analytic.resource.usage.product,amount_credit_real:0
+#: help:report.account.analytic.resource.usage.product,amount_debit_commit:0
+#: help:report.account.analytic.resource.usage.product,amount_debit_plan:0
+#: help:report.account.analytic.resource.usage.product,amount_debit_real:0
+#: help:report.account.analytic.resource.usage.product,amount_plan:0
+#: help:report.account.analytic.resource.usage.product,amount_real:0
+msgid "Calculated by multiplying the quantity and the price given in the Product's cost price. Always expressed in the company main currency."
+msgstr "Calculated by multiplying the quantity and the price given in the Product's cost price. Always expressed in the company main currency."
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "October"
+msgstr "Octubre"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Actual"
+msgstr "Actual"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "January"
+msgstr "Enero"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,unit_amount_real:0
+#: field:report.account.analytic.resource.usage.product,unit_amount_real:0
+msgid "Real Quantity"
+msgstr "Cantidad Real"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Credit"
+msgstr "Crédito"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_real:0
+msgid "Real Balance"
+msgstr "Bal. Real"
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Dashboard"
+msgstr "Tablero"
+
+#. module: project_cost_analysis
+#: field:account.analytic.balance.plan,date2:0
+msgid "End of period"
+msgstr "Fin de periodo"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_product_tree
+msgid "Análisis de Rentabilidad"
+msgstr "Análisis de Rentabilidad"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Balance"
+msgstr "Balance"
+
+#. module: project_cost_analysis
+#: help:account.analytic.balance.plan,empty_acc:0
+msgid "Check if you want to display Accounts with 0 balance too."
+msgstr "Comprobar si se desea mostrar las Cuentas con saldo 0 también."
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_plan:0
+msgid "Planned Balance"
+msgstr "Bal. Plan"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Quantity"
+msgstr "Cantidad"
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Resource Usage Graph (Amounts)"
+msgstr "Gráfico de Uso de Recursos (Importes)"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,period_id:0
+msgid "Period"
+msgstr "Periodo"
+
+#. module: project_cost_analysis
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_pr_quants_graph
+msgid "Resource Usage by Product (Quantities)"
+msgstr "Análisis de Rentabilidad (Cantidades)"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_debit_commit:0
+msgid "Commited Debit"
+msgstr "I. compro."
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_credit_commit_real:0
+msgid "Commit to Real credit deviation"
+msgstr "G. compro-real"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_product_quantities_graph
+msgid "Análisis de Rentabilidad (Cantidades)"
+msgstr "Análisis de Rentabilidad (Cantidades)"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Account Name"
+msgstr "Nombre de Cuenta"
+
+#. module: project_cost_analysis
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_pr_amts_graph
+msgid "Resource Usage by product (Amounts)"
+msgstr "Análisis de Rentabilidad (Importes)"
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_debit_real_plan:0
+msgid "Plan to Real debit deviation"
+msgstr "I. plan-real"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,product_id:0
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,product_id:0
+msgid "Product"
+msgstr "Producto"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "May"
+msgstr "Mayo"
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Resource Usage by Product Graph (Amounts)"
+msgstr "Gráfico de Análisis de Rentabilidad (Importes)"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,amount_plan:0
+msgid "Planned Amount"
+msgstr "Importe Planificado"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Analytic Balance -"
+msgstr "Balance Analítico -"
+
+#. module: project_cost_analysis
+#: view:account.analytic.balance.plan:0
+msgid "Select Period"
+msgstr "Seleccionar Periodo"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "February"
+msgstr "Febrero"
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_quantities_graph
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_quantities_graph
+msgid "Resource Usage (Quantities)"
+msgstr "Análisis de Rentabilidad (Cantidades)"
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "April"
+msgstr "Abril"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_credit_commit:0
+msgid "Commited Credit"
+msgstr "G. compro."
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_credit_real:0
+msgid "Real Credit"
+msgstr "G. real"
+
+#. module: project_cost_analysis
+#: model:ir.model,name:project_cost_analysis.model_report_account_analytic_resource_usage
+msgid "Resouce Usage Analysis"
+msgstr "Análisis de Rentabilidad"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,amount_commit:0
+msgid "Commited Amount"
+msgstr "Importe Comprometido"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_debit_real:0
+msgid "Real Debit"
+msgstr "I. real"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid ";End Date:"
+msgstr ";Fecha Fin:"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,year:0
+msgid "Year"
+msgstr "Año"
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Total"
+msgstr "Total"
+
=== added file 'project_cost_analysis/i18n/project_cost_analysis.pot'
--- project_cost_analysis/i18n/project_cost_analysis.pot 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/i18n/project_cost_analysis.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,558 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_cost_analysis
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-08-29 22:52+0000\n"
+"PO-Revision-Date: 2012-08-29 22:52+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Group By..."
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_credit_plan_commit:0
+msgid "Plan to Commit credit deviation"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.ui.menu,name:project_cost_analysis.menu_board_resource_usage_product
+msgid "Resource Usage by Product Dashboard"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "March"
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:account.analytic.balance.plan,date1:0
+msgid "Start of period"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_balance_plan
+msgid "Analytic Planning Balance"
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_debit_plan_commit:0
+msgid "Plan to Commit debit deviation"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.open_board_resource_usage_product
+msgid "Tablero de análisis de rentabilidad"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,unit_amount_commit:0
+#: field:report.account.analytic.resource.usage.product,unit_amount_commit:0
+msgid "Commited Quantity"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,day:0
+msgid "Day"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,product_uom_id:0
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,product_uom_id:0
+msgid "UoM"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Account"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Commited"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_debit_plan:0
+msgid "Planned Debit"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Code"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_amounts_graph
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_amounts_graph
+msgid "Resource Usage (Amounts)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_amounts_graph
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_quantities_graph
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_tree
+msgid "This report allows you to anlalyze and control the planned usage of resources of your projects."
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:account.analytic.balance.plan,empty_acc:0
+msgid "Empty Accounts ? "
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage,account_id:0
+#: field:report.account.analytic.resource.usage.product,account_id:0
+msgid "Analytic Account"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,amount_real:0
+msgid "Real Amount"
+msgstr ""
+
+#. module: project_cost_analysis
+#: help:report.account.analytic.resource.usage,unit_amount_commit:0
+#: help:report.account.analytic.resource.usage,unit_amount_plan:0
+#: help:report.account.analytic.resource.usage,unit_amount_real:0
+#: help:report.account.analytic.resource.usage.product,unit_amount_commit:0
+#: help:report.account.analytic.resource.usage.product,unit_amount_plan:0
+#: help:report.account.analytic.resource.usage.product,unit_amount_real:0
+msgid "Specifies the amount of quantity to count."
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_credit_plan_real:0
+msgid "Plan to Real credit deviation"
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_real_plan:0
+msgid "Real to Planned deviation"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_product_amounts_graph
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_product_quantities_graph
+#: model:ir.actions.act_window,help:project_cost_analysis.action_account_analytic_resource_usage_product_tree
+msgid "Este informe permite analizar y controlar el uso planificado de recursos de tus proyectos en base a los productos."
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Debit"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.report.xml,name:project_cost_analysis.account_analytic_balance_plan_print
+#: model:ir.model,name:project_cost_analysis.model_account_analytic_balance_plan
+msgid "Account Analytic Planning Balance"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Resource Usage - Planned Amounts"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid ";Status:"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:account.analytic.balance.plan:0
+msgid "Print"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,unit_amount_plan:0
+#: field:report.account.analytic.resource.usage.product,unit_amount_plan:0
+msgid "Planned Quantity"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "July"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Real-Plan dev."
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_credit_plan:0
+msgid "Planned Credit"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+#: field:account.analytic.balance.plan,crossovered_budget_id:0
+msgid "Budget"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:account.analytic.balance.plan:0
+msgid "Cancel"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Start Date:"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Resource Usage - Planned Quantities"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "September"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "December"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,month:0
+msgid "Month"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.model,name:project_cost_analysis.model_report_account_analytic_resource_usage_product
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_pr_tree
+msgid "Resource Usage Analysis by Product"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,user_id:0
+msgid "User"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: view:report.account.analytic.resource.usage.product:0
+msgid "Resource usage"
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_debit_real_commit:0
+msgid "Commit to Real debit deviation"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_tree
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_tree
+msgid "Resource Usage Analysis"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "August"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.open_board_resource_usage
+msgid "Project Resource Usage"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "June"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.ui.menu,name:project_cost_analysis.menu_board_resource_usage
+msgid "Resource Usage Dashboard"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_commit:0
+msgid "Commited Balance"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Resource Usage Graph (Quantities)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Plan"
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage,date:0
+msgid "Date"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_product_amounts_graph
+msgid "Análisis de Rentabilidad (Importes)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "November"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Resource Usage by Product Graph (Quantities)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: help:report.account.analytic.resource.usage,amount_commit:0
+#: help:report.account.analytic.resource.usage,amount_plan:0
+#: help:report.account.analytic.resource.usage,amount_real:0
+#: help:report.account.analytic.resource.usage.product,amount_commit:0
+#: help:report.account.analytic.resource.usage.product,amount_credit_commit:0
+#: help:report.account.analytic.resource.usage.product,amount_credit_plan:0
+#: help:report.account.analytic.resource.usage.product,amount_credit_real:0
+#: help:report.account.analytic.resource.usage.product,amount_debit_commit:0
+#: help:report.account.analytic.resource.usage.product,amount_debit_plan:0
+#: help:report.account.analytic.resource.usage.product,amount_debit_real:0
+#: help:report.account.analytic.resource.usage.product,amount_plan:0
+#: help:report.account.analytic.resource.usage.product,amount_real:0
+msgid "Calculated by multiplying the quantity and the price given in the Product's cost price. Always expressed in the company main currency."
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "October"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Actual"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "January"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,unit_amount_real:0
+#: field:report.account.analytic.resource.usage.product,unit_amount_real:0
+msgid "Real Quantity"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Credit"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_real:0
+msgid "Real Balance"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Dashboard"
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:account.analytic.balance.plan,date2:0
+msgid "End of period"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_product_tree
+msgid "Análisis de Rentabilidad"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Balance"
+msgstr ""
+
+#. module: project_cost_analysis
+#: help:account.analytic.balance.plan,empty_acc:0
+msgid "Check if you want to display Accounts with 0 balance too."
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_plan:0
+msgid "Planned Balance"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Quantity"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Resource Usage Graph (Amounts)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,period_id:0
+msgid "Period"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_pr_quants_graph
+msgid "Resource Usage by Product (Quantities)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_debit_commit:0
+msgid "Commited Debit"
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_credit_commit_real:0
+msgid "Commit to Real credit deviation"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_product_quantities_graph
+msgid "Análisis de Rentabilidad (Cantidades)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Account Name"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_pr_amts_graph
+msgid "Resource Usage by product (Amounts)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: field:report.account.analytic.resource.usage.product,amount_debit_real_plan:0
+msgid "Plan to Real debit deviation"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,product_id:0
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "May"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:board.board:0
+msgid "Resource Usage by Product Graph (Amounts)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,amount_plan:0
+msgid "Planned Amount"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Analytic Balance -"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:account.analytic.balance.plan:0
+msgid "Select Period"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "February"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.actions.act_window,name:project_cost_analysis.action_account_analytic_resource_usage_quantities_graph
+#: model:ir.ui.menu,name:project_cost_analysis.menu_action_account_analytic_resource_usage_quantities_graph
+msgid "Resource Usage (Quantities)"
+msgstr ""
+
+#. module: project_cost_analysis
+#: selection:report.account.analytic.resource.usage,month:0
+msgid "April"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_credit_commit:0
+msgid "Commited Credit"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_credit_real:0
+msgid "Real Credit"
+msgstr ""
+
+#. module: project_cost_analysis
+#: model:ir.model,name:project_cost_analysis.model_report_account_analytic_resource_usage
+msgid "Resouce Usage Analysis"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,amount_commit:0
+msgid "Commited Amount"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage.product:0
+#: field:report.account.analytic.resource.usage.product,amount_debit_real:0
+msgid "Real Debit"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid ";End Date:"
+msgstr ""
+
+#. module: project_cost_analysis
+#: view:report.account.analytic.resource.usage:0
+#: field:report.account.analytic.resource.usage,year:0
+msgid "Year"
+msgstr ""
+
+#. module: project_cost_analysis
+#: report:account.analytic.balance.plan:0
+msgid "Total"
+msgstr ""
+
=== added directory 'project_cost_analysis/report'
=== added file 'project_cost_analysis/report/__init__.py'
--- project_cost_analysis/report/__init__.py 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/report/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import analytic_balance_plan
+import account_analytic_resource_usage
+import account_analytic_resource_usage_product
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'project_cost_analysis/report/account_analytic_resource_usage.py'
--- project_cost_analysis/report/account_analytic_resource_usage.py 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/report/account_analytic_resource_usage.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,137 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields,osv
+import tools
+
+class report_account_analytic_resource_usage(osv.osv):
+ _name = "report.account.analytic.resource.usage"
+ _description = "Resource Usage Analysis"
+ _auto = False
+ _columns = {
+ 'date': fields.date('Date', readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
+ 'year': fields.char('Year', size=64, required=False, readonly=True),
+ 'period_id': fields.many2one('account.period', 'Period', readonly=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
+ 'product_id': fields.many2one('product.product', 'Product', readonly=True),
+ 'product_uom_id': fields.many2one('product.uom', 'UoM', readonly=True),
+ 'user_id': fields.many2one('res.users', 'User', readonly=True),
+ 'amount_plan': fields.float('Planned Amount', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'amount_commit': fields.float('Commited Amount', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'unit_amount_plan': fields.float('Planned Quantity', help='Specifies the amount of quantity to count.'),
+ 'unit_amount_commit': fields.float('Commited Quantity', help='Specifies the amount of quantity to count.'),
+ 'amount_real': fields.float('Real Amount', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'unit_amount_real': fields.float('Real Quantity', readonly=True, help='Specifies the amount of quantity to count.'),
+ }
+
+
+ def init(self, cr):
+
+ """
+ @param cr: the current row, from the database cursor,
+ """
+ tools.drop_view_if_exists(cr, 'report_account_analytic_resource_usage')
+
+ cr.execute("""
+ create or replace view report_account_analytic_resource_usage as (
+
+ SELECT
+ ROW_NUMBER() over (order by tot.date) as id,
+ tot.date as date,
+ to_char(tot.date, 'YYYY') as year,
+ to_char(tot.date, 'MM') as month,
+ to_char(tot.date, 'YYYY-MM-DD') as day,
+ sum(tot.unit_amount_real) as unit_amount_real,
+ sum(tot.unit_amount_plan) as unit_amount_plan,
+ sum(tot.unit_amount_commit) as unit_amount_commit,
+ sum(tot.amount_real) as amount_real,
+ sum(tot.amount_plan) as amount_plan,
+ sum(tot.amount_commit) as amount_commit,
+ tot.period_id,
+ tot.account_id,
+ tot.product_id,
+ tot.product_uom_id,
+ tot.user_id
+ FROM
+ (SELECT
+ CAST( unit_amount AS FLOAT) AS unit_amount_real,
+ CAST( 0 AS FLOAT) AS unit_amount_plan,
+ CAST( 0 AS FLOAT) AS unit_amount_commit,
+ CAST( amount AS FLOAT) AS amount_real,
+ CAST( 0 AS FLOAT) AS amount_plan,
+ CAST( 0 AS FLOAT) AS amount_commit,
+ date,
+ period_id,
+ account_id,
+ product_id,
+ product_uom_id,
+ user_id
+ FROM account_analytic_line
+
+ UNION ALL
+ SELECT
+ CAST( 0 AS FLOAT) AS unit_amount_real,
+ CAST( unit_amount AS FLOAT) AS unit_amount_plan,
+ CAST( 0 AS FLOAT) AS unit_amount_commit,
+ CAST( 0 AS FLOAT) AS amount_real,
+ CAST( amount AS FLOAT) AS amount_plan,
+ CAST( 0 AS FLOAT) AS amount_commit,
+ date,
+ period_id,
+ account_id,
+ product_id,
+ product_uom_id,
+ user_id
+ FROM account_analytic_line_plan
+ UNION ALL
+ SELECT
+ CAST( 0 AS FLOAT) AS unit_amount_real,
+ CAST( 0 AS FLOAT) AS unit_amount_plan,
+ CAST( unit_amount AS FLOAT) AS unit_amount_commit,
+ CAST( 0 AS FLOAT) AS amount_real,
+ CAST( 0 AS FLOAT) AS amount_plan,
+ CAST( amount AS FLOAT) AS amount_commit,
+ date,
+ period_id,
+ account_id,
+ product_id,
+ product_uom_id,
+ user_id
+ FROM account_analytic_line_commit
+
+ ) AS tot
+ GROUP BY
+ tot.date,
+ tot.period_id,
+ tot.account_id,
+ tot.product_id,
+ tot.product_uom_id,
+ user_id
+ ORDER BY tot.date
+
+ )""")
+
+
+report_account_analytic_resource_usage()
+
+
=== added file 'project_cost_analysis/report/account_analytic_resource_usage_product.py'
--- project_cost_analysis/report/account_analytic_resource_usage_product.py 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/report/account_analytic_resource_usage_product.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,207 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields,osv
+import tools
+
+class report_account_analytic_resource_usage_product(osv.osv):
+ _name = "report.account.analytic.resource.usage.product"
+ _description = "Resource Usage Analysis by Product"
+ _auto = False
+ _columns = {
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
+ 'product_id': fields.many2one('product.product', 'Product', readonly=True),
+ 'product_uom_id': fields.many2one('product.uom', 'UoM', readonly=True),
+ 'amount_real': fields.float('Real Balance', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'amount_debit_real': fields.float('Real Debit', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'amount_credit_real': fields.float('Real Credit', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'amount_plan': fields.float('Planned Balance', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'amount_debit_plan': fields.float('Planned Debit', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'amount_credit_plan': fields.float('Planned Credit', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'amount_commit': fields.float('Commited Balance', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'amount_debit_commit': fields.float('Commited Debit', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'amount_credit_commit': fields.float('Commited Credit', readonly=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
+ 'unit_amount_real': fields.float('Real Quantity', readonly=True, help='Specifies the amount of quantity to count.'),
+ 'unit_amount_plan': fields.float('Planned Quantity', help='Specifies the amount of quantity to count.'),
+ 'unit_amount_commit': fields.float('Commited Quantity', help='Specifies the amount of quantity to count.'),
+ 'amount_debit_real_plan': fields.float('Plan to Real debit deviation', readonly=True),
+ 'amount_debit_real_commit': fields.float('Commit to Real debit deviation', readonly=True),
+ 'amount_debit_plan_commit': fields.float('Plan to Commit debit deviation', readonly=True),
+ 'amount_credit_plan_real': fields.float('Plan to Real credit deviation', readonly=True),
+ 'amount_credit_plan_commit': fields.float('Plan to Commit credit deviation', readonly=True),
+ 'amount_credit_commit_real': fields.float('Commit to Real credit deviation', readonly=True),
+ 'amount_real_plan': fields.float('Real to Planned deviation', readonly=True),
+ }
+
+
+ def init(self, cr):
+
+ """
+ @param cr: the current row, from the database cursor,
+ """
+ tools.drop_view_if_exists(cr, 'report_account_analytic_resource_usage_product')
+
+ cr.execute("""
+ create or replace view report_account_analytic_resource_usage_product as (
+ SELECT
+ ROW_NUMBER() over (order by tot.account_id) as id,
+ sum(tot.unit_amount_real) as unit_amount_real,
+ sum(tot.unit_amount_plan) as unit_amount_plan,
+ sum(tot.unit_amount_commit) as unit_amount_commit,
+ sum(tot.amount_real) as amount_real,
+ sum(CASE WHEN tot.amount_real > 0
+ THEN tot.amount_real
+ ELSE 0.0
+ END) as amount_debit_real,
+ sum(CASE WHEN tot.amount_real < 0
+ THEN -tot.amount_real
+ ELSE 0.0
+ END) as amount_credit_real,
+ sum(tot.amount_plan) as amount_plan,
+ sum(CASE WHEN tot.amount_plan > 0
+ THEN tot.amount_plan
+ ELSE 0.0
+ END) as amount_debit_plan,
+ sum(CASE WHEN tot.amount_plan < 0
+ THEN -tot.amount_plan
+ ELSE 0.0
+ END) as amount_credit_plan,
+ sum(tot.amount_commit) as amount_commit,
+ sum(CASE WHEN tot.amount_commit > 0
+ THEN tot.amount_commit
+ ELSE 0.0
+ END) as amount_debit_commit,
+ sum(CASE WHEN tot.amount_commit < 0
+ THEN -tot.amount_commit
+ ELSE 0.0
+ END) as amount_credit_commit,
+ (sum(CASE WHEN tot.amount_plan < 0
+ THEN -tot.amount_plan
+ ELSE 0.0
+ END)-
+ sum(CASE WHEN tot.amount_real < 0
+ THEN -tot.amount_real
+ ELSE 0.0
+ END)
+ ) as amount_credit_plan_real,
+ (sum(CASE WHEN tot.amount_plan < 0
+ THEN -tot.amount_plan
+ ELSE 0.0
+ END)-
+ sum(CASE WHEN tot.amount_commit < 0
+ THEN -tot.amount_commit
+ ELSE 0.0
+ END)
+ ) as amount_credit_plan_commit,
+ (sum(tot.amount_real)-
+ sum(tot.amount_plan)
+ )as amount_real_plan,
+ (sum(CASE WHEN tot.amount_commit < 0
+ THEN -tot.amount_commit
+ ELSE 0.0
+ END)-
+ sum(CASE WHEN tot.amount_real < 0
+ THEN -tot.amount_real
+ ELSE 0.0
+ END)
+ )as amount_credit_commit_real,
+ (sum(CASE WHEN tot.amount_real > 0
+ THEN tot.amount_real
+ ELSE 0.0
+ END)-
+ sum(CASE WHEN tot.amount_plan > 0
+ THEN tot.amount_plan
+ ELSE 0.0
+ END)
+ ) as amount_debit_real_plan,
+ (sum(CASE WHEN tot.amount_real > 0
+ THEN tot.amount_real
+ ELSE 0.0
+ END) -
+ sum(CASE WHEN tot.amount_commit > 0
+ THEN tot.amount_commit
+ ELSE 0.0
+ END)
+ ) as amount_debit_real_commit,
+ (sum(CASE WHEN tot.amount_plan > 0
+ THEN tot.amount_plan
+ ELSE 0.0
+ END) -
+ sum(CASE WHEN tot.amount_commit > 0
+ THEN tot.amount_commit
+ ELSE 0.0
+ END)
+ ) as amount_debit_plan_commit,
+ tot.account_id,
+ tot.product_uom_id,
+ tot.product_id
+ FROM
+ (SELECT
+ CAST( unit_amount AS FLOAT) AS unit_amount_real,
+ CAST( 0 AS FLOAT) AS unit_amount_plan,
+ CAST( 0 AS FLOAT) AS unit_amount_commit,
+ CAST( amount AS FLOAT) AS amount_real,
+ CAST( 0 AS FLOAT) AS amount_plan,
+ CAST( 0 AS FLOAT) AS amount_commit,
+ account_id,
+ product_id,
+ product_uom_id
+ FROM account_analytic_line
+
+ UNION ALL
+ SELECT
+ CAST( 0 AS FLOAT) AS unit_amount_real,
+ CAST( unit_amount AS FLOAT) AS unit_amount_plan,
+ CAST( 0 AS FLOAT) AS unit_amount_commit,
+ CAST( 0 AS FLOAT) AS amount_real,
+ CAST( amount AS FLOAT) AS amount_plan,
+ CAST( 0 AS FLOAT) AS amount_commit,
+ account_id,
+ product_id,
+ product_uom_id
+ FROM account_analytic_line_plan
+ UNION ALL
+ SELECT
+ CAST( 0 AS FLOAT) AS unit_amount_real,
+ CAST( 0 AS FLOAT) AS unit_amount_plan,
+ CAST( unit_amount AS FLOAT) AS unit_amount_commit,
+ CAST( 0 AS FLOAT) AS amount_real,
+ CAST( 0 AS FLOAT) AS amount_plan,
+ CAST( amount AS FLOAT) AS amount_commit,
+ account_id,
+ product_id,
+ product_uom_id
+ FROM account_analytic_line_commit
+
+ ) AS tot
+ GROUP BY
+ tot.account_id,
+ tot.product_uom_id,
+ tot.product_id
+
+ ORDER BY tot.account_id
+
+ )""")
+
+
+report_account_analytic_resource_usage_product()
+
+
=== added file 'project_cost_analysis/report/account_analytic_resource_usage_product_view.xml'
--- project_cost_analysis/report/account_analytic_resource_usage_product_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/report/account_analytic_resource_usage_product_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+ <record id="view_account_analytic_resource_usage_product_tree" model="ir.ui.view">
+ <field name="name">report.account.analytic.resource.usage.product.tree</field>
+ <field name="model">report.account.analytic.resource.usage.product</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Resource usage" colors="red:((amount_credit_plan_real < 0) or (amount_credit_commit_real < 0))">
+ <field name="product_id"/>
+ <field name="amount_credit_plan" sum='Planned Credit'/>
+ <field name="amount_debit_plan" sum='Planned Debit'/>
+ <field name="amount_credit_commit" sum='Commited Credit'/>
+ <field name="amount_debit_commit" sum='Commited Debit'/>
+ <field name="amount_credit_real" sum='Real Credit'/>
+ <field name="amount_debit_real" sum='Real Debit'/>
+ <field name="amount_credit_plan_real"/>
+ <field name="amount_credit_plan_commit"/>
+ <field name="amount_credit_commit_real"/>
+ <field name="amount_real_plan" sum='Real-Plan dev.'/>
+ <field name="amount_plan" sum='Planned Balance'/>
+ <field name="unit_amount_plan" sum='Planned Quantity'/>
+ <field name="amount_commit" sum='Commited Balance'/>
+ <field name="unit_amount_commit" sum='Commited Quantity'/>
+ <field name="amount_real" sum='Real Balance'/>
+ <field name="unit_amount_real" sum='Real Quantity'/>
+ <field name="account_id"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_resource_usage_product_quantities_graph" model="ir.ui.view">
+ <field name="name">report.account.analytic.resource.usage.product.quantities.graph</field>
+ <field name="model">report.account.analytic.resource.usage.product</field>
+ <field name="type">graph</field>
+ <field name="arch" type="xml">
+ <graph string="Resource Usage - Planned Quantities" type="bar">
+ <field name="unit_amount_plan" operator="+"/>
+ <field name="unit_amount_commit" operator="+"/>
+ <field name="unit_amount_real" operator="+"/>
+ </graph>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_resource_usage_product_amounts_graph" model="ir.ui.view">
+ <field name="name">report.account.analytic.resource.usage.product.amounts.graph</field>
+ <field name="model">report.account.analytic.resource.usage.product</field>
+ <field name="type">graph</field>
+ <field name="arch" type="xml">
+ <graph string="Resource Usage - Planned Amounts" type="bar">
+ <field name="amount_plan" operator="+"/>
+ <field name="amount_commit" operator="+"/>
+ <field name="amount_real" operator="+"/>
+ </graph>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_resource_usage_product_search" model="ir.ui.view">
+ <field name="name">report.account.analytic.resource.usage.product.search</field>
+ <field name="model">report.account.analytic.resource.usage.product</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Resource usage">
+ <group colspan="5" col="5">
+ <field name="account_id"/>
+ <field name="product_id"/>
+
+ </group>
+ <newline/>
+ <group expand="1" string="Group By..." colspan="7" col="8">
+ <filter string="Account" name="account_id" icon="terp-folder-violet" context="{'group_by':'account_id'}"/>
+ <filter string="Product" name="product_id" icon="terp-folder-violet" context="{'group_by':'product_id'}"/>
+ <filter string="UoM" icon="terp-stage" context="{'group_by':'product_uom_id'}" />
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="action_account_analytic_resource_usage_product_tree" model="ir.actions.act_window">
+ <field name="name">Resource Usage Analysis by Product</field>
+ <field name="res_model">report.account.analytic.resource.usage.product</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,graph</field>
+ <field name="view_id" ref="view_account_analytic_resource_usage_product_tree"/>
+ <field name="search_view_id" ref="view_account_analytic_resource_usage_product_search"/>
+ <field name="help">This report allows you to anlalyze and control the planned usage of resources of your projects by product.</field>
+ </record>
+
+ <record id="action_account_analytic_resource_usage_product_quantities_graph" model="ir.actions.act_window">
+ <field name="name">Resource Usage by Product (Quantities)</field>
+ <field name="res_model">report.account.analytic.resource.usage.product</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">graph,tree</field>
+ <field name="view_id" ref="view_account_analytic_resource_usage_product_quantities_graph"/>
+ <field name="search_view_id" ref="view_account_analytic_resource_usage_product_search"/>
+ <field name="help">This report allows you to anlalyze and control the planned usage of resources of your projects by product.</field>
+ </record>
+
+ <record id="action_account_analytic_resource_usage_product_amounts_graph" model="ir.actions.act_window">
+ <field name="name">Resource Usage by product (Amounts)</field>
+ <field name="res_model">report.account.analytic.resource.usage.product</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">graph,tree</field>
+ <field name="view_id" ref="view_account_analytic_resource_usage_product_amounts_graph"/>
+ <field name="search_view_id" ref="view_account_analytic_resource_usage_product_search"/>
+ <field name="help">This report allows you to anlalyze and control the planned usage of resources of your projects by product.</field>
+ </record>
+
+ <record model="ir.ui.view" id="board_project_resource_usage_product">
+ <field name="name">Project Resource Usage by Product Form</field>
+ <field name="model">board.board</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Dashboard">
+ <hpaned>
+ <child1>
+ <action
+ string="Resource Usage by Product Graph (Amounts)"
+ name="%(action_account_analytic_resource_usage_product_amounts_graph)d"
+ colspan="4"
+ height="200"
+ width="250"/>
+
+ <action
+ string="Resource Usage by Product Graph (Quantities)"
+ name="%(action_account_analytic_resource_usage_product_quantities_graph)d"
+ height="200"
+ colspan="4"/>
+
+ </child1>
+ </hpaned>
+ </form>
+ </field>
+ </record>
+
+ <record model="ir.actions.act_window" id="open_board_resource_usage_product">
+ <field name="name">Project Resource Usage by Product</field>
+ <field name="res_model">board.board</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="usage">menu</field>
+ <field name="view_id" ref="board_project_resource_usage_product"/>
+ </record>
+
+
+ <menuitem action="action_account_analytic_resource_usage_product_tree" id="menu_action_account_analytic_resource_usage_pr_tree" parent="base.menu_project_report"/>
+ <menuitem action="action_account_analytic_resource_usage_product_amounts_graph" id="menu_action_account_analytic_resource_usage_pr_amts_graph" parent="base.menu_project_report"/>
+ <menuitem action="action_account_analytic_resource_usage_product_quantities_graph" id="menu_action_account_analytic_resource_usage_pr_quants_graph" parent="base.menu_project_report"/>
+
+
+ <menuitem
+ name="Resource Usage by Product Dashboard" parent="base.menu_project_report"
+ action="open_board_resource_usage_product"
+ sequence="0"
+ id="menu_board_resource_usage_product"
+ icon="terp-graph"/>
+
+
+ </data>
+</openerp>
=== added file 'project_cost_analysis/report/account_analytic_resource_usage_view.xml'
--- project_cost_analysis/report/account_analytic_resource_usage_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/report/account_analytic_resource_usage_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+ <record id="view_account_analytic_resource_usage_tree" model="ir.ui.view">
+ <field name="name">report.account.analytic.resource.usage.tree</field>
+ <field name="model">report.account.analytic.resource.usage</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Resource usage">
+ <field name="day" />
+ <field name="month"/>
+ <field name="year"/>
+ <field name="account_id"/>
+ <field name="period_id"/>
+ <field name="product_id"/>
+ <field name="user_id"/>
+ <field name="product_uom_id"/>
+ <field name="unit_amount_plan" sum='Planned Quantity'/>
+ <field name="unit_amount_commit" sum='Commited Quantity'/>
+ <field name="unit_amount_real" sum='Real Quantity'/>
+ <field name="amount_plan" sum='Planned Amount'/>
+ <field name="amount_commit" sum='Commited Amount'/>
+ <field name="amount_real" sum='Real Amount'/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_resource_usage_quantities_graph" model="ir.ui.view">
+ <field name="name">report.account.analytic.resource.usage.quantities.graph</field>
+ <field name="model">report.account.analytic.resource.usage</field>
+ <field name="type">graph</field>
+ <field name="arch" type="xml">
+ <graph string="Resource Usage - Planned Quantities" type="bar">
+ <field name="period_id"/>
+ <field name="unit_amount_plan" operator="+"/>
+ <field name="unit_amount_commit" operator="+"/>
+ <field name="unit_amount_real" operator="+"/>
+ </graph>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_resource_usage_amounts_graph" model="ir.ui.view">
+ <field name="name">report.account.analytic.resource.usage.amounts.graph</field>
+ <field name="model">report.account.analytic.resource.usage</field>
+ <field name="type">graph</field>
+ <field name="arch" type="xml">
+ <graph string="Resource Usage - Planned Amounts" type="bar">
+ <field name="period_id"/>
+ <field name="amount_plan" operator="+"/>
+ <field name="amount_commit" operator="+"/>
+ <field name="amount_real" operator="+"/>
+ </graph>
+ </field>
+ </record>
+
+ <record id="view_account_analytic_resource_usage_search" model="ir.ui.view">
+ <field name="name">report.account.analytic.resource.usage.search</field>
+ <field name="model">report.account.analytic.resource.usage</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Resource usage">
+ <group colspan="5" col="5">
+ <field name="date"/>
+ <field name="account_id"/>
+ <field name="product_id"/>
+ <field name="user_id"/>
+ <field name="period_id"/>
+ </group>
+ <newline/>
+ <group expand="1" string="Group By..." colspan="7" col="8">
+ <filter string="Account" name="account_id" icon="terp-folder-violet" context="{'group_by':'account_id'}"/>
+ <filter string="Product" name="product_id" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
+ <filter string="User" name="user_id" icon="terp-accessories-archiver" context="{'group_by':'user_id'}"/>
+ <filter string="UoM" icon="terp-stage" context="{'group_by':'product_uom_id'}" />
+ <filter string="Period" icon="terp-go-month" context="{'group_by':'period_id'}"/>
+ <separator orientation="vertical"/>
+ <filter string="Day" name="day" icon="terp-go-today" context="{'group_by':'day'}" help="Creation Date"/>
+ <filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}" help="Creation Date"/>
+ <filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}" help="Creation Date"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="action_account_analytic_resource_usage_tree" model="ir.actions.act_window">
+ <field name="name">Resource Usage Analysis</field>
+ <field name="res_model">report.account.analytic.resource.usage</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,graph</field>
+ <field name="view_id" ref="view_account_analytic_resource_usage_tree"/>
+ <field name="search_view_id" ref="view_account_analytic_resource_usage_search"/>
+ <field name="help">This report allows you to anlalyze and control the planned usage of resources of your projects.</field>
+ </record>
+
+ <record id="action_account_analytic_resource_usage_quantities_graph" model="ir.actions.act_window">
+ <field name="name">Resource Usage (Quantities)</field>
+ <field name="res_model">report.account.analytic.resource.usage</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">graph,tree</field>
+ <field name="view_id" ref="view_account_analytic_resource_usage_quantities_graph"/>
+ <field name="search_view_id" ref="view_account_analytic_resource_usage_search"/>
+ <field name="help">This report allows you to anlalyze and control the planned usage of resources of your projects.</field>
+ </record>
+
+ <record id="action_account_analytic_resource_usage_amounts_graph" model="ir.actions.act_window">
+ <field name="name">Resource Usage (Amounts)</field>
+ <field name="res_model">report.account.analytic.resource.usage</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">graph,tree</field>
+ <field name="view_id" ref="view_account_analytic_resource_usage_amounts_graph"/>
+ <field name="search_view_id" ref="view_account_analytic_resource_usage_search"/>
+ <field name="help">This report allows you to anlalyze and control the planned usage of resources of your projects.</field>
+ </record>
+
+ <record model="ir.ui.view" id="board_project_resource_usage">
+ <field name="name">Project Resource Usage Form</field>
+ <field name="model">board.board</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Dashboard">
+ <hpaned>
+ <child1>
+ <action
+ string="Resource Usage Graph (Amounts)"
+ name="%(action_account_analytic_resource_usage_amounts_graph)d"
+ colspan="4"
+ height="200"
+ width="250"/>
+
+ <action
+ string="Resource Usage Graph (Quantities)"
+ name="%(action_account_analytic_resource_usage_quantities_graph)d"
+ height="200"
+ colspan="4"/>
+
+ </child1>
+ </hpaned>
+ </form>
+ </field>
+ </record>
+
+ <record model="ir.actions.act_window" id="open_board_resource_usage">
+ <field name="name">Project Resource Usage</field>
+ <field name="res_model">board.board</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="usage">menu</field>
+ <field name="view_id" ref="board_project_resource_usage"/>
+ </record>
+
+
+ <menuitem action="action_account_analytic_resource_usage_tree" id="menu_action_account_analytic_resource_usage_tree" parent="base.menu_project_report"/>
+
+ <menuitem action="action_account_analytic_resource_usage_amounts_graph" id="menu_action_account_analytic_resource_usage_amounts_graph" parent="base.menu_project_report"/>
+ <menuitem action="action_account_analytic_resource_usage_quantities_graph" id="menu_action_account_analytic_resource_usage_quantities_graph" parent="base.menu_project_report"/>
+
+
+ <menuitem
+ name="Resource Usage Dashboard" parent="base.menu_project_report"
+ action="open_board_resource_usage"
+ sequence="0"
+ id="menu_board_resource_usage"
+ icon="terp-graph"/>
+
+
+ </data>
+</openerp>
=== added file 'project_cost_analysis/report/analytic_balance_plan.py'
--- project_cost_analysis/report/analytic_balance_plan.py 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/report/analytic_balance_plan.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,350 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+import pooler
+import operator
+from report import report_sxw
+
+#
+# Use period and Journal for selection or resources
+#
+class account_analytic_balance_plan(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(account_analytic_balance_plan, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update( {
+ 'time': time,
+ 'get_objects': self._get_objects,
+ 'move_sum': self._move_sum,
+ 'sum_all': self._sum_all,
+ 'sum_balance': self._sum_balance,
+ 'move_sum_balance': self._move_sum_balance,
+
+ 'move_sum_plan': self._move_sum_plan,
+ 'sum_all_plan': self._sum_all_plan,
+ 'sum_balance_plan': self._sum_balance_plan,
+ 'move_sum_balance_plan': self._move_sum_balance_plan,
+
+ 'move_sum_commit': self._move_sum_commit,
+ 'sum_all_commit': self._sum_all_commit,
+ 'sum_balance_commit': self._sum_balance_commit,
+ 'move_sum_balance_commit': self._move_sum_balance_commit,
+
+ 'move_sum_budget': self._move_sum_budget,
+ 'sum_all_budget': self._sum_all_budget,
+ 'sum_balance_budget': self._sum_balance_budget,
+ 'move_sum_balance_budget': self._move_sum_balance_budget,
+ })
+ self.acc_ids = []
+ self.read_data = []
+ self.empty_acc = False
+ self.acc_data_dict = {}# maintains a relation with an account with its successors.
+ self.acc_data_dict_plan = {}# maintains a relation with an account with its successors.
+ self.acc_data_dict_commit = {}# maintains a relation with an account with its successors.
+ self.acc_data_dict_budget = {}# maintains a relation with an account with its successors.
+ self.acc_sum_list = []# maintains a list of all ids
+ self.acc_sum_list_plan = []# maintains a list of all ids
+ self.acc_sum_list_commit = []# maintains a list of all ids
+ self.acc_sum_list_budget = []# maintains a list of all ids
+
+ def get_children(self, ids):
+ read_data = self.pool.get('account.analytic.account').read(self.cr, self.uid, ids,['child_ids','complete_wbs_code','complete_wbs_name','balance','balance_plan','balance_commit','date_start','date','state'])
+ for data in read_data:
+ if (data['id'] not in self.acc_ids):
+ inculde_empty = True
+ if (not self.empty_acc) and (data['balance'] == 0.00 and data['balance_plan'] == 0.00 and data['balance_commit'] == 0.00):
+ inculde_empty = False
+ if inculde_empty:
+ self.acc_ids.append(data['id'])
+ self.read_data.append(data)
+ if data['child_ids']:
+ self.get_children(data['child_ids'])
+ return True
+
+
+ def _get_objects(self, empty_acc):
+ if self.read_data:
+ return self.read_data
+ self.empty_acc = empty_acc
+ self.read_data = []
+ self.get_children(self.ids)
+ get_key = operator.attrgetter('complete_wbs_code')
+ read_data_sorted = sorted(self.read_data, key = lambda mbr: get_key( mbr ).lower(), reverse = False )
+ return read_data_sorted
+
+
+ def _move_sum(self, account_id, date1, date2, option):
+ if account_id not in self.acc_data_dict:
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])])
+ self.acc_data_dict[account_id] = ids
+ else:
+ ids = self.acc_data_dict[account_id]
+
+ query_params = (tuple(ids), date1, date2)
+ if option == "credit":
+ self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
+ WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
+ elif option == "debit":
+ self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
+ WHERE account_id IN %s\
+ AND date>=%s AND date<=%s AND amount>0",query_params)
+ elif option == "quantity":
+ self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
+ WHERE account_id IN %s\
+ AND date>=%s AND date<=%s",query_params)
+
+ return self.cr.fetchone()[0] or 0.0
+
+ def _move_sum_plan(self, account_id, date1, date2, option):
+ if account_id not in self.acc_data_dict_plan:
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])])
+ self.acc_data_dict_plan[account_id] = ids
+ else:
+ ids = self.acc_data_dict_plan[account_id]
+
+ query_params = (tuple(ids), date1, date2)
+ if option == "credit_plan":
+ self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line_plan \
+ WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
+ elif option == "debit_plan":
+ self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line_plan \
+ WHERE account_id IN %s\
+ AND date>=%s AND date<=%s AND amount>0",query_params)
+ elif option == "quantity_plan":
+ self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line_plan \
+ WHERE account_id IN %s\
+ AND date>=%s AND date<=%s",query_params)
+
+ return self.cr.fetchone()[0] or 0.0
+
+ def _move_sum_commit(self, account_id, date1, date2, option):
+ if account_id not in self.acc_data_dict_commit:
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])])
+ self.acc_data_dict_commit[account_id] = ids
+ else:
+ ids = self.acc_data_dict_commit[account_id]
+
+ query_params = (tuple(ids), date1, date2)
+ if option == "credit_commit":
+ self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line_commit \
+ WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
+ elif option == "debit_commit":
+ self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line_commit \
+ WHERE account_id IN %s\
+ AND date>=%s AND date<=%s AND amount>0",query_params)
+ elif option == "quantity_commit":
+ self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line_commit \
+ WHERE account_id IN %s\
+ AND date>=%s AND date<=%s",query_params)
+
+ return self.cr.fetchone()[0] or 0.0
+
+
+ def _move_sum_budget(self, account_id, date1, date2, crossovered_budget_id, option):
+ if not crossovered_budget_id:
+ return 0.0
+ if account_id not in self.acc_data_dict_budget:
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])])
+ self.acc_data_dict_budget[account_id] = ids
+ else:
+ ids = self.acc_data_dict_budget[account_id]
+
+ query_params = (tuple(ids), date1, date2, crossovered_budget_id)
+ if option == "credit_budget":
+ self.cr.execute("SELECT COALESCE(-sum(planned_amount),0.0) \
+ FROM crossovered_budget_lines \
+ WHERE (analytic_account_id IN %s) \
+ AND (date_from<=%s) \
+ AND (date_to>=%s) \
+ AND (planned_amount<0) \
+ AND (crossovered_budget_id=%s)",query_params)
+ elif option == "debit_budget":
+ self.cr.execute("SELECT COALESCE(sum(planned_amount),0.0) \
+ FROM crossovered_budget_lines \
+ WHERE (analytic_account_id IN %s) \
+ AND (date_from<=%s) \
+ AND (date_to>=%s) \
+ AND (planned_amount>0) \
+ AND (crossovered_budget_id=%s)",query_params)
+
+ return self.cr.fetchone()[0] or 0.0
+
+ def _move_sum_balance(self, account_id, date1, date2):
+ debit = self._move_sum(account_id, date1, date2, 'debit')
+ credit = self._move_sum(account_id, date1, date2, 'credit')
+ return (debit-credit)
+
+ def _move_sum_balance_plan(self, account_id, date1, date2):
+ debit = self._move_sum_plan(account_id, date1, date2, 'debit_plan')
+ credit = self._move_sum_plan(account_id, date1, date2, 'credit_plan')
+ return (debit-credit)
+
+ def _move_sum_balance_commit(self, account_id, date1, date2):
+ debit = self._move_sum_commit(account_id, date1, date2, 'debit_commit')
+ credit = self._move_sum_commit(account_id, date1, date2, 'credit_commit')
+ return (debit-credit)
+
+
+ def _move_sum_balance_budget(self, account_id, date1, date2, crossovered_budget_id):
+ debit = self._move_sum_budget(account_id, date1, date2, crossovered_budget_id, 'debit_budget')
+ credit = self._move_sum_budget(account_id, date1, date2, crossovered_budget_id, 'credit_budget')
+ return (debit-credit)
+
+ def _sum_all_budget(self, accounts, date1, date2, crossovered_budget_id, option):
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ ids = map(lambda x: x['id'], accounts)
+ if not crossovered_budget_id:
+ return 0.0
+ if not ids:
+ return 0.0
+
+ if not self.acc_sum_list_budget:
+ ids2 = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', ids)])
+ self.acc_sum_list_budget = ids2
+ else:
+ ids2 = self.acc_sum_list_budget
+
+ query_params = (tuple(ids2), date1, date2, crossovered_budget_id)
+ if option == "credit_budget":
+ self.cr.execute("SELECT COALESCE(-sum(planned_amount),0.0) \
+ FROM crossovered_budget_lines \
+ WHERE (analytic_account_id IN %s) \
+ AND (date_from<=%s) \
+ AND (date_to>=%s) \
+ AND (planned_amount<0) \
+ AND (crossovered_budget_id=%s)",query_params)
+ elif option == "debit_budget":
+ self.cr.execute("SELECT COALESCE(sum(planned_amount),0.0) \
+ FROM crossovered_budget_lines \
+ WHERE (analytic_account_id IN %s) \
+ AND (date_from<=%s) \
+ AND (date_to>=%s) \
+ AND (planned_amount>0) \
+ AND (crossovered_budget_id=%s)",query_params)
+
+ return self.cr.fetchone()[0] or 0.0
+
+
+ def _sum_all(self, accounts, date1, date2, option):
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ ids = map(lambda x: x['id'], accounts)
+ if not ids:
+ return 0.0
+
+ if not self.acc_sum_list:
+ ids2 = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', ids)])
+ self.acc_sum_list = ids2
+ else:
+ ids2 = self.acc_sum_list
+
+ query_params = (tuple(ids2), date1, date2)
+ if option == "debit":
+ self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
+ WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0",query_params)
+ elif option == "credit":
+ self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
+ WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
+ elif option == "quantity":
+ self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
+ WHERE account_id IN %s AND date>=%s AND date<=%s",query_params)
+
+ return self.cr.fetchone()[0] or 0.0
+
+ def _sum_all_plan(self, accounts, date1, date2, option):
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ ids = map(lambda x: x['id'], accounts)
+ if not ids:
+ return 0.0
+
+ if not self.acc_sum_list_plan:
+ ids2 = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', ids)])
+ self.acc_sum_list_plan = ids2
+ else:
+ ids2 = self.acc_sum_list_plan
+
+ query_params = (tuple(ids2), date1, date2)
+ if option == "debit_plan":
+ self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line_plan \
+ WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0",query_params)
+ elif option == "credit_plan":
+ self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line_plan \
+ WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
+ elif option == "quantity_plan":
+ self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line_plan \
+ WHERE account_id IN %s AND date>=%s AND date<=%s",query_params)
+
+ return self.cr.fetchone()[0] or 0.0
+
+ def _sum_all_commit(self, accounts, date1, date2, option):
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ ids = map(lambda x: x['id'], accounts)
+ if not ids:
+ return 0.0
+
+ if not self.acc_sum_list_commit:
+ ids2 = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', ids)])
+ self.acc_sum_list_commit = ids2
+ else:
+ ids2 = self.acc_sum_list_commit
+
+ query_params = (tuple(ids2), date1, date2)
+ if option == "debit_commit":
+ self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line_commit \
+ WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0",query_params)
+ elif option == "credit_commit":
+ self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line_commit \
+ WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
+ elif option == "quantity_commit":
+ self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line_commit \
+ WHERE account_id IN %s AND date>=%s AND date<=%s",query_params)
+
+ return self.cr.fetchone()[0] or 0.0
+
+
+
+ def _sum_balance(self, accounts, date1, date2):
+ debit = self._sum_all(accounts, date1, date2, 'debit') or 0.0
+ credit = self._sum_all(accounts, date1, date2, 'credit') or 0.0
+ return (debit-credit)
+
+ def _sum_balance_plan(self, accounts, date1, date2):
+ debit = self._sum_all_plan(accounts, date1, date2, 'debit_plan') or 0.0
+ credit = self._sum_all_plan(accounts, date1, date2, 'credit_plan') or 0.0
+ return (debit-credit)
+
+ def _sum_balance_commit(self, accounts, date1, date2):
+ debit = self._sum_all_commit(accounts, date1, date2, 'debit_commit') or 0.0
+ credit = self._sum_all_commit(accounts, date1, date2, 'credit_commit') or 0.0
+ return (debit-credit)
+
+ def _sum_balance_budget(self, accounts, date1, date2, crossovered_budget_id):
+ debit = self._sum_all_budget(accounts, date1, date2, crossovered_budget_id, 'debit_budget') or 0.0
+ credit = self._sum_all_budget(accounts, date1, date2, crossovered_budget_id, 'credit_budget') or 0.0
+ return (debit-credit)
+
+
+report_sxw.report_sxw('report.account.analytic.account.balance.plan',
+ 'account.analytic.account', 'addons/project_cost_analysis/report/analytic_balance_plan.rml',
+ parser=account_analytic_balance_plan, header="internal")
=== added file 'project_cost_analysis/report/analytic_balance_plan.rml'
--- project_cost_analysis/report/analytic_balance_plan.rml 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/report/analytic_balance_plan.rml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,431 @@
+<?xml version="1.0"?>
+<document filename="test.pdf">
+ <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
+ <pageTemplate id="first">
+ <frame id="first" x1="31.0" y1="30.0" width="531" height="779"/>
+ </pageTemplate>
+ </template>
+ <stylesheet>
+ <blockTableStyle id="Standard_Outline">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table_Header_analytic">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table_Header_Tile">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table1">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table2">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table3">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <initialize>
+ <paraStyle name="all" alignment="justify"/>
+ </initialize>
+ <paraStyle name="P1" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="P3" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Standard" fontName="Helvetica"/>
+ <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="Index" fontName="Helvetica"/>
+ <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="Footer" fontName="Helvetica"/>
+ <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
+ <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_space" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="9.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Header" fontName="Helvetica"/>
+ <images/>
+ </stylesheet>
+ <story>
+ <blockTable colWidths="532.0" style="Table_Header_analytic">
+ <tr>
+ <td>
+ <para style="terp_header_Centre">Analytic Balance - [[ company.currency_id.name ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_space">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table_Header_Tile">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">Code</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Account Name</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">Debit</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">Credit</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">Balance</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">Quantity</para>
+ </td>
+ </tr>
+ </blockTable>
+ <blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table1">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">Total</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">
+ <font color="white"> </font>
+ </para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Plan</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all_plan(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit_plan')) ]]</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all_plan(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit_plan')) ]]</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_balance_plan(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all_plan(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'quantity_plan')) ]]</para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Budget</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all_budget(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],data['form']['crossovered_budget_id'],'debit_budget')) ]] </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all_budget(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],data['form']['crossovered_budget_id'],'credit_budget')) ]] </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_balance_budget(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],data['form']['crossovered_budget_id'])) ]] [[ company.currency_id.symbol]]</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">
+ <font color="white"> </font>
+ </para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Commited</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all_commit(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit_commit')) ]]</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all_commit(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit_commit')) ]] </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_balance_commit(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]
+</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all_commit(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'quantity_commit')) ]]</para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details">Actual</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]]</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]] </para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'quantity')) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <section>
+ <para style="P1">[[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]]</para>
+ <blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table2">
+ <tr>
+ <td>
+ <para style="terp_default_Bold_9">[[ o['complete_wbs_code'] ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Bold_9">[[ o['complete_wbs_name'] ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">
+ <font color="white"> </font>
+ </para>
+ </td>
+ </tr>
+ </blockTable>
+ <section>
+ <para style="terp_default_9">Start Date: [[ o['date_start'] ]];End Date: [[ o['date'] ]];Status: [[ o['state'] ]]</para>
+ <blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table3">
+ <tr>
+ <td>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_9">Plan</para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_plan(o['id'],data['form']['date1'],data['form']['date2'],'debit_plan')) ]] </para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_plan(o['id'],data['form']['date1'],data['form']['date2'],'credit_plan')) ]] </para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_balance_plan(o['id'],data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_plan(o['id'],data['form']['date1'],data['form']['date2'],'quantity_plan')) ]]</para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_9">Budget</para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_budget(o['id'],data['form']['date1'],data['form']['date2'],data['form']['crossovered_budget_id'],'debit_budget')) ]] </para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_budget(o['id'],data['form']['date1'],data['form']['date2'],data['form']['crossovered_budget_id'],'credit_budget')) ]]</para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_balance_budget(o['id'],data['form']['date1'],data['form']['date2'],data['form']['crossovered_budget_id'])) ]] [[ company.currency_id.symbol]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_9">Commited</para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_commit(o['id'],data['form']['date1'],data['form']['date2'],'debit_commit')) ]] </para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_commit(o['id'],data['form']['date1'],data['form']['date2'],'credit_commit')) ]]
+</para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_balance_commit(o['id'],data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_commit(o['id'],data['form']['date1'],data['form']['date2'],'quantity')) ]]</para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_9">Actual</para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'debit')) ]] </para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'credit')) ]] </para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
+ </td>
+ <td>
+ <para style="P2">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'quantity')) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ </section>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ <para style="Standard">
+ <font color="white"> </font>
+ </para>
+ </story>
+</document>
=== added file 'project_cost_analysis/report/analytic_balance_plan.sxw'
Binary files project_cost_analysis/report/analytic_balance_plan.sxw 1970-01-01 00:00:00 +0000 and project_cost_analysis/report/analytic_balance_plan.sxw 2013-01-22 10:02:35 +0000 differ
=== added directory 'project_cost_analysis/security'
=== added file 'project_cost_analysis/security/ir.model.access.csv'
--- project_cost_analysis/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/security/ir.model.access.csv 2013-01-22 10:02:35 +0000
@@ -0,0 +1,9 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_crossovered_budget_project_user","crossovered.budget project user","account_budget.model_crossovered_budget","project.group_project_user",1,0,0,0
+"access_crossovered_budget_project_manager","crossovered.budget project manager","account_budget.model_crossovered_budget","project.group_project_manager",1,0,0,0
+"access_crossovered_budget_lines_project_user","crossovered.budget.lines project user","account_budget.model_crossovered_budget_lines","project.group_project_user",1,0,0,0
+"access_crossovered_budget_lines_project_manager","crossovered.budget.lines project manager","account_budget.model_crossovered_budget_lines","project.group_project_manager",1,0,0,0
+"access_account_budget_post project user","account.bud_get.post project user","account_budget.model_account_budget_post","project.group_project_user",1,0,0,0
+"access_account_budget_post project manager","account.budget.post project manager","account_budget.model_account_budget_post","project.group_project_manager",1,0,0,0
+"access_report_account_analytic_resource_usage","report.account.analytic.resource.usage project manager","model_report_account_analytic_resource_usage","project.group_project_manager",1,1,1,1
+"access_report_account_analytic_resource_usage_product","report.account.analytic.resource.usage.product project manager","model_report_account_analytic_resource_usage_product","project.group_project_manager",1,1,1,1
\ No newline at end of file
=== added directory 'project_cost_analysis/wizard'
=== added file 'project_cost_analysis/wizard/__init__.py'
--- project_cost_analysis/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/wizard/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_analytic_balance_plan_report
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_analysis/wizard/account_analytic_balance_plan_report.py'
--- project_cost_analysis/wizard/account_analytic_balance_plan_report.py 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/wizard/account_analytic_balance_plan_report.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import time
+
+from osv import osv, fields
+
+class account_analytic_balance_plan(osv.osv_memory):
+ _name = 'account.analytic.balance.plan'
+ _description = 'Account Analytic Planning Balance'
+
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
+ 'empty_acc': fields.boolean('Empty Accounts ? ', help='Check if you want to display Accounts with 0 balance too.'),
+ 'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget', required=False),
+ }
+
+ _defaults = {
+ 'date1': lambda *a: time.strftime('%Y-01-01'),
+ 'date2': lambda *a: time.strftime('%Y-%m-%d')
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.account.balance.plan',
+ 'datas': datas,
+ }
+
+account_analytic_balance_plan()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'project_cost_analysis/wizard/account_analytic_balance_plan_report_view.xml'
--- project_cost_analysis/wizard/account_analytic_balance_plan_report_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost_analysis/wizard/account_analytic_balance_plan_report_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="account_analytic_balance_plan_view" model="ir.ui.view">
+ <field name="name">Account Analytic Planning Balance</field>
+ <field name="model">account.analytic.balance.plan</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Select Period">
+ <group colspan="4" col="6">
+ <field name="date1"/>
+ <field name="date2"/>
+ <field name="crossovered_budget_id"/>
+ <newline/>
+ <field name="empty_acc"/>
+ </group>
+ <separator colspan="4"/>
+ <group colspan="4" col="6">
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="check_report" string="Print" type="object" icon="gtk-print"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_account_analytic_balance_plan" model="ir.actions.act_window">
+ <field name="name">Analytic Planning Balance</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">account.analytic.balance.plan</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="account_analytic_balance_plan_view"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="account_analytic_balance_plan_values">
+ <field name="model_id" ref="analytic.model_account_analytic_account" />
+ <field name="object" eval="1" />
+ <field name="name">Analytic Planning Balance</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_balance_plan'))" />
+ <field name="key">action</field>
+ <field name="model">account.analytic.account</field>
+ </record>
+
+ </data>
+</openerp>
+
=== added directory 'project_cost_commit_hr_timesheet'
=== renamed directory 'project_cost_commit_hr_timesheet' => 'project_cost_commit_hr_timesheet.moved'
=== added file 'project_cost_commit_hr_timesheet/__init__.py'
--- project_cost_commit_hr_timesheet/__init__.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import account_analytic_line_commit
+import hr_timesheet
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_commit_hr_timesheet/__openerp__.py'
--- project_cost_commit_hr_timesheet/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ "name": "Project Management",
+ "version": "1.0",
+ "author": "Eficent, Nervia Consultores",
+ "website": "",
+ "category": "Generic Modules/Projects & Services",
+ "depends": ["project_cost","hr_timesheet"],
+ "description": """Eficent Project Management. Project Cost Planning Integration with HR Timesheets
+ - When timesheets are recorded, the corresponding cost is registered as a commitment cost
+ """,
+ "init_xml": [],
+ "update_xml": [
+ "hr_timesheet_view.xml",
+ "hr_timesheet_data.xml",
+ "hr_timesheet_workflow.xml",
+ "account_analytic_line_commit_view.xml",
+ ],
+ 'demo_xml': [
+
+ ],
+ 'test':[
+ ],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_commit_hr_timesheet/account_analytic_line_commit.py'
--- project_cost_commit_hr_timesheet/account_analytic_line_commit.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/account_analytic_line_commit.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from lxml import etree
+import time
+from datetime import datetime, date, timedelta
+import decimal_precision as dp
+from tools.translate import _
+from osv import fields, osv
+import netsvc
+import tools
+
+class account_analytic_line_commit(osv.osv):
+ _inherit = 'account.analytic.line.commit'
+
+ _columns = {
+ 'hr_timesheet_id': fields.many2one('hr.analytic.timesheet', 'Timesheet', ondelete='cascade', select=True),
+ }
+
+account_analytic_line_commit()
\ No newline at end of file
=== added file 'project_cost_commit_hr_timesheet/account_analytic_line_commit_view.xml'
--- project_cost_commit_hr_timesheet/account_analytic_line_commit_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/account_analytic_line_commit_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+#---------------------------------------------------------------------------------------------------------
+# Add Commitment analytic account lines
+#---------------------------------------------------------------------------------------------------------
+ <record id="view_account_analytic_line_commit_form" model="ir.ui.view">
+ <field name="name">account.analytic.line.commit.form</field>
+ <field name="model">account.analytic.line.commit</field>
+ <field name="inherit_id" ref="project_cost.view_account_analytic_line_commit_form"/>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <field name="user_id" position="after">
+ <field name="hr_timesheet_id" readonly="1"/>
+ </field>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added file 'project_cost_commit_hr_timesheet/hr_timesheet.py'
--- project_cost_commit_hr_timesheet/hr_timesheet.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/hr_timesheet.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,120 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+
+from osv import fields
+from osv import osv
+from tools.translate import _
+
+
+class hr_employee(osv.osv):
+ _name = "hr.employee"
+ _inherit = "hr.employee"
+ _columns = {
+ 'commitment_journal_id': fields.many2one('account.analytic.journal.commit', 'Analytic Commitment Journal'),
+ }
+
+ def _getAnalyticCommitmentJournal(self, cr, uid, context=None):
+ md = self.pool.get('ir.model.data')
+ try:
+ result = md.get_object_reference(cr, uid, 'hr_timesheet', 'analytic_commitment_journal')
+ return result[1]
+ except ValueError:
+ pass
+ return False
+
+ _defaults = {
+ 'commitment_journal_id': _getAnalyticCommitmentJournal,
+
+ }
+
+hr_employee()
+
+class hr_analytic_timesheet(osv.osv):
+
+ _inherit = "hr.analytic.timesheet"
+
+ _columns = {
+ 'line_commit_id': fields.one2many('account.analytic.line.commit', 'hr_timesheet_id', 'Commitment Analytic line'),
+ }
+
+
+ def _getAnalyticCommitmentJournal(self, cr, uid, context=None):
+ emp_obj = self.pool.get('hr.employee')
+ if context is None:
+ context = {}
+ emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context)
+ if emp_id:
+ emp = emp_obj.browse(cr, uid, emp_id[0], context=context)
+ if emp.commitment_journal_id:
+ return emp.commitment_journal_id.id
+ return False
+
+ def wkf_analytic_line_commit(self, cr, uid, ids, context=None):
+ acc_ana_line_obj = self.pool.get('account.analytic.line.commit')
+ for obj in self.browse(cr, uid, ids, context=context):
+ vals_lines = {
+ 'name': obj.name,
+ 'date': obj.date,
+ 'account_id': obj.account_id and obj.account_id.id or False,
+ 'unit_amount': obj.unit_amount,
+ 'product_id': obj.product_id and obj.product_id.id or False,
+ 'product_uom_id': obj.product_uom_id and obj.product_uom_id.id or False,
+ 'amount': obj.amount,
+ 'general_account_id': obj.general_account_id and obj.general_account_id.id or False,
+ 'journal_id': self._getAnalyticCommitmentJournal(cr,uid,context=context),
+ 'ref': obj.ref,
+ 'user_id': obj.user_id and obj.user_id.id or False,
+ 'currency_id': obj.currency_id and obj.currency_id.id or False,
+ 'amount_currency': obj.amount_currency,
+ 'hr_timesheet_id': obj.id,
+ }
+
+ if obj.line_commit_id:
+ for commit_line_id in obj.line_commit_id:
+ acc_ana_line_obj.write(cr, uid, [commit_line_id.id], vals_lines, context=context)
+ else:
+ acc_ana_line_obj.create(cr, uid, vals_lines, context=context)
+
+
+
+ def write(self, cr, uid, ids, vals, context=None):
+ res = super(hr_analytic_timesheet, self).write(cr, uid, ids, vals, context=context)
+
+ self.wkf_analytic_line_commit(cr, uid, ids, context=context)
+
+ return res
+
+
+ def unlink(self, cr, uid, ids, context=None):
+ toremove = {}
+ for obj in self.browse(cr, uid, ids, context=context):
+ if obj.line_commit_id:
+ toremove[obj.line_commit_id.id] = True
+ if toremove:
+ self.pool.get('account.analytic.line.commit').unlink(cr, uid, toremove.keys(), context=context)
+ return super(hr_analytic_timesheet, self).unlink(cr, uid, ids, context=context)
+
+
+hr_analytic_timesheet()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_commit_hr_timesheet/hr_timesheet_data.xml'
--- project_cost_commit_hr_timesheet/hr_timesheet_data.xml 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/hr_timesheet_data.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="analytic_commitment_journal" model="account.analytic.journal.commit">
+ <field name="code">Tiempos</field>
+ <field name="name">Timesheet</field>
+ <field name="type">general</field>
+ <field name="analytic_journal" ref="hr_timesheet.analytic_journal"/>
+ </record>
+ </data>
+</openerp>
=== added file 'project_cost_commit_hr_timesheet/hr_timesheet_view.xml'
--- project_cost_commit_hr_timesheet/hr_timesheet_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/hr_timesheet_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="hr_timesheet_employee_extd_form" model="ir.ui.view">
+ <field name="name">hr.timesheet.employee.extd_form</field>
+ <field name="model">hr.employee</field>
+ <field name="inherit_id" ref="hr_timesheet.hr_timesheet_employee_extd_form"/>
+ <field name="arch" type="xml">
+ <field name="journal_id" position="after">
+ <field name="commitment_journal_id" widget="selection"/>
+ </field>
+ </field>
+ </record>
+
+
+ </data>
+</openerp>
=== added file 'project_cost_commit_hr_timesheet/hr_timesheet_workflow.xml'
--- project_cost_commit_hr_timesheet/hr_timesheet_workflow.xml 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/hr_timesheet_workflow.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Workflow definition -->
+
+ <record id="wkf_timesheet" model="workflow">
+ <field name="name">hr_timesheet_analytic_commit</field>
+ <field name="osv">hr.analytic.timesheet</field>
+ <field name="on_create">True</field>
+ </record>
+
+ <record id="act_new" model="workflow.activity">
+ <field name="wkf_id" ref="wkf_timesheet"/>
+ <field name="name">new</field>
+ <field name="kind">function</field>
+ <field name="action">wkf_analytic_line_commit()</field>
+ <field name="flow_start">True</field>
+ <field name="flow_stop">True</field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'project_cost_commit_hr_timesheet/i18n'
=== added file 'project_cost_commit_hr_timesheet/i18n/es.po'
--- project_cost_commit_hr_timesheet/i18n/es.po 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/i18n/es.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,57 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_cost_commit_hr_timesheet
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-06-25 12:07+0000\n"
+"PO-Revision-Date: 2012-06-25 12:07+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: project_cost_commit_hr_timesheet
+#: model:ir.model,name:project_cost_commit_hr_timesheet.model_account_analytic_line_commit
+msgid "Analytic Line Commitment"
+msgstr "Línea Analítica Comprometido"
+
+#. module: project_cost_commit_hr_timesheet
+#: field:hr.analytic.timesheet,line_commit_id:0
+msgid "Commitment Analytic line"
+msgstr "Commitment Analytic line"
+
+#. module: project_cost_commit_hr_timesheet
+#: constraint:hr.employee:0
+msgid "Error ! You cannot select a department for which the employee is the manager."
+msgstr "¡Error! No puede seleccionar un departamento que tenga el empleado como responsable."
+
+#. module: project_cost_commit_hr_timesheet
+#: field:account.analytic.line.commit,hr_timesheet_id:0
+msgid "Timesheet"
+msgstr "Timesheet"
+
+#. module: project_cost_commit_hr_timesheet
+#: model:ir.model,name:project_cost_commit_hr_timesheet.model_hr_employee
+msgid "Employee"
+msgstr "Empleado"
+
+#. module: project_cost_commit_hr_timesheet
+#: field:hr.employee,commitment_journal_id:0
+msgid "Analytic Commitment Journal"
+msgstr "Analytic Commitment Journal"
+
+#. module: project_cost_commit_hr_timesheet
+#: model:ir.model,name:project_cost_commit_hr_timesheet.model_hr_analytic_timesheet
+msgid "Timesheet Line"
+msgstr "Línea hoja de asistencia"
+
+#. module: project_cost_commit_hr_timesheet
+#: constraint:hr.employee:0
+msgid "Error ! You cannot create recursive Hierarchy of Employees."
+msgstr "¡Error! No se puede crear una jerarquía recursiva de empleados."
+
=== added file 'project_cost_commit_hr_timesheet/i18n/project_cost_commit_hr_timesheet.pot'
--- project_cost_commit_hr_timesheet/i18n/project_cost_commit_hr_timesheet.pot 1970-01-01 00:00:00 +0000
+++ project_cost_commit_hr_timesheet/i18n/project_cost_commit_hr_timesheet.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,57 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_cost_commit_hr_timesheet
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-06-25 12:10+0000\n"
+"PO-Revision-Date: 2012-06-25 14:16+0100\n"
+"Last-Translator: Jordi Ballester <jordi.ballester@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: project_cost_commit_hr_timesheet
+#: model:ir.model,name:project_cost_commit_hr_timesheet.model_account_analytic_line_commit
+msgid "Analytic Line Commitment"
+msgstr "Línea Analítica de Comprometido"
+
+#. module: project_cost_commit_hr_timesheet
+#: field:hr.analytic.timesheet,line_commit_id:0
+msgid "Commitment Analytic line"
+msgstr "Línea Analítica de Comprometido"
+
+#. module: project_cost_commit_hr_timesheet
+#: constraint:hr.employee:0
+msgid "Error ! You cannot select a department for which the employee is the manager."
+msgstr "Error! No puedes seleccionar un departamento para el que el empleado es el director"
+
+#. module: project_cost_commit_hr_timesheet
+#: field:account.analytic.line.commit,hr_timesheet_id:0
+msgid "Timesheet"
+msgstr "Hoja de Tiempos"
+
+#. module: project_cost_commit_hr_timesheet
+#: model:ir.model,name:project_cost_commit_hr_timesheet.model_hr_employee
+msgid "Employee"
+msgstr "Empleado"
+
+#. module: project_cost_commit_hr_timesheet
+#: field:hr.employee,commitment_journal_id:0
+msgid "Analytic Commitment Journal"
+msgstr "Diario Analítico para Comprometidos"
+
+#. module: project_cost_commit_hr_timesheet
+#: model:ir.model,name:project_cost_commit_hr_timesheet.model_hr_analytic_timesheet
+msgid "Timesheet Line"
+msgstr "Línea de Hoja de Trabajo"
+
+#. module: project_cost_commit_hr_timesheet
+#: constraint:hr.employee:0
+msgid "Error ! You cannot create recursive Hierarchy of Employees."
+msgstr "Error! No puedes crear una jerarquía de empleados recursiva."
+
=== added directory 'project_cost_commit_hr_timesheet/report'
=== added directory 'project_cost_commit_hr_timesheet/security'
=== added directory 'project_cost_commit_hr_timesheet/wizard'
=== added directory 'project_cost_commit_purchase'
=== renamed directory 'project_cost_commit_purchase' => 'project_cost_commit_purchase.moved'
=== added file 'project_cost_commit_purchase/__init__.py'
--- project_cost_commit_purchase/__init__.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_purchase/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import account_analytic_line_commit
+import purchase
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_commit_purchase/__openerp__.py'
--- project_cost_commit_purchase/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_purchase/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ "name": "Project Management",
+ "version": "1.0",
+ "author": "Eficent, Nervia Consultores",
+ "website": "",
+ "category": "Generic Modules/Projects & Services",
+ "depends": ["project_cost", "purchase"],
+ "description": """Eficent Project Management. Maintain analytic commitments associated to purchase orders
+ """,
+ "init_xml": [],
+ "update_xml": [
+ "account_analytic_line_commit_view.xml",
+ "purchase_workflow.xml",
+ ],
+ 'demo_xml': [
+
+ ],
+ 'test':[
+ ],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_commit_purchase/account_analytic_line_commit.py'
--- project_cost_commit_purchase/account_analytic_line_commit.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_purchase/account_analytic_line_commit.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from lxml import etree
+import time
+from datetime import datetime, date, timedelta
+import decimal_precision as dp
+from tools.translate import _
+from osv import fields, osv
+import netsvc
+import tools
+
+class account_analytic_line_commit(osv.osv):
+ _inherit = 'account.analytic.line.commit'
+
+ _columns = {
+ 'purchase_line_id': fields.many2one('purchase.order.line', 'Purchase Order Line', ondelete='cascade', select=True),
+ }
+account_analytic_line_commit()
\ No newline at end of file
=== added file 'project_cost_commit_purchase/account_analytic_line_commit_view.xml'
--- project_cost_commit_purchase/account_analytic_line_commit_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost_commit_purchase/account_analytic_line_commit_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+#---------------------------------------------------------------------------------------------------------
+# Add Commitment analytic account lines
+#---------------------------------------------------------------------------------------------------------
+ <record id="view_account_analytic_line_commit_form" model="ir.ui.view">
+ <field name="name">account.analytic.line.commit.form</field>
+ <field name="model">account.analytic.line.commit</field>
+ <field name="inherit_id" ref="project_cost.view_account_analytic_line_commit_form"/>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <field name="user_id" position="after">
+ <field name="purchase_line_id" readonly="1"/>
+ </field>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'project_cost_commit_purchase/i18n'
=== added file 'project_cost_commit_purchase/i18n/es.po'
--- project_cost_commit_purchase/i18n/es.po 1970-01-01 00:00:00 +0000
+++ project_cost_commit_purchase/i18n/es.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,43 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_cost_commit_purchase
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-06-25 12:17+0000\n"
+"PO-Revision-Date: 2012-06-25 12:17+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: project_cost_commit_purchase
+#: field:purchase.order.line,analytic_lines_commit:0
+msgid "Commitment Analytic lines"
+msgstr "Posiciones Analíticas para Comprometidos"
+
+#. module: project_cost_commit_purchase
+#: field:account.analytic.line.commit,purchase_line_id:0
+#: model:ir.model,name:project_cost_commit_purchase.model_purchase_order_line
+msgid "Purchase Order Line"
+msgstr "Línea de Pedido de Compra"
+
+#. module: project_cost_commit_purchase
+#: sql_constraint:purchase.order:0
+msgid "Order Reference must be unique !"
+msgstr "¡La referencia del pedido debe ser única!"
+
+#. module: project_cost_commit_purchase
+#: model:ir.model,name:project_cost_commit_purchase.model_account_analytic_line_commit
+msgid "Analytic Line Commitment"
+msgstr "Línea Analítica Comprometido"
+
+#. module: project_cost_commit_purchase
+#: model:ir.model,name:project_cost_commit_purchase.model_purchase_order
+msgid "Purchase Order"
+msgstr "Pedido de compra"
+
=== added file 'project_cost_commit_purchase/i18n/project_cost_commit_purchase.pot'
--- project_cost_commit_purchase/i18n/project_cost_commit_purchase.pot 1970-01-01 00:00:00 +0000
+++ project_cost_commit_purchase/i18n/project_cost_commit_purchase.pot 2013-01-22 10:02:35 +0000
@@ -0,0 +1,43 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_cost_commit_purchase
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-06-25 12:17+0000\n"
+"PO-Revision-Date: 2012-06-25 12:17+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: project_cost_commit_purchase
+#: field:purchase.order.line,analytic_lines_commit:0
+msgid "Commitment Analytic lines"
+msgstr ""
+
+#. module: project_cost_commit_purchase
+#: field:account.analytic.line.commit,purchase_line_id:0
+#: model:ir.model,name:project_cost_commit_purchase.model_purchase_order_line
+msgid "Purchase Order Line"
+msgstr ""
+
+#. module: project_cost_commit_purchase
+#: sql_constraint:purchase.order:0
+msgid "Order Reference must be unique !"
+msgstr ""
+
+#. module: project_cost_commit_purchase
+#: model:ir.model,name:project_cost_commit_purchase.model_account_analytic_line_commit
+msgid "Analytic Line Commitment"
+msgstr ""
+
+#. module: project_cost_commit_purchase
+#: model:ir.model,name:project_cost_commit_purchase.model_purchase_order
+msgid "Purchase Order"
+msgstr ""
+
=== added file 'project_cost_commit_purchase/purchase.py'
--- project_cost_commit_purchase/purchase.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_purchase/purchase.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,126 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+import time
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
+
+from osv import osv, fields
+import netsvc
+import pooler
+from tools.translate import _
+import decimal_precision as dp
+from osv.orm import browse_record, browse_null
+
+#
+# Model definition
+#
+class purchase_order(osv.osv):
+
+ _inherit = 'purchase.order'
+ #TODO: implement messages system
+ _columns = {
+ 'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'confirmed':[('readonly',True)],'approved':[('readonly',True)],'done':[('readonly',True)]}),
+ }
+ def wkf_confirm_order(self, cr, uid, ids, context=None):
+ purch_order_line = self.pool.get('purchase.order.line')
+
+ res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context)
+
+ for po in self.browse(cr, uid, ids, context=context):
+ purch_order_line.create_analytic_lines_commit(cr, uid, [line.id for line in po.order_line], context)
+
+ return res
+
+ def wkf_purchase_cancel(self, cr, uid, ids, context=None):
+
+ self.write(cr,uid,ids,{'state':'cancel'})
+
+ obj_commitment_analytic_line = self.pool.get('account.analytic.line.commit')
+
+ for purchase in self.browse(cr, uid, ids, context=context):
+ for po_lines in purchase.order_line:
+ for ana_lines in po_lines.analytic_lines_commit:
+ obj_commitment_analytic_line.unlink(cr,uid,ana_lines.id)
+
+ return True
+
+
+ def action_cancel(self, cr, uid, ids, context=None):
+
+ super(purchase_order, self).action_cancel(cr, uid, ids, context)
+
+ obj_commitment_analytic_line = self.pool.get('account.analytic.line.commit')
+
+ for purchase in self.browse(cr, uid, ids, context=context):
+ for po_lines in purchase.order_line:
+ for ana_lines in po_lines.analytic_lines_commit:
+ obj_commitment_analytic_line.unlink(cr,uid,ana_lines.id)
+
+ return True
+
+
+purchase_order()
+
+class purchase_order_line(osv.osv):
+
+ _inherit = 'purchase.order.line'
+
+ _columns = {
+ 'analytic_lines_commit': fields.one2many('account.analytic.line.commit', 'purchase_line_id', 'Commitment Analytic lines'),
+ }
+
+ def create_analytic_lines_commit(self, cr, uid, ids, context=None):
+ acc_ana_line_obj = self.pool.get('account.analytic.line.commit')
+ journal_obj = self.pool.get('account.analytic.journal.commit')
+ journal_id = journal_obj.search(cr, uid, [('type', '=', 'purchase')], context=None)
+ journal_id = journal_id and journal_id[0] or False
+ cur_obj=self.pool.get('res.currency')
+
+ for obj_line in self.browse(cr, uid, ids, context=context):
+ cur = obj_line.order_id and obj_line.order_id.pricelist_id and obj_line.order_id.pricelist_id.currency_id
+
+ if obj_line.account_analytic_id:
+ vals_lines = {
+ 'name': obj_line.name,
+ 'date': obj_line.order_id and obj_line.order_id.date_order or False,
+ 'account_id': obj_line.account_analytic_id and obj_line.account_analytic_id.id or False,
+ 'unit_amount': obj_line.product_qty,
+ 'product_id': obj_line.product_id and obj_line.product_id.id or False,
+ 'product_uom_id': obj_line.product_uom and obj_line.product_uom.id or False,
+ 'amount': -1 * obj_line.price_subtotal,
+ 'general_account_id': False,
+ 'journal_id': journal_id or False,
+ 'ref': obj_line.name,
+ 'user_id': uid,
+ 'purchase_line_id': obj_line.id,
+ 'currency_id': cur.id,
+ 'amount_currency': -1 * cur_obj.round(cr, uid, cur, obj_line.price_subtotal),
+ }
+ acc_ana_line_obj.create(cr, uid, vals_lines)
+ return True
+
+
+
+purchase_order_line()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_commit_purchase/purchase_workflow.xml'
--- project_cost_commit_purchase/purchase_workflow.xml 1970-01-01 00:00:00 +0000
+++ project_cost_commit_purchase/purchase_workflow.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="purchase.act_cancel" model="workflow.activity">
+ <field name="wkf_id" ref="purchase.purchase_order"/>
+ <field name="name">cancel</field>
+ <field name="kind">function</field>
+ <field name="flow_stop">True</field>
+ <field name="action">wkf_purchase_cancel()</field>
+ </record>
+ </data>
+</openerp>
=== added directory 'project_cost_commit_purchase/report'
=== added directory 'project_cost_commit_purchase/security'
=== added directory 'project_cost_commit_purchase/wizard'
=== added directory 'project_cost_commit_sale'
=== renamed directory 'project_cost_commit_sale' => 'project_cost_commit_sale.moved'
=== added file 'project_cost_commit_sale/__init__.py'
--- project_cost_commit_sale/__init__.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_sale/__init__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import account_analytic_line_commit
+import sale
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_commit_sale/__openerp__.py'
--- project_cost_commit_sale/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_sale/__openerp__.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ "name": "Project Management",
+ "version": "1.0",
+ "author": "Eficent, Nervia Consultores",
+ "website": "",
+ "category": "Generic Modules/Projects & Services",
+ "depends": ["project_cost", "purchase"],
+ "description": """Eficent Project Management. Maintain analytic commitments associated to purchase orders
+ """,
+ "init_xml": [],
+ "update_xml": [
+ "account_analytic_line_commit_view.xml",
+ ],
+ 'demo_xml': [
+
+ ],
+ 'test':[
+ ],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'project_cost_commit_sale/account_analytic_line_commit.py'
--- project_cost_commit_sale/account_analytic_line_commit.py 1970-01-01 00:00:00 +0000
+++ project_cost_commit_sale/account_analytic_line_commit.py 2013-01-22 10:02:35 +0000
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
+# Jordi Ballester Alomar <jordi.ballester@xxxxxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from lxml import etree
+import time
+from datetime import datetime, date, timedelta
+import decimal_precision as dp
+from tools.translate import _
+from osv import fields, osv
+import netsvc
+import tools
+
+class account_analytic_line_commit(osv.osv):
+ _inherit = 'account.analytic.line.commit'
+
+ _columns = {
+ 'sale_line_id': fields.many2one('sale.order.line', 'Sale Order Line', ondelete='cascade', select=True),
+ }
+account_analytic_line_commit()
\ No newline at end of file
=== added file 'project_cost_commit_sale/account_analytic_line_commit_view.xml'
--- project_cost_commit_sale/account_analytic_line_commit_view.xml 1970-01-01 00:00:00 +0000
+++ project_cost_commit_sale/account_analytic_line_commit_view.xml 2013-01-22 10:02:35 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+#---------------------------------------------------------------------------------------------------------
+# Add Commitment analytic account lines
+#---------------------------------------------------------------------------------------------------------
+ <record id="view_account_analytic_line_commit_form" model="ir.ui.view">
+ <field name="name">account.analytic.line.commit.form</field>
+ <field name="model">account.analytic.line.commit</field>
+ <field name="inherit_id" ref="project_cost.view_account_analytic_line_commit_form"/>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <field name="user_id" position="after">
+ <field name="sale_line_id" readonly="1"/>
+ </field>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'project_cost_commit_sale/i18n'
=== added file 'project_cost_commit_sale/i18n/es.po'
--- project_cost_commit_sale/i18n/es.po 1970-01-01 00:00:00 +0000
+++ project_cost_commit_sale/i18n/es.po 2013-01-22 10:02:35 +0000
@@ -0,0 +1,47 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * project_cost_commit_sale
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-06-25 12:19+0000\n"
+"PO-Revision-Date: 2012-06-25 14:19+0100\n"
+"Last-Translator: Jordi Ballester <jordi.ballester@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: project_cost_commit_sale
+#: sql_constraint:sale.order:0
+msgid "Order Reference must be unique !"
+msgstr "¡La referencia del pedido debe ser única!"
+
+#. module: project_cost_commit_sale
+#: model:ir.model,name:project_cost_commit_sale.model_account_analytic_line_commit
+msgid "Analytic Line Commitment"
+msgstr "Línea Analítica Comprometi
Follow ups