Merge lp:~cpueyo/eficent-openerp-project-management/nerviaconsultores-openerp-7.0 into lp:eficent-openerp-project-management

Proposed by Carlos Pueyo
Status: Needs review
Proposed branch: lp:~cpueyo/eficent-openerp-project-management/nerviaconsultores-openerp-7.0
Merge into: lp:eficent-openerp-project-management
Diff against target: 28017 lines (+26477/-0) (has conflicts)
266 files modified
account_analytic_lob/__init__.py (+27/-0)
account_analytic_lob/__openerp__.py (+48/-0)
account_analytic_lob/account_analytic_lob.py (+39/-0)
account_analytic_lob/account_analytic_lob_view.xml (+66/-0)
account_analytic_lob/i18n/account_analytic_lob.pot (+57/-0)
account_analytic_lob/i18n/es.po (+57/-0)
account_analytic_lob/project.py (+34/-0)
account_analytic_lob/project_view.xml (+42/-0)
account_analytic_lob/security/ir.model.access.csv (+5/-0)
project_category/__init__.py (+24/-0)
project_category/__openerp__.py (+56/-0)
project_category/account_analytic_account.py (+67/-0)
project_category/analytic_account_category.py (+80/-0)
project_category/analytic_account_category.xml (+80/-0)
project_category/analytic_account_view.xml (+68/-0)
project_category/i18n/es.po (+134/-0)
project_category/i18n/project_category.pot (+134/-0)
project_category/project_view.xml (+53/-0)
project_category/security/ir.model.access.csv (+5/-0)
project_communications_mailgate/__init__.py (+25/-0)
project_communications_mailgate/__openerp__.py (+46/-0)
project_communications_mailgate/i18n/es.po (+102/-0)
project_communications_mailgate/i18n/project_communications_mailgate.pot (+101/-0)
project_communications_mailgate/project.py (+223/-0)
project_communications_mailgate/project_communications_mailgate.py (+52/-0)
project_communications_mailgate/project_communications_mailgate_view.xml (+31/-0)
project_communications_mailgate_note/__init__.py (+28/-0)
project_communications_mailgate_note/__openerp__.py (+57/-0)
project_communications_mailgate_note/i18n/es.po (+286/-0)
project_communications_mailgate_note/i18n/project_communications_mailgate_note.pot (+286/-0)
project_communications_mailgate_note/project_communications_mailgate_note_view.xml (+37/-0)
project_communications_mailgate_note/security/ir.model.access.csv (+1/-0)
project_communications_mailgate_note/wizard/__init__.py (+29/-0)
project_communications_mailgate_note/wizard/project_communications_add_note.py (+59/-0)
project_communications_mailgate_note/wizard/project_communications_add_note_view.xml (+54/-0)
project_communications_mailgate_note/wizard/project_communications_send_email.py (+292/-0)
project_communications_mailgate_note/wizard/project_communications_send_email_view.xml (+105/-0)
project_communications_mailgate_note/wizard/wizard.xml (+29/-0)
project_communications_meetings/__init__.py (+24/-0)
project_communications_meetings/__openerp__.py (+55/-0)
project_communications_meetings/i18n/es.po (+74/-0)
project_communications_meetings/i18n/project_communications_meetings.pot (+73/-0)
project_communications_meetings/project_communications_meetings.py (+46/-0)
project_communications_meetings/project_communications_meetings_view.xml (+47/-0)
project_communications_meetings/project_view.xml (+65/-0)
project_communications_meetings/security/ir.model.access.csv (+9/-0)
project_communications_meetings/security/project_communications_meetings_security.xml (+16/-0)
project_cost/__init__.py (+31/-0)
project_cost/__openerp__.py (+70/-0)
project_cost/account_analytic_account.py (+220/-0)
project_cost/account_analytic_account_view.xml (+153/-0)
project_cost/account_analytic_journal_commit.py (+53/-0)
project_cost/account_analytic_journal_commit_data.xml (+21/-0)
project_cost/account_analytic_journal_commit_report.xml (+8/-0)
project_cost/account_analytic_journal_commit_view.xml (+86/-0)
project_cost/account_analytic_journal_plan.py (+55/-0)
project_cost/account_analytic_journal_plan_data.xml (+21/-0)
project_cost/account_analytic_journal_plan_report.xml (+8/-0)
project_cost/account_analytic_journal_plan_view.xml (+86/-0)
project_cost/account_analytic_line.py (+50/-0)
project_cost/account_analytic_line_commit.py (+184/-0)
project_cost/account_analytic_line_commit_view.xml (+110/-0)
project_cost/account_analytic_line_plan.py (+191/-0)
project_cost/account_analytic_line_plan_view.xml (+120/-0)
project_cost/account_analytic_line_view.xml (+29/-0)
project_cost/i18n/es.po (+613/-0)
project_cost/i18n/project_cost.pot (+598/-0)
project_cost/project_view.xml (+119/-0)
project_cost/report/__init__.py (+27/-0)
project_cost/report/account_analytic_journal_commit.py (+64/-0)
project_cost/report/account_analytic_journal_commit.rml (+331/-0)
project_cost/report/account_analytic_journal_plan.py (+64/-0)
project_cost/report/account_analytic_journal_plan.rml (+340/-0)
project_cost/security/avg_project_security.xml (+21/-0)
project_cost/security/ir.model.access.csv (+24/-0)
project_cost/security/project_cost_security.xml (+6/-0)
project_cost/wizard/__init__.py (+27/-0)
project_cost/wizard/account_analytic_journal_commit_report.py (+56/-0)
project_cost/wizard/account_analytic_journal_commit_report_view.xml (+45/-0)
project_cost/wizard/account_analytic_journal_plan_report.py (+56/-0)
project_cost/wizard/account_analytic_journal_plan_report_view.xml (+45/-0)
project_cost_analysis/__init__.py (+24/-0)
project_cost_analysis/__openerp__.py (+61/-0)
project_cost_analysis/account_analytic_balance_plan_report.xml (+9/-0)
project_cost_analysis/i18n/es.po (+558/-0)
project_cost_analysis/i18n/project_cost_analysis.pot (+558/-0)
project_cost_analysis/report/__init__.py (+27/-0)
project_cost_analysis/report/account_analytic_resource_usage.py (+137/-0)
project_cost_analysis/report/account_analytic_resource_usage_product.py (+207/-0)
project_cost_analysis/report/account_analytic_resource_usage_product_view.xml (+162/-0)
project_cost_analysis/report/account_analytic_resource_usage_view.xml (+169/-0)
project_cost_analysis/report/analytic_balance_plan.py (+352/-0)
project_cost_analysis/report/analytic_balance_plan.rml (+431/-0)
project_cost_analysis/security/ir.model.access.csv (+9/-0)
project_cost_analysis/wizard/__init__.py (+25/-0)
project_cost_analysis/wizard/account_analytic_balance_plan_report.py (+60/-0)
project_cost_analysis/wizard/account_analytic_balance_plan_report_view.xml (+49/-0)
project_cost_commit_hr_timesheet/__init__.py (+25/-0)
project_cost_commit_hr_timesheet/__openerp__.py (+48/-0)
project_cost_commit_hr_timesheet/account_analytic_line_commit.py (+38/-0)
project_cost_commit_hr_timesheet/account_analytic_line_commit_view.xml (+21/-0)
project_cost_commit_hr_timesheet/hr_timesheet.py (+133/-0)
project_cost_commit_hr_timesheet/hr_timesheet_data.xml (+11/-0)
project_cost_commit_hr_timesheet/hr_timesheet_view.xml (+18/-0)
project_cost_commit_hr_timesheet/hr_timesheet_workflow.xml (+23/-0)
project_cost_commit_hr_timesheet/i18n/es.po (+57/-0)
project_cost_commit_hr_timesheet/i18n/project_cost_commit_hr_timesheet.pot (+57/-0)
project_cost_commit_purchase/__init__.py (+25/-0)
project_cost_commit_purchase/__openerp__.py (+45/-0)
project_cost_commit_purchase/account_analytic_line_commit.py (+37/-0)
project_cost_commit_purchase/account_analytic_line_commit_view.xml (+21/-0)
project_cost_commit_purchase/i18n/es.po (+43/-0)
project_cost_commit_purchase/i18n/project_cost_commit_purchase.pot (+43/-0)
project_cost_commit_purchase/purchase.py (+126/-0)
project_cost_commit_purchase/purchase_workflow.xml (+13/-0)
project_cost_commit_sale/__init__.py (+25/-0)
project_cost_commit_sale/__openerp__.py (+44/-0)
project_cost_commit_sale/account_analytic_line_commit.py (+37/-0)
project_cost_commit_sale/account_analytic_line_commit_view.xml (+21/-0)
project_cost_commit_sale/i18n/es.po (+47/-0)
project_cost_commit_sale/i18n/project_cost_commit_sale.pot (+47/-0)
project_cost_commit_sale/sale.py (+109/-0)
project_cost_plan_purchase/__init__.py (+26/-0)
project_cost_plan_purchase/__openerp__.py (+48/-0)
project_cost_plan_purchase/account_analytic_line_plan.py (+223/-0)
project_cost_plan_purchase/i18n/es.po (+243/-0)
project_cost_plan_purchase/i18n/project_cost_plan_purchase.pot (+242/-0)
project_cost_plan_purchase/project_purchase_line_plan_view.xml (+135/-0)
project_cost_plan_purchase/project_view.xml (+14/-0)
project_cost_plan_purchase/security/ir.model.access.csv (+1/-0)
project_cost_plan_purchase/wizard/__init__.py (+25/-0)
project_cost_plan_purchase/wizard/project_purchase_plan_make_purchase.py (+190/-0)
project_cost_plan_purchase/wizard/project_purchase_plan_make_purchase.xml (+38/-0)
project_cost_plan_sale/__init__.py (+26/-0)
project_cost_plan_sale/__openerp__.py (+48/-0)
project_cost_plan_sale/account_analytic_line_plan.py (+213/-0)
project_cost_plan_sale/i18n/es.po (+205/-0)
project_cost_plan_sale/i18n/project_cost_plan_sale.pot (+205/-0)
project_cost_plan_sale/project_sale_line_plan_view.xml (+143/-0)
project_cost_plan_sale/project_view.xml (+14/-0)
project_cost_plan_sale/security/ir.model.access.csv (+1/-0)
project_cost_plan_sale/wizard/__init__.py (+25/-0)
project_cost_plan_sale/wizard/project_sale_plan_make_sale.py (+164/-0)
project_cost_plan_sale/wizard/project_sale_plan_make_sale.xml (+38/-0)
project_cost_plan_time/__init__.py (+24/-0)
project_cost_plan_time/__openerp__.py (+47/-0)
project_cost_plan_time/account_analytic_line_plan.py (+201/-0)
project_cost_plan_time/i18n/es.po (+120/-0)
project_cost_plan_time/i18n/project_cost_plan_time.pot (+120/-0)
project_cost_plan_time/project_time_line_plan_view.xml (+116/-0)
project_cost_plan_time/project_view.xml (+14/-0)
project_cost_plan_time/security/ir.model.access.csv (+1/-0)
project_hr_stakeholder/__init__.py (+30/-0)
project_hr_stakeholder/__openerp__.py (+59/-0)
project_hr_stakeholder/i18n/es.po (+265/-0)
project_hr_stakeholder/i18n/project_hr_stakeholder.pot (+254/-0)
project_hr_stakeholder/project.py (+36/-0)
project_hr_stakeholder/project_hr_responsibility.py (+40/-0)
project_hr_stakeholder/project_hr_responsibility.xml (+57/-0)
project_hr_stakeholder/project_hr_role.py (+40/-0)
project_hr_stakeholder/project_hr_role.xml (+57/-0)
project_hr_stakeholder/project_hr_stakeholder.py (+121/-0)
project_hr_stakeholder/project_hr_stakeholder.xml (+103/-0)
project_hr_stakeholder/project_hr_stakeholder_data.xml (+75/-0)
project_hr_stakeholder/project_view.xml (+88/-0)
project_hr_stakeholder/security/ir.model.access.csv (+7/-0)
project_hr_stakeholder/security/project_security.xml (+5/-0)
project_integration/__init__.py (+26/-0)
project_integration/__openerp__.py (+62/-0)
project_integration/email_template_view.xml (+51/-0)
project_integration/i18n/es.po (+279/-0)
project_integration/i18n/project_integration.pot (+258/-0)
project_integration/process/project_task_process.xml (+66/-0)
project_integration/project.py (+157/-0)
project_integration/project_integration_view.xml (+240/-0)
project_integration/project_task.py (+165/-0)
project_integration/security/ir.model.access.csv (+1/-0)
project_integration_analysis/__init__.py (+24/-0)
project_integration_analysis/__openerp__.py (+59/-0)
project_integration_analysis/i18n/es.po (+214/-0)
project_integration_analysis/i18n/project_integration_analysis.pot (+214/-0)
project_integration_analysis/project_progress_report.xml (+10/-0)
project_integration_analysis/report/__init__.py (+25/-0)
project_integration_analysis/report/project_progress.py (+261/-0)
project_integration_analysis/report/project_progress.rml (+459/-0)
project_integration_analysis/security/ir.model.access.csv (+3/-0)
project_integration_analysis/wizard/__init__.py (+25/-0)
project_integration_analysis/wizard/project_progress_report.py (+62/-0)
project_integration_analysis/wizard/project_progress_report_view.xml (+51/-0)
project_invoice/__init__.py (+24/-0)
project_invoice/__openerp__.py (+46/-0)
project_invoice/account_invoice_view.xml (+41/-0)
project_invoice/i18n/es.po (+27/-0)
project_invoice/i18n/project_invoice.pot (+27/-0)
project_invoice/invoice.py (+102/-0)
project_procurement/__init__.py (+30/-0)
project_procurement/__openerp__.py (+55/-0)
project_procurement/i18n/es.po (+154/-0)
project_procurement/i18n/project_procurement.pot (+153/-0)
project_procurement/project.py (+36/-0)
project_procurement/project_view.xml (+66/-0)
project_procurement/purchase_order.py (+54/-0)
project_procurement/purchase_order_line.py (+80/-0)
project_procurement/purchase_order_view.xml (+50/-0)
project_procurement/purchase_requisition.py (+65/-0)
project_procurement/purchase_requisition_line.py (+52/-0)
project_procurement/purchase_requisition_view.xml (+29/-0)
project_procurement/security/ir.model.access.csv (+15/-0)
project_procurement/security/project_procurement_security.xml (+31/-0)
project_procurement/wizard/__init__.py (+25/-0)
project_procurement/wizard/purchase_requisition_partner.py (+138/-0)
project_sale/__init__.py (+25/-0)
project_sale/__openerp__.py (+52/-0)
project_sale/account_invoice_view.xml (+274/-0)
project_sale/i18n/es.po (+145/-0)
project_sale/i18n/project_sale.pot (+143/-0)
project_sale/project_view.xml (+39/-0)
project_sale/sale.py (+154/-0)
project_sale/sale_order_view.xml (+183/-0)
project_sale/wizard/__init__.py (+24/-0)
project_sale/wizard/sale_line_invoice.py (+119/-0)
project_scope_wbs/__init__.py (+27/-0)
project_scope_wbs/__openerp__.py (+59/-0)
project_scope_wbs/i18n/es.po (+234/-0)
project_scope_wbs/i18n/project_scope_wbs.pot (+233/-0)
project_scope_wbs/project_lifecycle.py (+44/-0)
project_scope_wbs/project_lifecycle_view.xml (+54/-0)
project_scope_wbs/project_scope_wbs.py (+359/-0)
project_scope_wbs/project_scope_wbs_view.xml (+186/-0)
project_scope_wbs/security/ir.model.access.csv (+3/-0)
project_time_easy_scheduling/__init__.py (+24/-0)
project_time_easy_scheduling/__openerp__.py (+52/-0)
project_time_easy_scheduling/i18n/es.po (+138/-0)
project_time_easy_scheduling/i18n/project_time_easy_scheduling.pot (+134/-0)
project_time_easy_scheduling/project_task_view.xml (+270/-0)
project_time_milestone/__init__.py (+25/-0)
project_time_milestone/__openerp__.py (+50/-0)
project_time_milestone/i18n/es.po (+173/-0)
project_time_milestone/i18n/project_time_milestone.pot (+168/-0)
project_time_milestone/project_time_milestone.py (+64/-0)
project_time_milestone/project_time_milestone_view.xml (+93/-0)
project_time_schedule/__init__.py (+25/-0)
project_time_schedule/__openerp__.py (+61/-0)
project_time_schedule/dijkstra.py (+88/-0)
project_time_schedule/i18n/es.po (+187/-0)
project_time_schedule/i18n/project_time_schedule.pot (+153/-0)
project_time_schedule/priodict.py (+72/-0)
project_time_schedule/project_class.py (+234/-0)
project_time_schedule/project_class_view.xml (+69/-0)
project_time_schedule/project_time_schedule.py (+918/-0)
project_time_schedule/project_time_schedule_view.xml (+377/-0)
project_time_schedule_images/__init__.py (+22/-0)
project_time_schedule_images/__openerp__.py (+40/-0)
project_time_sequence/__init__.py (+25/-0)
project_time_sequence/__openerp__.py (+51/-0)
project_time_sequence/i18n/es.po (+170/-0)
project_time_sequence/i18n/project_time_sequence.pot (+152/-0)
project_time_sequence/project_time_sequence.py (+185/-0)
project_time_sequence/project_time_sequence_view.xml (+45/-0)
project_time_sequence/wizard/__init__.py (+25/-0)
project_time_sequence/wizard/project_task_link_predecessors.py (+142/-0)
project_time_sequence/wizard/project_task_link_predecessors.xml (+58/-0)
project_wbs/__init__.py (+26/-0)
project_wbs/__openerp__.py (+39/-0)
project_wbs/project.py (+234/-0)
project_wbs/project_view.xml (+160/-0)
Conflict adding file account_analytic_lob.  Moved existing file to account_analytic_lob.moved.
Conflict adding file project_category.  Moved existing file to project_category.moved.
Conflict adding file project_communications_mailgate.  Moved existing file to project_communications_mailgate.moved.
Conflict adding file project_communications_mailgate_note.  Moved existing file to project_communications_mailgate_note.moved.
Conflict adding file project_communications_meetings.  Moved existing file to project_communications_meetings.moved.
Conflict adding file project_cost.  Moved existing file to project_cost.moved.
Conflict adding file project_cost_analysis.  Moved existing file to project_cost_analysis.moved.
Conflict adding file project_cost_commit_hr_timesheet.  Moved existing file to project_cost_commit_hr_timesheet.moved.
Conflict adding file project_cost_commit_purchase.  Moved existing file to project_cost_commit_purchase.moved.
Conflict adding file project_cost_commit_sale.  Moved existing file to project_cost_commit_sale.moved.
Conflict adding file project_cost_plan_purchase.  Moved existing file to project_cost_plan_purchase.moved.
Conflict adding file project_cost_plan_sale.  Moved existing file to project_cost_plan_sale.moved.
Conflict adding file project_cost_plan_time.  Moved existing file to project_cost_plan_time.moved.
Conflict adding file project_hr_stakeholder.  Moved existing file to project_hr_stakeholder.moved.
Conflict adding file project_integration.  Moved existing file to project_integration.moved.
Conflict adding file project_integration_analysis.  Moved existing file to project_integration_analysis.moved.
Conflict adding file project_invoice.  Moved existing file to project_invoice.moved.
Conflict adding file project_procurement.  Moved existing file to project_procurement.moved.
Conflict adding file project_sale.  Moved existing file to project_sale.moved.
Conflict adding file project_scope_wbs.  Moved existing file to project_scope_wbs.moved.
Conflict adding file project_time_easy_scheduling.  Moved existing file to project_time_easy_scheduling.moved.
Conflict adding file project_time_milestone.  Moved existing file to project_time_milestone.moved.
Conflict adding file project_time_schedule.  Moved existing file to project_time_schedule.moved.
Conflict adding file project_time_sequence.  Moved existing file to project_time_sequence.moved.
To merge this branch: bzr merge lp:~cpueyo/eficent-openerp-project-management/nerviaconsultores-openerp-7.0
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) (community) Disapprove
Eficent Pending
Review via email: mp+144256@code.launchpad.net

Description of the change

Adaptados los módulos a la versión 7.0

To post a comment you must log in.
2. By Carlos Pueyo

Update

3. By Carlos Pueyo

Test

4. By Carlos Pueyo

Arreglados ciertos problemas

5. By Carlos Pueyo

Actualizados.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Carlos,

there seems to be something wrong with your branch. I took the liberty of rebasing your changes to the trunk series of this project, so that we can review the changes. See here: https://code.launchpad.net/~openerp-community/eficent-openerp-project-management/nerviaconsultores-openerp-7.0/+merge/150892

Thanks for your work!

Cheers,
Stefan.

review: Disapprove

Unmerged revisions

5. By Carlos Pueyo

Actualizados.

4. By Carlos Pueyo

Arreglados ciertos problemas

3. By Carlos Pueyo

Test

2. By Carlos Pueyo

Update

1. By Carlos Pueyo

Adaptados modulos Eficent a la 7.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,27 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import account_analytic_lob
23import project
24
25
26
27# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
028
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,48 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22
23{
24 "name": "Project Management",
25 "version": "1.0",
26 "author": "Eficent, Nervia Consultores",
27 "website": "",
28 "category": "Generic Modules/Projects & Services",
29 "depends": ["account","analytic","project"],
30 "description": """Introduce business segments in analytic accounts.
31 Provides the possibility to perform economic analysis by business segment.
32 """,
33 "init_xml": [],
34 "update_xml": [
35 "security/ir.model.access.csv",
36 "account_analytic_lob_view.xml",
37 "project_view.xml",
38 ],
39 'demo_xml': [
40
41 ],
42 'test':[
43 ],
44 'installable': True,
45 'active': False,
46 'certificate': '',
47}
48# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
049
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,39 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import tools
23from osv import fields, osv
24from tools.translate import _
25
26
27class account_analytic_lob(osv.osv):
28
29 _name = "account.analytic.lob"
30 _description = 'Line of Business'
31 _order = 'name'
32
33 _columns = {
34 'code': fields.char('Code', size=4, required=True, translate=True),
35 'name': fields.char('Name', size=32, required=True, translate=True),
36 }
37
38account_analytic_lob()
39
040
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,66 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <!-- Analytic Account Line of Business -->
6
7 <record id="view_account_analytic_lob_search" model="ir.ui.view">
8 <field name="name">account.analytic.lob.search</field>
9 <field name="model">account.analytic.lob</field>
10 <field name="type">search</field>
11 <field name="arch" type="xml">
12 <search string="Line of Business">
13 <field name="code"/>
14 <field name="name"/>
15 </search>
16 </field>
17 </record>
18
19 <record id="view_account_analytic_lob_edit" model="ir.ui.view">
20 <field name="name">account.analytic.lob.form</field>
21 <field name="model">account.analytic.lob</field>
22 <field name="type">form</field>
23 <field name="arch" type="xml">
24 <form string="Line of Business">
25 <field name="code" select="1"/>
26 <field name="name" select="1"/>
27 </form>
28 </field>
29 </record>
30
31 <record id="view_account_analytic_lob_tree" model="ir.ui.view">
32 <field name="name">account.analytic.lob.tree</field>
33 <field name="model">account.analytic.lob</field>
34 <field name="type">tree</field>
35 <field name="arch" type="xml">
36 <tree string="Line of Business">
37 <field name="code"/>
38 <field name="name"/>
39 </tree>
40 </field>
41 </record>
42
43 <record id="action_account_analytic_lob_tree" model="ir.actions.act_window">
44 <field name="name">Line of Business</field>
45 <field name="res_model">account.analytic.lob</field>
46 <field name="view_id" ref="view_account_analytic_lob_tree"/>
47 <field name="view_mode">tree,form</field>
48 <field name="search_view_id" ref="view_account_analytic_lob_search"/>
49 <field name="help">Define the Lines of Business.</field>
50 </record>
51
52 <menuitem id="menu_account_analytic_lob_config"
53 name="Line of Business"
54 parent="account.menu_analytic_accounting"
55 sequence="1"
56 />
57
58 <menuitem
59 action="action_account_analytic_lob_tree"
60 id="menu_account_analytic_lob_view"
61 parent="menu_account_analytic_lob_config"
62 sequence="1"
63 groups="analytic.group_analytic_accounting"
64 />
65 </data>
66</openerp>
067
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,57 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_analytic_lob
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-12-18 08:17+0000\n"
10"PO-Revision-Date: 2011-12-18 08:17+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: account_analytic_lob
19#: field:account.analytic.account,lob:0
20#: view:account.analytic.lob:0
21#: model:ir.actions.act_window,name:account_analytic_lob.action_account_analytic_lob_tree
22#: model:ir.model,name:account_analytic_lob.model_account_analytic_lob
23#: model:ir.ui.menu,name:account_analytic_lob.menu_account_analytic_lob_config
24#: model:ir.ui.menu,name:account_analytic_lob.menu_account_analytic_lob_view
25msgid "Line of Business"
26msgstr ""
27
28#. module: account_analytic_lob
29#: field:account.analytic.lob,code:0
30msgid "Code"
31msgstr ""
32
33#. module: account_analytic_lob
34#: field:account.analytic.lob,name:0
35msgid "Name"
36msgstr ""
37
38#. module: account_analytic_lob
39#: model:ir.actions.act_window,help:account_analytic_lob.action_account_analytic_lob_tree
40msgid "Define the Lines of Business."
41msgstr ""
42
43#. module: account_analytic_lob
44#: model:ir.model,name:account_analytic_lob.model_account_analytic_account
45msgid "Analytic Account"
46msgstr ""
47
48#. module: account_analytic_lob
49#: constraint:account.analytic.account:0
50msgid "Error! The currency has to be the same as the currency of the selected company"
51msgstr ""
52
53#. module: account_analytic_lob
54#: constraint:account.analytic.account:0
55msgid "Error! You can not create recursive analytic accounts."
56msgstr ""
57
058
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,57 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_analytic_lob
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-12-18 08:17+0000\n"
10"PO-Revision-Date: 2011-12-18 09:18+0100\n"
11"Last-Translator: Jordi Ballester <jordi.ballester@eficent.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: account_analytic_lob
19#: field:account.analytic.account,lob:0
20#: view:account.analytic.lob:0
21#: model:ir.actions.act_window,name:account_analytic_lob.action_account_analytic_lob_tree
22#: model:ir.model,name:account_analytic_lob.model_account_analytic_lob
23#: model:ir.ui.menu,name:account_analytic_lob.menu_account_analytic_lob_config
24#: model:ir.ui.menu,name:account_analytic_lob.menu_account_analytic_lob_view
25msgid "Line of Business"
26msgstr "Línea de Negocio"
27
28#. module: account_analytic_lob
29#: field:account.analytic.lob,code:0
30msgid "Code"
31msgstr "Código"
32
33#. module: account_analytic_lob
34#: field:account.analytic.lob,name:0
35msgid "Name"
36msgstr "Nombre"
37
38#. module: account_analytic_lob
39#: model:ir.actions.act_window,help:account_analytic_lob.action_account_analytic_lob_tree
40msgid "Define the Lines of Business."
41msgstr "Define las Líneas de Negocio."
42
43#. module: account_analytic_lob
44#: model:ir.model,name:account_analytic_lob.model_account_analytic_account
45msgid "Analytic Account"
46msgstr "Cuenta analítica"
47
48#. module: account_analytic_lob
49#: constraint:account.analytic.account:0
50msgid "Error! The currency has to be the same as the currency of the selected company"
51msgstr "¡Error! La divisa tiene que ser la misma que la establecida en la compañía seleccionada"
52
53#. module: account_analytic_lob
54#: constraint:account.analytic.account:0
55msgid "Error! You can not create recursive analytic accounts."
56msgstr "¡Error! No puede crear cuentas analíticas recursivas."
57
058
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,34 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from osv import fields, osv
23
24
25class account_analytic_account(osv.osv):
26
27 _inherit = 'account.analytic.account'
28
29
30 _columns = {
31 'lob': fields.many2one('account.analytic.lob','Line of Business'),
32 }
33
34account_analytic_account()
035
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,42 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5
6
7#---------------------------------------------------------------------------------------------------------
8# Extend the project
9#---------------------------------------------------------------------------------------------------------
10 <record id="edit_project" model="ir.ui.view">
11 <field name="name">project.project.form</field>
12 <field name="model">project.project</field>
13 <field name="type">form</field>
14 <field name="inherit_id" ref="project.edit_project"/>
15 <field name="arch" type="xml">
16 <xpath expr="//form/sheet/notebook/page[@string='Other Info']/group/group[@string='Miscellaneous']/field[@name='parent_id']" position="after">
17 <field name="lob"/>
18 </xpath>
19 </field>
20 </record>
21
22
23
24#---------------------------------------------------------------------------------------------------------
25# Extend the analytic account
26#---------------------------------------------------------------------------------------------------------
27
28
29 <record id="view_account_analytic_account_form" model="ir.ui.view">
30 <field name="name">account.analytic.account.form</field>
31 <field name="model">account.analytic.account</field>
32 <field name="type">form</field>
33 <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
34 <field name="arch" type="xml">
35 <xpath expr="//form/sheet/notebook/page[@string='Contract Information']/field[@name='description']" position="after">
36 <field name="lob"/>
37 </xpath>
38 </field>
39 </record>
40
41 </data>
42</openerp>
043
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,5 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2"access_account_analytic_lob_project_user","account.analytic.lob project user","model_account_analytic_lob","project.group_project_user",1,0,0,0
3"access_account_analytic_lob_account_user","account.analytic.lob account user","model_account_analytic_lob","account.group_account_user",1,0,0,0
4"access_account_analytic_lob_project_manager","account.analytic.lob project manager","model_account_analytic_lob","project.group_project_manager",1,1,1,1
5"access_account_analytic_lob_account_manager","account.analytic.lob account manager","model_account_analytic_lob","account.group_account_manager",1,1,1,1
0\ No newline at end of file6\ No newline at end of file
17
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21import analytic_account_category
22import account_analytic_account
23
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
025
=== added file 'project_category/__openerp__.py'
--- project_category/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_category/__openerp__.py 2013-02-19 14:36:22 +0000
@@ -0,0 +1,56 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# <contact@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22
23{
24 "name": "Project Management",
25 "version": "1.0",
26 "author": "Eficent, Nervia Consultores",
27 "website": "",
28 "category": "Generic Modules/Projects & Services",
29 "depends": [
30 "base",
31 "account",
32 "analytic",
33 "project",
34 ],
35 "description": """ This module intrododuces the possibility to associate categories to analytic accounts and projects.
36 Manage the analytic account categories in order to better classify them for tracking and analysis purposes.
37 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.
38 """,
39 "init_xml": [
40 ],
41 "update_xml": [
42 "analytic_account_category.xml",
43 "analytic_account_view.xml",
44 "project_view.xml",
45 "security/ir.model.access.csv",
46 ],
47 'demo_xml': [
48
49 ],
50 'test':[
51 ],
52 'installable': True,
53 'active': False,
54 'certificate': '',
55}
56# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
057
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,67 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# <contact@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from lxml import etree
23import time
24from datetime import datetime, date, timedelta
25import decimal_precision as dp
26from tools.translate import _
27from osv import fields, osv
28import netsvc
29import tools
30
31class account_analytic_account(osv.osv):
32
33 def _categories_name_calc(self, cr, uid, ids, name, args, context=None):
34
35 if not ids:
36 return []
37 res = []
38
39 accounts_br = self.browse(cr, uid, ids, context=context)
40
41 for account in accounts_br:
42 data =[]
43 categories_br = account.category_id
44 if categories_br:
45 for category_br in categories_br:
46 cat_name = category_br.complete_name or ''
47 data.insert(0, cat_name)
48 data.sort(cmp=None, key=None, reverse=False)
49 data_str = ', '.join(map(tools.ustr,data))
50
51 else:
52 data_str = ''
53
54
55 res.append((account.id, data_str))
56
57 return dict(res)
58
59 _inherit = 'account.analytic.account'
60 _columns = {
61
62 'category_id': fields.many2many('analytic.account.category', 'analytic_account_category_rel', 'account_id', 'category_id', 'Categories'),
63 'categories_name_str': fields.function(_categories_name_calc, method=True, type='text', string='Categories', help='Analytic account categories'),
64
65 }
66
67account_analytic_account()
0\ No newline at end of file68\ No newline at end of file
169
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,80 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# <contact@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import tools
23from osv import fields, osv
24from tools.translate import _
25
26
27class analytic_account_category(osv.osv):
28 def name_get(self, cr, uid, ids, context=None):
29 if not len(ids):
30 return []
31 reads = self.read(cr, uid, ids, ['name','parent_id'], context=context)
32 res = []
33 for record in reads:
34 name = record['name']
35 if record['parent_id']:
36 name = record['parent_id'][1]+' / '+name
37 res.append((record['id'], name))
38 return res
39
40 def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
41 if not args:
42 args=[]
43 if context is None:
44 context={}
45 if name:
46 # Be sure name_search is symetric to name_get
47 name = name.split(' / ')[-1]
48 ids = self.search(cr, uid, [('name', operator, name)] + args, limit=limit, context=context)
49 else:
50 ids = self.search(cr, uid, args, limit=limit, context=context)
51 return self.name_get(cr, uid, ids, context)
52
53
54 def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
55 res = self.name_get(cr, uid, ids, context=context)
56 return dict(res)
57
58 _description='Analytic account & project Categories'
59 _name = 'analytic.account.category'
60 _columns = {
61 'name': fields.char('Category Name', required=True, size=64, translate=True),
62 'parent_id': fields.many2one('analytic.account.category', 'Parent Category', select=True, ondelete='cascade'),
63 'complete_name': fields.function(_name_get_fnc, method=True, type="char", string='Full Name'),
64 'child_ids': fields.one2many('analytic.account.category', 'parent_id', 'Child Categories'),
65 'active' : fields.boolean('Active', help="The active field allows you to hide the category without removing it."),
66 'parent_left' : fields.integer('Left parent', select=True),
67 'parent_right' : fields.integer('Right parent', select=True),
68 'account_ids': fields.many2many('account.analytic.account', 'analytic_account_category_rel', 'category_id', 'account_id', 'Categories'),
69 }
70 _constraints = [
71 (osv.osv._check_recursion, 'Error ! You can not create recursive categories.', ['parent_id'])
72 ]
73 _defaults = {
74 'active' : lambda *a: 1,
75 }
76 _parent_store = True
77 _parent_order = 'name'
78 _order = 'parent_left'
79
80analytic_account_category()
0\ No newline at end of file81\ No newline at end of file
182
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,80 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <!--
6 ======================
7 Categories
8 ======================
9 -->
10 <record id="view_analytic_account_category_form" model="ir.ui.view">
11 <field name="name">Analytic Account Categories</field>
12 <field name="model">analytic.account.category</field>
13 <field name="type">form</field>
14 <field name="arch" type="xml">
15 <form string="Analytic Account Category">
16 <field name="name" select="1"/>
17 <field name="active" groups="base.group_erp_manager"/>
18 <field name="parent_id"/>
19 <separator colspan="4" string="Analytic Accounts"/>
20 <field colspan="4" name="account_ids" nolabel="1"/>
21 </form>
22 </field>
23 </record>
24 <record id="view_analytic_account_category_list" model="ir.ui.view">
25 <field name="name">Analytic Account Categories</field>
26 <field name="model">analytic.account.category</field>
27 <field name="type">tree</field>
28 <field eval="6" name="priority"/>
29 <field name="arch" type="xml">
30 <tree string="Analytic Account Categories">
31 <field name="complete_name"/>
32 </tree>
33 </field>
34 </record>
35 <record id="view_analytic_account_category_tree" model="ir.ui.view">
36 <field name="name">analytic.account.category.tree</field>
37 <field name="model">analytic.account.category</field>
38 <field name="type">tree</field>
39 <field name="field_parent">child_ids</field>
40 <field name="arch" type="xml">
41 <tree toolbar="1" string="Analytic Account Categories">
42 <field name="name"/>
43 </tree>
44 </field>
45 </record>
46
47
48 <record id="action_analytic_account_by_category" model="ir.actions.act_window">
49 <field name="name">Analytic Account Categories</field>
50 <field name="res_model">account.analytic.account</field>
51 <field name="view_type">form</field>
52 <field name="view_mode">tree,form</field>
53 <field name="domain">[('category_id','child_of', [active_id])]</field>
54 <field name="context">{'category_id':active_id}</field>
55 <field name="search_view_id" ref="account.view_account_analytic_account_search"/>
56 </record>
57
58
59 <record id="ir_action_analytic_account_by_category" model="ir.values">
60 <field eval="'tree_but_open'" name="key2"/>
61 <field eval="'analytic.account.category'" name="model"/>
62 <field name="name">Open analytic accounts</field>
63 <field eval="'ir.actions.act_window,%d'%action_analytic_account_by_category" name="value"/>
64 <field eval="True" name="object"/>
65 </record>
66
67 <record id="action_analytic_account_category_form" model="ir.actions.act_window">
68 <field name="name">Analytic Account Categories</field>
69 <field name="type">ir.actions.act_window</field>
70 <field name="res_model">analytic.account.category</field>
71 <field name="view_type">form</field>
72 <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>
73 </record>
74
75 <menuitem action="action_analytic_account_category_form" id="menu_analytic_account_category_form" name="Analytic Account Categories" sequence="4" parent="account.menu_analytic_accounting"/>
76 <menuitem action="action_analytic_account_category_form" id="menu_project_category_form" name="Project Categories" sequence="4" parent="base.menu_definitions"/>
77
78
79 </data>
80</openerp>
081
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,68 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5
6#---------------------------------------------------------------------------------------------------------
7# Extend the analytic account
8#---------------------------------------------------------------------------------------------------------
9 <record id="view_account_analytic_account_list" model="ir.ui.view">
10 <field name="name">account.analytic.account.list</field>
11 <field name="model">account.analytic.account</field>
12 <field name="type">tree</field>
13 <field eval="8" name="priority"/>
14 <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
15 <field name="arch" type="xml">
16 <field name="code" position="after">
17 <field name="category_id"/>
18 </field>
19 </field>
20 </record>
21
22 <record id="view_account_analytic_account_search" model="ir.ui.view">
23 <field name="name">account.analytic.account.search</field>
24 <field name="model">account.analytic.account</field>
25 <field name="type">search</field>
26 <field name="inherit_id" ref="account.view_account_analytic_account_search"/>
27 <field name="arch" type="xml">
28 <field name="name" position="after">
29 <field name="category_id" select="1"/>
30 </field>
31 </field>
32 </record>
33
34 <record id="view_account_analytic_account_tree" model="ir.ui.view">
35 <field name="name">account.analytic.account.tree</field>
36 <field name="model">account.analytic.account</field>
37 <field name="type">tree</field>
38 <field name="field_parent">child_complete_ids</field>
39 <field name="inherit_id" ref="account.view_account_analytic_account_tree"/>
40 <field name="arch" type="xml">
41 <field name="name" position="after">
42 <field name="categories_name_str"/>
43 </field>
44 </field>
45 </record>
46
47 <record id="view_account_analytic_account_form" model="ir.ui.view">
48 <field name="name">account.analytic.account.form</field>
49 <field name="model">account.analytic.account</field>
50 <field name="type">form</field>
51 <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
52 <field name="arch" type="xml">
53 <form string="Analytic Account" version="7.0">
54 <sheet string="Analytic Account">
55 <notebook>
56 <page string="Account Data" position="after">
57 <page string="Categories">
58 <field colspan="4" name="category_id" nolabel="1"/>
59 </page>
60 </page>
61 </notebook>
62 </sheet>
63 </form>
64 </field>
65 </record>
66
67 </data>
68</openerp>
069
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,134 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_category
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2012-10-18 22:49+0000\n"
10"PO-Revision-Date: 2012-10-19 01:04+0100\n"
11"Last-Translator: Jordi Ballester <jordi.ballester@eficent.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: project_category
19#: field:analytic.account.category,parent_left:0
20msgid "Left parent"
21msgstr "Padre izquierdo"
22
23#. module: project_category
24#: view:project.project:0
25msgid "Administration"
26msgstr "Administración"
27
28#. module: project_category
29#: field:analytic.account.category,child_ids:0
30msgid "Child Categories"
31msgstr "Categorías hijas"
32
33#. module: project_category
34#: view:analytic.account.category:0
35msgid "Analytic Account Category"
36msgstr "Categoría Cuenta Analítica"
37
38#. module: project_category
39#: field:analytic.account.category,name:0
40msgid "Category Name"
41msgstr "Nombre Categoría"
42
43#. module: project_category
44#: model:ir.actions.act_window,help:project_category.action_analytic_account_category_form
45msgid "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."
46msgstr "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."
47
48#. module: project_category
49#: model:ir.ui.menu,name:project_category.menu_project_category_form
50msgid "Project Categories"
51msgstr "Categorías de Proyecto"
52
53#. module: project_category
54#: model:ir.model,name:project_category.model_analytic_account_category
55msgid "Analytic account & project Categories"
56msgstr "Categorías de cuenta analítica y proyecto"
57
58#. module: project_category
59#: view:analytic.account.category:0
60#: model:ir.actions.act_window,name:project_category.action_analytic_account_by_category
61#: model:ir.actions.act_window,name:project_category.action_analytic_account_category_form
62#: model:ir.ui.menu,name:project_category.menu_analytic_account_category_form
63msgid "Analytic Account Categories"
64msgstr "Categorías Cuenta Analítica"
65
66#. module: project_category
67#: field:analytic.account.category,active:0
68msgid "Active"
69msgstr "Activa"
70
71#. module: project_category
72#: view:account.analytic.account:0
73#: field:account.analytic.account,categories_name_str:0
74#: field:account.analytic.account,category_id:0
75#: field:analytic.account.category,account_ids:0
76#: view:project.project:0
77msgid "Categories"
78msgstr "Categorías"
79
80#. module: project_category
81#: view:analytic.account.category:0
82msgid "Analytic Accounts"
83msgstr "Cuentas Analíticas"
84
85#. module: project_category
86#: field:analytic.account.category,parent_id:0
87msgid "Parent Category"
88msgstr "Categoría Padre"
89
90#. module: project_category
91#: constraint:account.analytic.account:0
92msgid "Error! The currency has to be the same as the currency of the selected company"
93msgstr "¡Error! La divisa tiene que ser la misma que la establecida en la compañía seleccionada"
94
95#. module: project_category
96#: field:analytic.account.category,complete_name:0
97msgid "Full Name"
98msgstr "Nombre Completo"
99
100#. module: project_category
101#: view:account.analytic.account:0
102msgid "Account Data"
103msgstr "Datos de la cuenta"
104
105#. module: project_category
106#: constraint:analytic.account.category:0
107msgid "Error ! You can not create recursive categories."
108msgstr "¡Error! No puede crear categorías recursivas."
109
110#. module: project_category
111#: help:account.analytic.account,categories_name_str:0
112msgid "Analytic account categories"
113msgstr "Categorías de cuenta analítica"
114
115#. module: project_category
116#: model:ir.model,name:project_category.model_account_analytic_account
117msgid "Analytic Account"
118msgstr "Cuenta analítica"
119
120#. module: project_category
121#: help:analytic.account.category,active:0
122msgid "The active field allows you to hide the category without removing it."
123msgstr "El campo activo le permite ocultar la categoría sin tener que eliminarla."
124
125#. module: project_category
126#: constraint:account.analytic.account:0
127msgid "Error! You can not create recursive analytic accounts."
128msgstr "¡Error! No puede crear cuentas analíticas recursivas."
129
130#. module: project_category
131#: field:analytic.account.category,parent_right:0
132msgid "Right parent"
133msgstr "Padre derecho"
134
0135
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,134 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_category
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2012-10-18 22:49+0000\n"
10"PO-Revision-Date: 2012-10-18 22:49+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: project_category
19#: field:analytic.account.category,parent_left:0
20msgid "Left parent"
21msgstr ""
22
23#. module: project_category
24#: view:project.project:0
25msgid "Administration"
26msgstr ""
27
28#. module: project_category
29#: field:analytic.account.category,child_ids:0
30msgid "Child Categories"
31msgstr ""
32
33#. module: project_category
34#: view:analytic.account.category:0
35msgid "Analytic Account Category"
36msgstr ""
37
38#. module: project_category
39#: field:analytic.account.category,name:0
40msgid "Category Name"
41msgstr ""
42
43#. module: project_category
44#: model:ir.actions.act_window,help:project_category.action_analytic_account_category_form
45msgid "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."
46msgstr ""
47
48#. module: project_category
49#: model:ir.ui.menu,name:project_category.menu_project_category_form
50msgid "Project Categories"
51msgstr ""
52
53#. module: project_category
54#: model:ir.model,name:project_category.model_analytic_account_category
55msgid "Analytic account & project Categories"
56msgstr ""
57
58#. module: project_category
59#: view:analytic.account.category:0
60#: model:ir.actions.act_window,name:project_category.action_analytic_account_by_category
61#: model:ir.actions.act_window,name:project_category.action_analytic_account_category_form
62#: model:ir.ui.menu,name:project_category.menu_analytic_account_category_form
63msgid "Analytic Account Categories"
64msgstr ""
65
66#. module: project_category
67#: field:analytic.account.category,active:0
68msgid "Active"
69msgstr ""
70
71#. module: project_category
72#: view:account.analytic.account:0
73#: field:account.analytic.account,categories_name_str:0
74#: field:account.analytic.account,category_id:0
75#: field:analytic.account.category,account_ids:0
76#: view:project.project:0
77msgid "Categories"
78msgstr ""
79
80#. module: project_category
81#: view:analytic.account.category:0
82msgid "Analytic Accounts"
83msgstr ""
84
85#. module: project_category
86#: field:analytic.account.category,parent_id:0
87msgid "Parent Category"
88msgstr ""
89
90#. module: project_category
91#: constraint:account.analytic.account:0
92msgid "Error! The currency has to be the same as the currency of the selected company"
93msgstr ""
94
95#. module: project_category
96#: field:analytic.account.category,complete_name:0
97msgid "Full Name"
98msgstr ""
99
100#. module: project_category
101#: view:account.analytic.account:0
102msgid "Account Data"
103msgstr ""
104
105#. module: project_category
106#: constraint:analytic.account.category:0
107msgid "Error ! You can not create recursive categories."
108msgstr ""
109
110#. module: project_category
111#: help:account.analytic.account,categories_name_str:0
112msgid "Analytic account categories"
113msgstr ""
114
115#. module: project_category
116#: model:ir.model,name:project_category.model_account_analytic_account
117msgid "Analytic Account"
118msgstr ""
119
120#. module: project_category
121#: help:analytic.account.category,active:0
122msgid "The active field allows you to hide the category without removing it."
123msgstr ""
124
125#. module: project_category
126#: constraint:account.analytic.account:0
127msgid "Error! You can not create recursive analytic accounts."
128msgstr ""
129
130#. module: project_category
131#: field:analytic.account.category,parent_right:0
132msgid "Right parent"
133msgstr ""
134
0135
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,53 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5
6
7#---------------------------------------------------------------------------------------------------------
8# Extend the project
9#---------------------------------------------------------------------------------------------------------
10
11 <record id="view_project_project_filter" model="ir.ui.view">
12 <field name="name">project.project.select</field>
13 <field name="model">project.project</field>
14 <field name="type">search</field>
15 <field name="inherit_id" ref="project.view_project_project_filter"/>
16 <field name="arch" type="xml">
17 <field name="name" position="after">
18 <field name="category_id" select="1"/>
19 </field>
20 </field>
21 </record>
22
23
24 <record id="view_project" model="ir.ui.view">
25 <field name="name">project.project.tree</field>
26 <field name="model">project.project</field>
27 <field name="type">tree</field>
28 <field name="inherit_id" ref="project.view_project"/>
29 <field name="field_parent">child_ids</field>
30 <field name="arch" type="xml">
31 <field name="name" position="after">
32 <field name="categories_name_str"/>
33 </field>
34 </field>
35 </record>
36
37
38 <record id="edit_project" model="ir.ui.view">
39 <field name="name">project.project.form</field>
40 <field name="model">project.project</field>
41 <field name="type">form</field>
42 <field name="inherit_id" ref="project.edit_project"/>
43 <field name="arch" type="xml">
44 <page string="Other Info" position="after">
45 <page string="Categories">
46 <field colspan="4" name="category_id" nolabel="1"/>
47 </page>
48 </page>
49 </field>
50 </record>
51
52 </data>
53</openerp>
054
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,5 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2"access_analytic_account_category_project_user","analytic_account_category project user","model_analytic_account_category","project.group_project_user",1,0,0,0
3"access_analytic_account_category_project_manager","analytic_account_category project manager","model_analytic_account_category","project.group_project_manager",1,1,1,1
4"access_analytic_account_category_account_user","analytic_account_category account user","model_analytic_account_category","account.group_account_user",1,0,0,0
5"access_analytic_account_category_account_manager","analytic_account_category account manager","model_analytic_account_category","account.group_account_manager",1,1,1,1
06
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,25 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import project_communications_mailgate
23import project
24
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
026
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,46 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22
23{
24 "name": "Project MailGateWay for Projects",
25 "version": "1.0",
26 "author": "Eficent, Nervia Consultores",
27 "website": "",
28 "category": "Generic Modules/Projects & Services",
29 "depends": ["project", "mail"],
30 "description": """This module is an interface that synchronises mails with OpenERP Project.
31
32It allows updating projects as soon as a new mail arrives in our configured mail server.
33Moreover, it keeps track of all further communications and project states.
34 """,
35 "init_xml": [],
36 "update_xml": [
37 "project_communications_mailgate_view.xml",
38 ],
39 'demo_xml': [
40 ],
41 'installable': True,
42 'active': False,
43 'certificate': '',
44}
45
46# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
047
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,102 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_communications_mailgate
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2012-01-26 13:31+0000\n"
10"PO-Revision-Date: 2012-01-26 14:34+0100\n"
11"Last-Translator: Jordi Ballester <jordi.ballester@eficent.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: project_communications_mailgate
19#: view:project.project:0
20msgid "History Information"
21msgstr "Información histórica"
22
23#. module: project_communications_mailgate
24#: model:ir.module.module,description:project_communications_mailgate.module_meta_information
25msgid ""
26"This module is an interface that synchronises mails with OpenERP Project.\n"
27"\n"
28"It allows updating projects as soon as a new mail arrives in our configured mail server.\n"
29"Moreover, it keeps track of all further communications and project states.\n"
30" "
31msgstr "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."
32
33#. module: project_communications_mailgate
34#: view:project.project:0
35msgid "Attachments"
36msgstr "Archivos adjuntos"
37
38#. module: project_communications_mailgate
39#: field:project.project,message_ids:0
40msgid "Messages"
41msgstr "Mensajes"
42
43#. module: project_communications_mailgate
44#: model:ir.model,name:project_communications_mailgate.model_project_project
45msgid "Project"
46msgstr "Proyecto"
47
48#. module: project_communications_mailgate
49#: code:addons/project_communications_mailgate/project.py:46
50#, python-format
51msgid "Pending"
52msgstr "Pendiente"
53
54#. module: project_communications_mailgate
55#: model:ir.module.module,shortdesc:project_communications_mailgate.module_meta_information
56msgid "Project MailGateWay for Projects"
57msgstr "Pasarela de correos para proyectos"
58
59#. module: project_communications_mailgate
60#: code:addons/project_communications_mailgate/project.py:34
61#, python-format
62msgid "Draft"
63msgstr "Borrador"
64
65#. module: project_communications_mailgate
66#: view:project.project:0
67msgid "Details"
68msgstr "Detalles"
69
70#. module: project_communications_mailgate
71#: constraint:project.project:0
72msgid "Error! You cannot assign escalation to the same project!"
73msgstr "¡Error! No puede asignar un escalado al mismo proyecto."
74
75#. module: project_communications_mailgate
76#: code:addons/project_communications_mailgate/project.py:58
77#, python-format
78msgid "Cancel"
79msgstr "Cancelado"
80
81#. module: project_communications_mailgate
82#: code:addons/project_communications_mailgate/project.py:52
83#, python-format
84msgid "Done"
85msgstr "Realizado"
86
87#. module: project_communications_mailgate
88#: code:addons/project_communications_mailgate/project.py:40
89#, python-format
90msgid "Open"
91msgstr "Abierto"
92
93#. module: project_communications_mailgate
94#: constraint:project.project:0
95msgid "Error! project start-date must be lower then project end-date."
96msgstr "¡Error! La fecha de inicio del proyecto debe ser anterior a la fecha final del proyecto."
97
98#. module: project_communications_mailgate
99#: view:project.project:0
100msgid "History"
101msgstr "Historial"
102
0103
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,101 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_communications_mailgate
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2012-01-26 13:31+0000\n"
10"PO-Revision-Date: 2012-01-26 13:31+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: project_communications_mailgate
19#: view:project.project:0
20msgid "History Information"
21msgstr ""
22
23#. module: project_communications_mailgate
24#: model:ir.module.module,description:project_communications_mailgate.module_meta_information
25msgid "This module is an interface that synchronises mails with OpenERP Project.\n"
26"\n"
27"It allows updating projects as soon as a new mail arrives in our configured mail server.\n"
28"Moreover, it keeps track of all further communications and project states.\n"
29" "
30msgstr ""
31
32#. module: project_communications_mailgate
33#: view:project.project:0
34msgid "Attachments"
35msgstr ""
36
37#. module: project_communications_mailgate
38#: field:project.project,message_ids:0
39msgid "Messages"
40msgstr ""
41
42#. module: project_communications_mailgate
43#: model:ir.model,name:project_communications_mailgate.model_project_project
44msgid "Project"
45msgstr ""
46
47#. module: project_communications_mailgate
48#: code:addons/project_communications_mailgate/project.py:46
49#, python-format
50msgid "Pending"
51msgstr ""
52
53#. module: project_communications_mailgate
54#: model:ir.module.module,shortdesc:project_communications_mailgate.module_meta_information
55msgid "Project MailGateWay for Projects"
56msgstr ""
57
58#. module: project_communications_mailgate
59#: code:addons/project_communications_mailgate/project.py:34
60#, python-format
61msgid "Draft"
62msgstr ""
63
64#. module: project_communications_mailgate
65#: view:project.project:0
66msgid "Details"
67msgstr ""
68
69#. module: project_communications_mailgate
70#: constraint:project.project:0
71msgid "Error! You cannot assign escalation to the same project!"
72msgstr ""
73
74#. module: project_communications_mailgate
75#: code:addons/project_communications_mailgate/project.py:58
76#, python-format
77msgid "Cancel"
78msgstr ""
79
80#. module: project_communications_mailgate
81#: code:addons/project_communications_mailgate/project.py:52
82#, python-format
83msgid "Done"
84msgstr ""
85
86#. module: project_communications_mailgate
87#: code:addons/project_communications_mailgate/project.py:40
88#, python-format
89msgid "Open"
90msgstr ""
91
92#. module: project_communications_mailgate
93#: constraint:project.project:0
94msgid "Error! project start-date must be lower then project end-date."
95msgstr ""
96
97#. module: project_communications_mailgate
98#: view:project.project:0
99msgid "History"
100msgstr ""
101
0102
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,223 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm
23from openerp.tools.translate import _
24
25import base64
26import datetime
27import dateutil
28import email
29import logging
30import pytz
31import re
32import time
33import xmlrpclib
34
35
36class project(orm.Model):
37
38 _inherit = "project.project"
39
40 def set_draft(self, cr, uid, ids, context=None):
41 res = super(project, self).set_draft(cr, uid, ids, context=context)
42 projects = self.browse(cr, uid, ids, context=context)
43 self.message_append(cr, uid, projects, _('Draft'), context=context)
44 return res
45
46 def set_open(self, cr, uid, ids, context=None):
47 res = super(project, self).set_open(cr, uid, ids, context=context)
48 projects = self.browse(cr, uid, ids, context=context)
49 self.message_append(cr, uid, projects, _('Open'), context=context)
50 return res
51
52 def set_pending(self, cr, uid, ids, context=None):
53 res = super(project, self).set_pending(cr, uid, ids, context=context)
54 projects = self.browse(cr, uid, ids, context=context)
55 self.message_append(cr, uid, projects, _('Pending'), context=context)
56 return res
57
58 def set_done(self, cr, uid, ids, context=None):
59 res = super(project, self).set_done(cr, uid, ids, context=context)
60 projects = self.browse(cr, uid, ids, context=context)
61 self.message_append(cr, uid, projects, _('Done'), context=context)
62 return res
63
64 def set_cancel(self, cr, uid, ids, context=None):
65 res = super(project, self).set_cancel(cr, uid, ids, context=context)
66 projects = self.browse(cr, uid, ids, context=context)
67 self.message_append(cr, uid, projects, _('Cancel'), context=context)
68 return res
69
70 def message_append(self, cr, uid, threads, subject, body_text=None, email_to=False,
71 email_from=False, email_cc=None, email_bcc=None, reply_to=None,
72 email_date=None, message_id=False, references=None,
73 attachments=None, body_html=None, subtype=None, headers=None,
74 original=None, context=None):
75 """Creates a new mail.message attached to the current mail.thread,
76 containing all the details passed as parameters. All attachments
77 will be attached to the thread record as well as to the actual
78 message.
79 If only the ``threads`` and ``subject`` parameters are provided,
80 a *event log* message is created, without the usual envelope
81 attributes (sender, recipients, etc.).
82
83 :param threads: list of thread ids, or list of browse_records representing
84 threads to which a new message should be attached
85 :param subject: subject of the message, or description of the event if this
86 is an *event log* entry.
87 :param email_to: Email-To / Recipient address
88 :param email_from: Email From / Sender address if any
89 :param email_cc: Comma-Separated list of Carbon Copy Emails To addresse if any
90 :param email_bcc: Comma-Separated list of Blind Carbon Copy Emails To addresses if any
91 :param reply_to: reply_to header
92 :param email_date: email date string if different from now, in server timezone
93 :param message_id: optional email identifier
94 :param references: optional email references
95 :param body_text: plaintext contents of the mail or log message
96 :param body_html: html contents of the mail or log message
97 :param subtype: optional type of message: 'plain' or 'html', corresponding to the main
98 body contents (body_text or body_html).
99 :param headers: mail headers to store
100 :param dict attachments: map of attachment filenames to binary contents, if any.
101 :param str original: optional full source of the RFC2822 email, for reference
102 :param dict context: if a ``thread_model`` value is present
103 in the context, its value will be used
104 to determine the model of the thread to
105 update (instead of the current model).
106 """
107 if context is None:
108 context = {}
109 if attachments is None:
110 attachments = {}
111
112 if email_date:
113 edate = parsedate(email_date)
114 if edate is not None:
115 email_date = time.strftime('%Y-%m-%d %H:%M:%S', edate)
116
117 if all(isinstance(thread_id, (int, long)) for thread_id in threads):
118 model = context.get('thread_model') or self._name
119 model_pool = self.pool.get(model)
120 threads = model_pool.browse(cr, uid, threads, context=context)
121
122 ir_attachment = self.pool.get('ir.attachment')
123 mail_message = self.pool.get('mail.message')
124
125 for thread in threads:
126 to_attach = []
127 for attachment in attachments:
128 fname, fcontent = attachment
129 if isinstance(fcontent, unicode):
130 fcontent = fcontent.encode('utf-8')
131 data_attach = {
132 'name': fname,
133 'datas': base64.b64encode(str(fcontent)),
134 'datas_fname': fname,
135 'description': _('Mail attachment'),
136 'res_model': thread._name,
137 'res_id': thread.id,
138 }
139 to_attach.append(ir_attachment.create(cr, uid, data_attach, context=context))
140
141 partner_id = hasattr(thread, 'partner_id') and (thread.partner_id and thread.partner_id.id or False) or False
142 if not partner_id and thread._name == 'res.partner':
143 partner_id = thread.id
144 data = {
145 'subject': subject,
146 'user_id': uid,
147 'model' : thread._name,
148 'partner_id': partner_id,
149 'res_id': thread.id,
150 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
151 'message_id': message_id,
152 'body_text': body_text or (hasattr(thread, 'description') and thread.description or False),
153 'attachment_ids': [(6, 0, to_attach)],
154 'state' : 'received',
155 }
156
157 if email_from:
158 for param in (email_to, email_cc, email_bcc):
159 if isinstance(param, list):
160 param = ", ".join(param)
161 data = {
162 'subject': subject or _('History'),
163 'user_id': uid,
164 'model' : thread._name,
165 'res_id': thread.id,
166 'date': email_date or time.strftime('%Y-%m-%d %H:%M:%S'),
167 'body_text': body_text,
168 'email_to': email_to,
169 'email_from': email_from or \
170 (hasattr(thread, 'user_id') and thread.user_id and thread.user_id.user_email),
171 'email_cc': email_cc,
172 'email_bcc': email_bcc,
173 'partner_id': partner_id,
174 'references': references,
175 'message_id': message_id,
176 'attachment_ids': [(6, 0, to_attach)],
177 'state' : 'received',
178 'body_html': body_html,
179 'subtype': subtype,
180 'headers': headers,
181 'reply_to': reply_to,
182 'original': original,
183 }
184 mail_message.create(cr, uid, data, context=context)
185 return True
186
187 def message_append_dict(self, cr, uid, ids, msg_dict, context=None):
188 """Creates a new mail.message attached to the given threads (``ids``),
189 with the contents of ``msg_dict``, by calling ``message_append``
190 with the mail details. All attachments in msg_dict will be
191 attached to the object record as well as to the actual
192 mail message.
193
194 :param dict msg_dict: a map containing the email details and
195 attachments. See ``message_process()`` and
196 ``mail.message.parse()`` for details on
197 the dict structure.
198 :param dict context: if a ``thread_model`` value is present
199 in the context, its value will be used
200 to determine the model of the thread to
201 update (instead of the current model).
202 """
203 return self.message_append(cr, uid, ids,
204 subject = msg_dict.get('subject'),
205 body_text = msg_dict.get('body_text'),
206 email_to = msg_dict.get('to'),
207 email_from = msg_dict.get('from'),
208 email_cc = msg_dict.get('cc'),
209 email_bcc = msg_dict.get('bcc'),
210 reply_to = msg_dict.get('reply'),
211 email_date = msg_dict.get('date'),
212 message_id = msg_dict.get('message-id'),
213 references = msg_dict.get('references')\
214 or msg_dict.get('in-reply-to'),
215 attachments = msg_dict.get('attachments'),
216 body_html= msg_dict.get('body_html'),
217 subtype = msg_dict.get('subtype'),
218 headers = msg_dict.get('headers'),
219 original = msg_dict.get('original'),
220 context = context)
221
222#project()
223
0224
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,52 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import fields, orm
23
24
25class project_communications_mail(orm.Model):
26 _name = "project.project"
27 _inherit = ['mail.thread','project.project']
28
29 _columns= {
30 'message_ids': fields.one2many(
31 'mail.message', 'res_id', 'Messages',
32 domain=[('model','=',_name)], readonly=True
33 ),
34 }
35
36 def message_thread_followers(self, cr, uid, ids, context=None):
37 if not ids:
38 return {}
39 if isinstance(ids, (int, long)):
40 ids= [ids]
41
42 res = {}
43
44 for project in self.browse(cr, uid, select, context=context):
45 user_email = (project.user_id and project.user_id.address_id
46 and project.user_id.address_id.email) or False
47 if user_email:
48 res.setdefault(project.id, []).append(user_email)
49
50 return res
51
52# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
053
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,31 @@
1<?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4 <record id="edit_project" model="ir.ui.view">
5 <field name="name">project.project.form</field>
6 <field name="model">project.project</field>
7 <field name="type">form</field>
8 <field name="inherit_id" ref="project.edit_project"/>
9 <field name="arch" type="xml">
10 <!-- #Repetido en project_communications_mailgate_note_view 25/01/2013 -->
11 <xpath expr="/form/sheet/notebook/page[@string='Other Info']" position="after">
12 <page string="History">
13 <field name="message_ids" colspan="4" nolabel="1" mode="tree">
14 <tree string="History">
15 <field name="email_from" invisible="1"/>
16 </tree>
17 </field>
18 </page>
19 </xpath>
20 <xpath expr="/form/header/button[@name='set_cancel']" position="after">
21 <!-- attrs="{'invisible': [('email_from', '=', False)]}" -->
22 <button
23 string="Reply"
24 name="%(mail.action_email_compose_message_wizard)d"
25 context="{'mail.compose.message.mode':'reply', 'message_id':active_id}"
26 icon="terp-mail-replied" type="action" />
27 </xpath>
28 </field>
29 </record>
30 </data>
31</openerp>
0\ No newline at end of file32\ No newline at end of file
133
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,28 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# project_mailgate_note module for OpenERP, Add buttons to add notes and send mail into history tab
5# Copyright (C) 2011 SYLEAM Info Services (<http://www.Syleam.fr/>)
6# Sylvain Garancher <sylvain.garancher@syleam.fr>
7#
8# This file is a part of project_mailgate_note
9#
10# project_mailgate_note is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# project_mailgate_note is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Affero General Public License for more details.
19#
20# You should have received a copy of the GNU Affero General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22#
23##############################################################################
24
25
26import wizard
27
28# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
029
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,57 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22
23{
24 'name': 'Project Mailgate Note for Projects',
25 'version': '1.0',
26 'category': 'Generic Modules/Projects & Services',
27 'description': """This module allows to add a note or send an email from the history tab in the project form view.""",
28 "author": "Eficent, Nervia Consultores",
29 "website": "",
30 'depends': [
31 'base',
32 'crm',
33 'project_communications_mailgate',
34 ],
35 'init_xml': [],
36 'images': [
37 'images/accueil.png',
38 'images/send_mail.png',
39 'images/history.png',
40 ],
41 'update_xml': [
42 #'security/ir.model.access.csv',
43 #'wizard/wizard.xml',
44 'wizard/project_communications_add_note_view.xml',
45 'wizard/project_communications_send_email_view.xml',
46 'project_communications_mailgate_note_view.xml',
47 ],
48 'demo_xml': [],
49 'test': [],
50 #'external_dependancies': {'python': ['kombu'], 'bin': ['which']},
51 #SIN ADAPTAR
52 'installable': False,
53 'active': False,
54 'license': 'AGPL-3',
55}
56
57# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
058
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,286 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_communications_mailgate_note
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-09-03 11:48+0000\n"
10"PO-Revision-Date: 2011-09-03 20:03+0100\n"
11"Last-Translator: Jordi Ballester Alomar (Avangard Enterprise Information Systems) <jordi.ballester@avangard-eis.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: project_communications_mailgate_note
19#: selection:project.add.note,state:0
20#: selection:project.send.mail,state:0
21msgid "In Progress"
22msgstr "En curso"
23
24#. module: project_communications_mailgate_note
25#: help:project.send.mail,email_cc:0
26msgid "These addresses will receive a copy of this email. To modify the permanent CC list, edit the global CC field of this case"
27msgstr "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"
28
29#. module: project_communications_mailgate_note
30#: field:project.send.mail,email_from:0
31msgid "From"
32msgstr "De"
33
34#. module: project_communications_mailgate_note
35#: view:project.project:0
36msgid "History Information"
37msgstr "Información de la Historia"
38
39#. module: project_communications_mailgate_note
40#: help:project.send.mail,html:0
41msgid "Select this if you want to send email with HTML formatting."
42msgstr "Seleccione esta opción si desea enviar correo electrónico con formato HTML."
43
44#. module: project_communications_mailgate_note
45#: field:project.send.mail.attachment,wizard_id:0
46msgid "Wizard"
47msgstr "Asistente"
48
49#. module: project_communications_mailgate_note
50#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:38
51#: view:project.add.note:0
52#, python-format
53msgid "Note"
54msgstr "Nota"
55
56#. module: project_communications_mailgate_note
57#: field:project.send.mail,email_to:0
58msgid "To"
59msgstr "Para"
60
61#. module: project_communications_mailgate_note
62#: view:project.project:0
63msgid "Send New Email"
64msgstr "Enviar nuevo mensaje"
65
66#. module: project_communications_mailgate_note
67#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_add_note
68#: view:project.add.note:0
69msgid "Add Note"
70msgstr "Añadir nota"
71
72#. module: project_communications_mailgate_note
73#: selection:project.add.note,state:0
74#: selection:project.send.mail,state:0
75msgid "Draft"
76msgstr "Borrador"
77
78#. module: project_communications_mailgate_note
79#: view:project.add.note:0
80#: view:project.send.mail:0
81#: field:project.send.mail.attachment,binary:0
82msgid "Attachment"
83msgstr "Fichero adjunto"
84
85#. module: project_communications_mailgate_note
86#: view:project.project:0
87msgid "Reply"
88msgstr "Respuesta"
89
90#. module: project_communications_mailgate_note
91#: field:project.send.mail,html:0
92msgid "HTML formatting?"
93msgstr "Formato HTML?"
94
95#. module: project_communications_mailgate_note
96#: selection:project.add.note,state:0
97#: selection:project.send.mail,state:0
98msgid "Pending"
99msgstr "Pendiente"
100
101#. module: project_communications_mailgate_note
102#: view:project.send.mail:0
103msgid " "
104msgstr " "
105
106#. module: project_communications_mailgate_note
107#: field:project.add.note,attachment_ids:0
108#: field:project.send.mail,attachment_ids:0
109msgid "unknown"
110msgstr "desconocido"
111
112#. module: project_communications_mailgate_note
113#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:24
114#, python-format
115msgid "Can not add note!"
116msgstr "No se puede agregar la nota!"
117
118#. module: project_communications_mailgate_note
119#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_reply_mail
120#: view:project.send.mail:0
121msgid "Reply to last Mail"
122msgstr "Responder al último e-mail"
123
124#. module: project_communications_mailgate_note
125#: model:ir.module.module,description:project_communications_mailgate_note.module_meta_information
126msgid "This module allows to add a note or send an email from the history tab in the task form view."
127msgstr "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."
128
129#. module: project_communications_mailgate_note
130#: help:project.send.mail,reply_to:0
131msgid "Reply-to of the Sales team defined on this case"
132msgstr "Responder al equipo de ventas que se define en este caso"
133
134#. module: project_communications_mailgate_note
135#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:143
136#, python-format
137msgid "Unable to send mail. Please check SMTP is configured properly."
138msgstr "No se puede enviar por correo. Por favor, compruebe que el SMTP está configurado correctamente."
139
140#. module: project_communications_mailgate_note
141#: field:project.send.mail,subject:0
142msgid "Subject"
143msgstr "Asunto"
144
145#. module: project_communications_mailgate_note
146#: model:ir.model,name:project_communications_mailgate_note.model_project_add_note
147#: view:project.project:0
148msgid "Add Internal Note"
149msgstr "Añadir nota interna"
150
151#. module: project_communications_mailgate_note
152#: field:project.send.mail.attachment,name:0
153msgid "Name"
154msgstr "Nombre"
155
156#. module: project_communications_mailgate_note
157#: field:project.send.mail,email_cc:0
158msgid "CC"
159msgstr "CC"
160
161#. module: project_communications_mailgate_note
162#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_send_mail
163#: view:project.send.mail:0
164msgid "Send Mail"
165msgstr "Enviar correo"
166
167#. module: project_communications_mailgate_note
168#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:143
169#, python-format
170msgid "Error!"
171msgstr "Error!"
172
173#. module: project_communications_mailgate_note
174#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:24
175#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:74
176#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:169
177#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:288
178#, python-format
179msgid "Error"
180msgstr "Error"
181
182#. module: project_communications_mailgate_note
183#: selection:project.add.note,state:0
184#: selection:project.send.mail,state:0
185msgid "Cancelled"
186msgstr "Cancelado"
187
188#. module: project_communications_mailgate_note
189#: field:project.add.note,body:0
190msgid "Note Body"
191msgstr "Cuerpo de la Nota"
192
193#. module: project_communications_mailgate_note
194#: view:project.send.mail:0
195msgid "_Send Reply"
196msgstr "_Enviar Respuesta"
197
198#. module: project_communications_mailgate_note
199#: model:ir.module.module,shortdesc:project_communications_mailgate_note.module_meta_information
200msgid "Project Mailgate Note for Projects"
201msgstr "Project Mailgate Note for Projects"
202
203#. module: project_communications_mailgate_note
204#: view:project.project:0
205msgid "History"
206msgstr "Historia"
207
208#. module: project_communications_mailgate_note
209#: view:project.add.note:0
210#: view:project.project:0
211#: view:project.send.mail:0
212msgid "Attachments"
213msgstr "Ficheros Adjuntos"
214
215#. module: project_communications_mailgate_note
216#: model:ir.model,name:project_communications_mailgate_note.model_project_send_mail_attachment
217msgid "project.send.mail.attachment"
218msgstr "project.send.mail.attachment"
219
220#. module: project_communications_mailgate_note
221#: view:project.send.mail:0
222msgid "_Send"
223msgstr "_Enviar"
224
225#. module: project_communications_mailgate_note
226#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:74
227#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:169
228#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:288
229#, python-format
230msgid "Can not send mail!"
231msgstr "No se puede enviar el correo!"
232
233#. module: project_communications_mailgate_note
234#: selection:project.add.note,state:0
235#: selection:project.send.mail,state:0
236msgid "Unchanged"
237msgstr "Sin cambios"
238
239#. module: project_communications_mailgate_note
240#: field:project.send.mail,body:0
241msgid "Message Body"
242msgstr "Cuerpo del Mensaje"
243
244#. module: project_communications_mailgate_note
245#: model:ir.model,name:project_communications_mailgate_note.model_project_send_mail
246msgid "Send new email"
247msgstr "Enviar nuevo email"
248
249#. module: project_communications_mailgate_note
250#: view:project.add.note:0
251msgid "_Add"
252msgstr "_Añadir"
253
254#. module: project_communications_mailgate_note
255#: field:project.add.note,state:0
256#: field:project.send.mail,state:0
257msgid "Set New State To"
258msgstr "Fijar Nuevo Estado A"
259
260#. module: project_communications_mailgate_note
261#: view:project.add.note:0
262#: view:project.send.mail:0
263msgid "_Cancel"
264msgstr "_Cancelar"
265
266#. module: project_communications_mailgate_note
267#: selection:project.add.note,state:0
268#: selection:project.send.mail,state:0
269msgid "Close"
270msgstr "Cerrar"
271
272#. module: project_communications_mailgate_note
273#: view:project.send.mail:0
274msgid "Message"
275msgstr "Mensaje"
276
277#. module: project_communications_mailgate_note
278#: field:project.send.mail,reply_to:0
279msgid "Reply To"
280msgstr "Responder A"
281
282#. module: project_communications_mailgate_note
283#: view:project.project:0
284msgid "Details"
285msgstr "Detalles"
286
0287
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,286 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_communications_mailgate_note
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-09-03 11:48+0000\n"
10"PO-Revision-Date: 2011-09-03 11:48+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: project_communications_mailgate_note
19#: selection:project.add.note,state:0
20#: selection:project.send.mail,state:0
21msgid "In Progress"
22msgstr ""
23
24#. module: project_communications_mailgate_note
25#: help:project.send.mail,email_cc:0
26msgid "These addresses will receive a copy of this email. To modify the permanent CC list, edit the global CC field of this case"
27msgstr ""
28
29#. module: project_communications_mailgate_note
30#: field:project.send.mail,email_from:0
31msgid "From"
32msgstr ""
33
34#. module: project_communications_mailgate_note
35#: view:project.project:0
36msgid "History Information"
37msgstr ""
38
39#. module: project_communications_mailgate_note
40#: help:project.send.mail,html:0
41msgid "Select this if you want to send email with HTML formatting."
42msgstr ""
43
44#. module: project_communications_mailgate_note
45#: field:project.send.mail.attachment,wizard_id:0
46msgid "Wizard"
47msgstr ""
48
49#. module: project_communications_mailgate_note
50#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:38
51#: view:project.add.note:0
52#, python-format
53msgid "Note"
54msgstr ""
55
56#. module: project_communications_mailgate_note
57#: field:project.send.mail,email_to:0
58msgid "To"
59msgstr ""
60
61#. module: project_communications_mailgate_note
62#: view:project.project:0
63msgid "Send New Email"
64msgstr ""
65
66#. module: project_communications_mailgate_note
67#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_add_note
68#: view:project.add.note:0
69msgid "Add Note"
70msgstr ""
71
72#. module: project_communications_mailgate_note
73#: selection:project.add.note,state:0
74#: selection:project.send.mail,state:0
75msgid "Draft"
76msgstr ""
77
78#. module: project_communications_mailgate_note
79#: view:project.add.note:0
80#: view:project.send.mail:0
81#: field:project.send.mail.attachment,binary:0
82msgid "Attachment"
83msgstr ""
84
85#. module: project_communications_mailgate_note
86#: view:project.project:0
87msgid "Reply"
88msgstr ""
89
90#. module: project_communications_mailgate_note
91#: field:project.send.mail,html:0
92msgid "HTML formatting?"
93msgstr ""
94
95#. module: project_communications_mailgate_note
96#: selection:project.add.note,state:0
97#: selection:project.send.mail,state:0
98msgid "Pending"
99msgstr ""
100
101#. module: project_communications_mailgate_note
102#: view:project.send.mail:0
103msgid " "
104msgstr ""
105
106#. module: project_communications_mailgate_note
107#: field:project.add.note,attachment_ids:0
108#: field:project.send.mail,attachment_ids:0
109msgid "unknown"
110msgstr ""
111
112#. module: project_communications_mailgate_note
113#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:24
114#, python-format
115msgid "Can not add note!"
116msgstr ""
117
118#. module: project_communications_mailgate_note
119#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_reply_mail
120#: view:project.send.mail:0
121msgid "Reply to last Mail"
122msgstr ""
123
124#. module: project_communications_mailgate_note
125#: model:ir.module.module,description:project_communications_mailgate_note.module_meta_information
126msgid "This module allows to add a note or send an email from the history tab in the task form view."
127msgstr ""
128
129#. module: project_communications_mailgate_note
130#: help:project.send.mail,reply_to:0
131msgid "Reply-to of the Sales team defined on this case"
132msgstr ""
133
134#. module: project_communications_mailgate_note
135#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:143
136#, python-format
137msgid "Unable to send mail. Please check SMTP is configured properly."
138msgstr ""
139
140#. module: project_communications_mailgate_note
141#: field:project.send.mail,subject:0
142msgid "Subject"
143msgstr ""
144
145#. module: project_communications_mailgate_note
146#: model:ir.model,name:project_communications_mailgate_note.model_project_add_note
147#: view:project.project:0
148msgid "Add Internal Note"
149msgstr ""
150
151#. module: project_communications_mailgate_note
152#: field:project.send.mail.attachment,name:0
153msgid "Name"
154msgstr ""
155
156#. module: project_communications_mailgate_note
157#: field:project.send.mail,email_cc:0
158msgid "CC"
159msgstr ""
160
161#. module: project_communications_mailgate_note
162#: model:ir.actions.act_window,name:project_communications_mailgate_note.action_project_send_mail
163#: view:project.send.mail:0
164msgid "Send Mail"
165msgstr ""
166
167#. module: project_communications_mailgate_note
168#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:143
169#, python-format
170msgid "Error!"
171msgstr ""
172
173#. module: project_communications_mailgate_note
174#: code:addons/project_communications_mailgate_note/wizard/project_communications_add_note.py:24
175#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:74
176#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:169
177#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:288
178#, python-format
179msgid "Error"
180msgstr ""
181
182#. module: project_communications_mailgate_note
183#: selection:project.add.note,state:0
184#: selection:project.send.mail,state:0
185msgid "Cancelled"
186msgstr ""
187
188#. module: project_communications_mailgate_note
189#: field:project.add.note,body:0
190msgid "Note Body"
191msgstr ""
192
193#. module: project_communications_mailgate_note
194#: view:project.send.mail:0
195msgid "_Send Reply"
196msgstr ""
197
198#. module: project_communications_mailgate_note
199#: model:ir.module.module,shortdesc:project_communications_mailgate_note.module_meta_information
200msgid "Project Mailgate Note for Projects"
201msgstr ""
202
203#. module: project_communications_mailgate_note
204#: view:project.project:0
205msgid "History"
206msgstr ""
207
208#. module: project_communications_mailgate_note
209#: view:project.add.note:0
210#: view:project.project:0
211#: view:project.send.mail:0
212msgid "Attachments"
213msgstr ""
214
215#. module: project_communications_mailgate_note
216#: model:ir.model,name:project_communications_mailgate_note.model_project_send_mail_attachment
217msgid "project.send.mail.attachment"
218msgstr ""
219
220#. module: project_communications_mailgate_note
221#: view:project.send.mail:0
222msgid "_Send"
223msgstr ""
224
225#. module: project_communications_mailgate_note
226#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:74
227#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:169
228#: code:addons/project_communications_mailgate_note/wizard/project_communications_send_email.py:288
229#, python-format
230msgid "Can not send mail!"
231msgstr ""
232
233#. module: project_communications_mailgate_note
234#: selection:project.add.note,state:0
235#: selection:project.send.mail,state:0
236msgid "Unchanged"
237msgstr ""
238
239#. module: project_communications_mailgate_note
240#: field:project.send.mail,body:0
241msgid "Message Body"
242msgstr ""
243
244#. module: project_communications_mailgate_note
245#: model:ir.model,name:project_communications_mailgate_note.model_project_send_mail
246msgid "Send new email"
247msgstr ""
248
249#. module: project_communications_mailgate_note
250#: view:project.add.note:0
251msgid "_Add"
252msgstr ""
253
254#. module: project_communications_mailgate_note
255#: field:project.add.note,state:0
256#: field:project.send.mail,state:0
257msgid "Set New State To"
258msgstr ""
259
260#. module: project_communications_mailgate_note
261#: view:project.add.note:0
262#: view:project.send.mail:0
263msgid "_Cancel"
264msgstr ""
265
266#. module: project_communications_mailgate_note
267#: selection:project.add.note,state:0
268#: selection:project.send.mail,state:0
269msgid "Close"
270msgstr ""
271
272#. module: project_communications_mailgate_note
273#: view:project.send.mail:0
274msgid "Message"
275msgstr ""
276
277#. module: project_communications_mailgate_note
278#: field:project.send.mail,reply_to:0
279msgid "Reply To"
280msgstr ""
281
282#. module: project_communications_mailgate_note
283#: view:project.project:0
284msgid "Details"
285msgstr ""
286
0287
=== added directory 'project_communications_mailgate_note/images'
=== added file 'project_communications_mailgate_note/images/accueil.png'
1Binary files project_communications_mailgate_note/images/accueil.png 1970-01-01 00:00:00 +0000 and project_communications_mailgate_note/images/accueil.png 2013-02-19 14:36:22 +0000 differ288Binary files project_communications_mailgate_note/images/accueil.png 1970-01-01 00:00:00 +0000 and project_communications_mailgate_note/images/accueil.png 2013-02-19 14:36:22 +0000 differ
=== added file 'project_communications_mailgate_note/images/history.png'
2Binary files project_communications_mailgate_note/images/history.png 1970-01-01 00:00:00 +0000 and project_communications_mailgate_note/images/history.png 2013-02-19 14:36:22 +0000 differ289Binary files project_communications_mailgate_note/images/history.png 1970-01-01 00:00:00 +0000 and project_communications_mailgate_note/images/history.png 2013-02-19 14:36:22 +0000 differ
=== added file 'project_communications_mailgate_note/images/send_mail.png'
3Binary 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-02-19 14:36:22 +0000 differ290Binary 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-02-19 14:36:22 +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-02-19 14:36:22 +0000
@@ -0,0 +1,37 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4
5 <record id="view_project_mailgate_form2" model="ir.ui.view">
6 <field name="name">project.mailgate.form</field>
7 <field name="model">project.project</field>
8 <field name="type">form</field>
9 <field eval="40" name="priority"/>
10 <field name="inherit_id" ref="project.edit_project"/>
11 <field name="arch" type="xml">
12 <xpath expr="/form/sheet/notebook/page[@string='Other Info']" position="replace">
13 <page string="History">
14 <field name="message_ids" colspan="4" nolabel="1" mode="tree">
15 <tree string="History">
16 <field name="email_from" invisible="1"/>
17 <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
18 </tree>
19 </field>
20 </page>
21 </xpath>
22 <xpath expr="/form/header/button[@name='set_cancel']" position="after">
23 <button string="Add Internal Note"
24 name="%(action_project_add_note)d"
25 context="{'model': 'project.project' }"
26 icon="terp-document-new" type="action" />
27 <button string="Send New Email"
28 name="%(mail.action_email_compose_message_wizard)d"
29 context="{'default_composition_mode':'new', 'default_parent_id': active_id}"
30 states='received,sent,exception,cancel'
31 type="action" icon="terp-mail-replied"/>
32 </xpath>
33 </field>
34 </record>
35
36 </data>
37</openerp>
038
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,1 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
02
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,29 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# project_mailgate_note module for OpenERP, Add buttons to add notes and send mail into history tab
5# Copyright (C) 2011 SYLEAM Info Services (<http://www.Syleam.fr/>)
6# Sylvain Garancher <sylvain.garancher@syleam.fr>
7#
8# This file is a part of project_mailgate_note
9#
10# project_mailgate_note is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# project_mailgate_note is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Affero General Public License for more details.
19#
20# You should have received a copy of the GNU Affero General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22#
23##############################################################################
24
25
26import project_communications_add_note
27import project_communications_send_email
28
29# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
030
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,59 @@
1from osv import fields, osv
2from tools.translate import _
3import base64
4
5AVAILABLE_STATES = [('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('close', 'Close'), ('unchanged', 'Unchanged')]
6
7class project_add_note(osv.osv_memory):
8 """Adds a new note to the case."""
9 _name = 'project.add.note'
10 _description = "Add Internal Note"
11
12 _columns = {
13 'body': fields.text('Note Body', required=True),
14 'state': fields.selection(AVAILABLE_STATES, string='Set New State To',
15 required=True),
16 'attachment_ids' : fields.one2many('project.send.mail.attachment', 'wizard_id'),
17 }
18
19 def action_add(self, cr, uid, ids, context=None):
20 if context is None:
21 context = {}
22
23 if not context.get('active_model'):
24 raise osv.except_osv(_('Error'), _('Can not add note!'))
25
26 model = context.get('active_model')
27 case_pool = self.pool.get(model)
28
29 for obj in self.browse(cr, uid, ids, context=context):
30 case_list = case_pool.browse(cr, uid, context['active_ids'],
31 context=context)
32 case = case_list[0]
33 user_obj = self.pool.get('res.users')
34 user_name = user_obj.browse(cr, uid, [uid], context=context)[0].name
35 attach = [
36 (x.name, base64.decodestring(x.binary)) for x in obj.attachment_ids
37 ]
38# case_pool.history(cr, uid, [case], _("Note"), history=False,
39# details=obj.body, email_from=user_name, attach=attach)
40
41 if obj.state == 'unchanged':
42 pass
43 elif obj.state == 'close':
44 case_pool.do_close(cr, uid, [case.id])
45 elif obj.state in ['draft', 'cancel', 'open', 'pending']:
46 act = 'do_' + obj.state
47 getattr(case_pool, act)(cr, uid, [case.id])
48
49 return {'type': 'ir.actions.act_window_close'}
50
51 def default_get(self, cr, uid, fields, context=None):
52 """
53 This function gets default values
54 """
55 return {'state': u'unchanged'}
56
57
58project_add_note()
59
060
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,54 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4
5<!-- Add New Note view -->
6
7 <record model="ir.ui.view" id="project_add_new_note_view">
8 <field name="name">project.new.add.note.form</field>
9 <field name="model">project.add.note</field>
10 <field name="type">form</field>
11 <field name="arch" type="xml">
12 <form string="Add Note" col="4">
13 <separator string="Add Note" colspan="6"/>
14 <notebook colspan="6">
15 <page string="Note">
16 <field name="body" nolabel="1" colspan="4" default_focus="1"/>
17 </page>
18 <page string="Attachments">
19 <field name="attachment_ids" colspan="4" nolabel="1">
20 <form string="Attachment">
21 <field name="binary" filename="name" />
22 <field name="name" />
23 </form>
24 <tree string="Attachments">
25 <field name="name" />
26 </tree>
27 </field>
28 </page>
29 </notebook>
30 <separator string="" colspan="6"/>
31 <group colspan="6" col="4" >
32 <field name="state" />
33 <button string="_Cancel" icon="gtk-cancel" special="cancel" />
34 <button name="action_add" type="object" string="_Add" icon="gtk-ok" />
35 </group>
36 </form>
37 </field>
38 </record>
39
40<!-- Add New Note action -->
41
42 <record model="ir.actions.act_window" id="action_project_add_note">
43 <field name="name">Add Note</field>
44 <field name="res_model">project.add.note</field>
45 <field name="domain">[('state','=','unchanged')]</field>
46 <field name="view_type">form</field>
47 <field name="view_mode">form</field>
48 <field name="view_id" ref="project_add_new_note_view"/>
49 <field name="target">new</field>
50 </record>
51
52 </data>
53</openerp>
54
055
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,292 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6# $Id$
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import osv, fields
24from tools.translate import _
25import base64
26import itertools
27import tools
28import re
29
30
31AVAILABLE_STATES = [('unchanged', 'Unchanged'),('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('close', 'Close')]
32
33
34class project_send_new_email_attachment(osv.osv_memory):
35 _name = 'project.send.mail.attachment'
36
37 _columns = {
38 'binary' : fields.binary('Attachment', required=True),
39 'name' : fields.char('Name', size=128, required=True),
40 'wizard_id' : fields.many2one('project.send.mail', 'Wizard', required=True),
41 }
42
43
44
45project_send_new_email_attachment()
46
47class project_send_new_email(osv.osv_memory):
48 """ Sends new email for the case"""
49 _name = "project.send.mail"
50 _description = "Send new email"
51
52 _columns = {
53 'email_to' : fields.char('To', size=512, required=True),
54 'email_from' : fields.char('From', size=128, required=True),
55 'reply_to' : fields.char('Reply To', size=128, required=True, help="Reply-to of the Sales team defined on this case"),
56 '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"),
57 'subject': fields.char('Subject', size=512, required=True),
58 'body': fields.text('Message Body', required=True),
59 'state': fields.selection(AVAILABLE_STATES, string='Set New State To', required=True),
60 'attachment_ids' : fields.one2many('project.send.mail.attachment', 'wizard_id'),
61 'html': fields.boolean('HTML formatting?', help="Select this if you want to send email with HTML formatting."),
62 }
63
64
65 def action_send(self, cr, uid, ids, context=None):
66 """ This sends an email to ALL the addresses of the selected partners.
67 """
68 hist_obj = self.pool.get('mailgate.message')
69
70 if context is None:
71 context = {}
72
73 if not context.get('active_model'):
74 raise osv.except_osv(_('Error'), _('Can not send mail!'))
75
76 model = context.get('active_model')
77 case_pool = self.pool.get(model)
78 res_id = context and context.get('active_id', False) or False
79
80 for obj in self.browse(cr, uid, ids, context=context):
81 attach = [
82 (x.name, base64.decodestring(x.binary)) for x in obj.attachment_ids
83 ]
84
85 subtype = 'plain'
86 message_id = None
87 ref_id = None
88
89 case = case_pool.browse(cr, uid, res_id, context=context)
90 if context.get('mail', 'new') == 'new':
91 if case.message_ids:
92 message_id = case.message_ids[0].message_id
93 elif context.get('mail') == 'forward':
94 # extract attachements from case and emails according to mode
95 attachments = []
96 attach_pool = self.pool.get('ir.attachment')
97 direct_attachments = attach_pool.search(cr, uid, [('res_model', '=', 'crm.lead'), ('res_id', '=', res_id)], context=context)
98 attachments += attach_pool.browse(cr, uid, direct_attachments, context=context)
99 if obj.history in ['latest', 'whole'] and case.message_ids:
100 msgs = case.message_ids
101 if obj.history == 'latest':
102 msgs = msgs[:1]
103 attachments.extend(itertools.chain(*[m.attachment_ids for m in msgs]))
104 attach_all = [(a.datas_fname or a.name, base64.decodestring(a.datas)) for a in attachments if a.datas]
105 attach += attach_all
106
107 else:
108 hist = hist_obj.browse(cr, uid, res_id, context=context)
109 message_id = hist.message_id
110 model = hist.model
111 case_pool = self.pool.get(model)
112 res_id = hist.res_id
113 ref_id = hist.ref_id
114 case = case_pool.browse(cr, uid, res_id, context=context)
115 emails = re.findall(r'([^ ,<@]+@[^> ,]+)', obj.email_to or '')
116 email_cc = re.findall(r'([^ ,<@]+@[^> ,]+)', obj.email_cc or '')
117 emails = filter(None, emails)
118 body = obj.body
119
120 body = body and tools.ustr(body) or ''
121 email_from = getattr(obj, 'email_from', False)
122 x_headers = {}
123 if message_id:
124 x_headers['References'] = "%s" % (message_id)
125
126 if obj.html:
127 subtype = 'html'
128
129 flag = tools.email_send(
130 email_from,
131 emails,
132 obj.subject,
133 body,
134 email_cc=email_cc,
135 attach=attach,
136 subtype=subtype,
137 reply_to=obj.reply_to,
138 openobject_id=str(case.id),
139 x_headers=x_headers
140 )
141
142 if not flag:
143 raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))
144
145 msg_dict = {'new': 'Send', 'reply': 'Reply', 'forward': 'Forward'}
146 case_pool.history(cr, uid, [case], _(msg_dict[context.get('mail', 'new')]), history=True, \
147 email=obj.email_to, details=body, \
148 subject=obj.subject, email_from=email_from, \
149 email_cc=', '.join(email_cc), message_id=message_id, \
150 references=ref_id or message_id, attach=attach)
151 if obj.state == 'unchanged':
152 pass
153 elif obj.state == 'done':
154 case_pool.do_close(cr, uid, [case.id])
155 elif obj.state in ['draft', 'cancel', 'open', 'pending']:
156 act = 'do_' + obj.state
157 getattr(case_pool, act)(cr, uid, [case.id])
158
159 return {'type': 'ir.actions.act_window_close'}
160
161 def default_get(self, cr, uid, fields, context=None):
162 """
163 This function gets default values
164 """
165 if context is None:
166 context = {}
167
168 if not context.get('active_model'):
169 raise osv.except_osv(_('Error'), _('Can not send mail!'))
170
171 res = super(project_send_new_email, self).default_get(cr, uid, fields, context=context)
172
173 if context.get('mail') == 'reply':
174 res.update(self.get_reply_defaults(cr, uid, fields, context=context))
175 return res
176
177 model = context.get('active_model')
178 mod_obj = self.pool.get(model)
179 res_id = context and context.get('active_ids', []) or []
180
181 user_obj = self.pool.get('res.users')
182 user_mail_from = user_obj._get_email_from(cr, uid, [uid], context=context)[uid]
183
184
185 for case in mod_obj.browse(cr, uid, res_id, context=context):
186 if 'email_to' in fields:
187 user_mail_to = ''
188 if case.members:
189 for member in case.members:
190 if not user_mail_to :
191 user_mail_to = user_obj._get_email_from(cr, uid, [member.id], context=context)[member.id]
192 else:
193 user_mail_to += ', ' + user_obj._get_email_from(cr, uid, [member.id], context=context)[member.id]
194 res.update({'email_to': user_mail_to and tools.ustr(user_mail_to) or ''})
195 if 'email_from' in fields:
196 res.update({'email_from': user_mail_from and tools.ustr(user_mail_from) or ''})
197 if 'subject' in fields:
198 if case:
199 subject = '[' + case.complete_name + '] '
200 else:
201 subject = case.name
202 res.update({'subject': tools.ustr(context.get('subject', subject) or '')})
203 if 'email_cc' in fields:
204 user_mail_cc = ''
205 if case:
206 user_mail_cc = user_obj._get_email_from(cr, uid, [case.user_id.id], context=context)[case.user_id.id]
207 res.update({'email_cc': user_mail_cc and tools.ustr(user_mail_cc) or ''})
208 if 'body' in fields:
209 res.update({'body': u'\n'+(tools.ustr(case.user_id.signature or ''))})
210 if 'state' in fields:
211 res.update({'state': u'pending'})
212
213 return res
214
215 def get_reply_defaults(self, cr, uid, fields, context=None):
216 """
217 This function gets default values for reply mail
218 """
219 hist_obj = self.pool.get('mailgate.message')
220 res_ids = context and context.get('active_ids', []) or []
221
222 user_obj = self.pool.get('res.users')
223 user_mail_from = user_obj._get_email_from(cr, uid, [uid], context=context)[uid]
224
225 include_original = context and context.get('include_original', False) or False
226 res = {}
227 for hist in hist_obj.browse(cr, uid, res_ids, context=context):
228 model = hist.model
229
230 # In the case where the project does not exist in the database
231 if not model:
232 return {'type': 'ir.actions.act_window_close'}
233
234 model_pool = self.pool.get(model)
235 res_id = hist.res_id
236 case = model_pool.browse(cr, uid, res_id)
237 if 'email_to' in fields:
238 user_mail_to = ''
239 if case and case.members:
240 for member in case.members:
241 if not user_mail_to :
242 user_mail_to = user_obj._get_email_from(cr, uid, [member.id], context=context)[member.id]
243 else:
244 user_mail_to += ', ' + user_obj._get_email_from(cr, uid, [member.id], context=context)[member.id]
245 res.update({'email_to': user_mail_to and tools.ustr(user_mail_to) or ''})
246 if 'email_from' in fields:
247 res.update({'email_from': user_mail_from and tools.ustr(user_mail_from) or False})
248
249 signature = u'\n' + (tools.ustr(case.user_id.signature or '')) + u'\n'
250 original = [signature]
251
252 if include_original == True and 'body' in fields:
253 header = u'-------- Original Message --------'
254 sender = u'From: %s' %(tools.ustr(hist.email_from or ''))
255 to = u'To: %s' % (tools.ustr(hist.email_to or ''))
256 sentdate = u'Date: %s' % (tools.ustr(hist.date))
257 desc = u'\n%s'%(tools.ustr(hist.description))
258
259 original = [signature, header, sender, to, sentdate, desc]
260
261 res['body']= u'\n' + u'\n'.join(original)
262
263 if 'subject' in fields:
264 res.update({u'subject': u'Re: %s' %(tools.ustr(hist.name or ''))})
265 if 'email_cc' in fields:
266 user_mail_cc = ''
267 if case:
268 user_mail_cc = user_obj._get_email_from(cr, uid, [case.user_id.id], context=context)[case.user_id.id]
269 res.update({'email_cc': user_mail_cc and tools.ustr(user_mail_cc) or ''})
270 if 'state' in fields:
271 res['state'] = u'pending'
272 return res
273
274 def view_init(self, cr, uid, fields_list, context=None):
275 """
276 This function checks for precondition before wizard executes
277 @param self: The object pointer
278 @param cr: the current row, from the database cursor,
279 @param uid: the current user’s ID for security checks,
280 @param fields: List of fields for default value
281 @param context: A standard dictionary for contextual values
282
283 """
284 if context is None:
285 context = {}
286
287 if not context.get('active_model'):
288 raise osv.except_osv(_('Error'), _('Can not send mail!'))
289 return True
290
291project_send_new_email()
292
0293
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,105 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4
5<!-- Send New Mail view -->
6
7 <record model="ir.ui.view" id="project_send_new_mail_view">
8 <field name="name">project.new.send.mail.form</field>
9 <field name="model">project.send.mail</field>
10 <field name="type">form</field>
11 <field name="arch" type="xml">
12 <form string="Send Mail" col="4">
13 <group colspan="4" col="2">
14 <field name="email_from"/>
15 <field name="reply_to"/>
16 <field name="email_to" />
17 <field name="email_cc"/>
18 <field name="subject"/>
19 <field name="html"/>
20 </group>
21 <notebook colspan="6">
22 <page string="Message">
23 <field name="body" nolabel="1" colspan="4" default_focus="1"/>
24 </page>
25 <page string="Attachments">
26 <field name="attachment_ids" colspan="4" nolabel="1">
27 <form string="Attachment">
28 <field name="binary" filename="name" />
29 <field name="name" />
30 </form>
31 <tree string="Attachments">
32 <field name="name" />
33 </tree>
34 </field>
35 </page>
36 </notebook>
37 <separator string="" colspan="6"/>
38 <group colspan="6" col="4" >
39 <field name="state" />
40 <button string="_Cancel" icon="gtk-cancel" special="cancel" />
41 <button name="action_send" type="object" string="_Send" icon="gtk-go-forward" />
42 </group>
43 </form>
44 </field>
45 </record>
46
47<!-- Send New Mail action -->
48
49 <record model="ir.actions.act_window" id="action_project_send_mail">
50 <field name="name">Send Mail</field>
51 <field name="res_model">project.send.mail</field>
52 <field name="domain">[('state','=','unchanged')]</field>
53 <field name="view_type">form</field>
54 <field name="view_mode">form</field>
55 <field name="view_id" ref="project_send_new_mail_view"/>
56 <field name="target">new</field>
57 </record>
58
59
60 <!-- Reply to Mail view -->
61
62 <record model="ir.ui.view" id="project_reply_mail_view">
63 <field name="name">project.mail.reply.form</field>
64 <field name="model">project.send.mail</field>
65 <field name="type">form</field>
66 <field name="arch" type="xml">
67 <form string="Reply to last Mail" col="2">
68 <field name="email_from" />
69 <field name="email_to" />
70 <field name="email_cc" />
71 <field name="subject" />
72 <field name="attachment_ids" colspan="4" nolabel="1">
73 <form string="Attachment">
74 <field name="binary" filename="name" />
75 <field name="name" />
76 </form>
77 <tree string="Attachments">
78 <field name="name" />
79 </tree>
80 </field>
81 <separator string="" colspan="4"/>
82 <field name="body" nolabel="1" colspan="4"/>
83 <separator string=" " colspan="4"/>
84 <group colspan="4" col="3" >
85 <label string=" " />
86 <button string="_Cancel" icon="gtk-cancel" special="cancel" />
87 <button name="action_send" type="object" string="_Send Reply" icon="gtk-go-forward" />
88 </group>
89 </form>
90 </field>
91 </record>
92
93<!-- Reply to Mail action -->
94
95 <record model="ir.actions.act_window" id="action_project_reply_mail">
96 <field name="name">Reply to last Mail</field>
97 <field name="res_model">project.send.mail</field>
98 <field name="view_type">form</field>
99 <field name="view_mode">form</field>
100 <field name="view_id" ref="project_reply_mail_view"/>
101 <field name="target">new</field>
102 </record>
103
104 </data>
105</openerp>
0106
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,29 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4##############################################################################
5#
6# project_mailgate_note module for OpenERP, Add buttons to add notes and send mail into history tab
7# Copyright (C) 2011 SYLEAM Info Services ([http://www.Syleam.fr/])
8# Sylvain Garancher [sylvain.garancher@syleam.fr]
9#
10# This file is a part of project_mailgate_note
11#
12# project_mailgate_note is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as published by
14# the Free Software Foundation, either version 3 of the License, or
15# (at your option) any later version.
16#
17# project_mailgate_note is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see [http://www.gnu.org/licenses/].
24#
25##############################################################################
26
27
28 </data>
29</openerp>
0\ No newline at end of file30\ No newline at end of file
131
=== added directory 'project_communications_meetings'
=== renamed directory 'project_communications_meetings' => 'project_communications_meetings.moved'
=== added file 'project_communications_meetings/__init__.py'
--- project_communications_meetings/__init__.py 1970-01-01 00:00:00 +0000
+++ project_communications_meetings/__init__.py 2013-02-19 14:36:22 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import project_communications_meetings
23
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
025
=== added file 'project_communications_meetings/__openerp__.py'
--- project_communications_meetings/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_communications_meetings/__openerp__.py 2013-02-19 14:36:22 +0000
@@ -0,0 +1,55 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Avangard Enterprise Information Systems (<http://www.avangard-eis.com/>)
5# Jordi Ballester <jordi.ballester@avangard-eis.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22
23{
24 "name": "Project Management",
25 "version": "1.0",
26 "author": "Eficent, Nervia Consultores",
27 "website": "http://www.eficent.com",
28 "category": "Generic Modules/Projects & Services",
29 "depends": ["project","crm", "google_calendar"],
30 "description": """
31 - This module helps you better manage the meetings related to your projects.
32 - The 'Meetings' tab in the project form, and a link to meetings view helps you to create new meetings from the project, and
33 to better track the status of existing meetings.
34
35 """,
36 "init_xml": [
37 ],
38 "update_xml": [
39 "security/ir.model.access.csv",
40 "security/project_communications_meetings_security.xml",
41 "project_communications_meetings_view.xml",
42 "project_view.xml",
43
44 ],
45 'demo_xml': [
46
47 ],
48 'test':[
49 ],
50 #SIN ADAPTAR
51 'installable': False,
52 'active': False,
53 'certificate': '',
54}
55# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
056
=== added directory 'project_communications_meetings/i18n'
=== added file 'project_communications_meetings/i18n/es.mo'
1Binary files project_communications_meetings/i18n/es.mo 1970-01-01 00:00:00 +0000 and project_communications_meetings/i18n/es.mo 2013-02-19 14:36:22 +0000 differ57Binary files project_communications_meetings/i18n/es.mo 1970-01-01 00:00:00 +0000 and project_communications_meetings/i18n/es.mo 2013-02-19 14:36:22 +0000 differ
=== added file 'project_communications_meetings/i18n/es.po'
--- project_communications_meetings/i18n/es.po 1970-01-01 00:00:00 +0000
+++ project_communications_meetings/i18n/es.po 2013-02-19 14:36:22 +0000
@@ -0,0 +1,74 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_communications_meetings
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-09-30 00:39+0000\n"
10"PO-Revision-Date: 2011-09-30 02:40+0100\n"
11"Last-Translator: Jordi Ballester Alomar (Avangard Enterprise Information Systems) <jordi.ballester@avangard-eis.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: project_communications_meetings
19#: model:ir.ui.menu,name:project_communications_meetings.menu_project_meeting_categories_def_act
20msgid "Meeting Categories"
21msgstr "Categorías de reuniones"
22
23#. module: project_communications_meetings
24#: model:ir.actions.act_window,name:project_communications_meetings.act_project_2_meeting
25#: model:ir.ui.menu,name:project_communications_meetings.menu_project_meeting
26#: model:ir.ui.menu,name:project_communications_meetings.menu_project_meeting_categories_act
27#: view:project.project:0
28#: field:project.project,crm_meetings:0
29msgid "Meetings"
30msgstr "Reuniones"
31
32#. module: project_communications_meetings
33#: field:crm.meeting,project_id:0
34#: model:ir.model,name:project_communications_meetings.model_project_project
35msgid "Project"
36msgstr "Proyecto"
37
38#. module: project_communications_meetings
39#: model:ir.ui.menu,name:project_communications_meetings.menu_project_attendee_invitations_act
40msgid "Meeting Invitations"
41msgstr "Invitaciones a reunión"
42
43#. module: project_communications_meetings
44#: model:ir.module.module,description:project_communications_meetings.module_meta_information
45msgid ""
46"Extensions for the Project management module. \n"
47" "
48msgstr "Extensiones para el módulo de gestión de proyectos."
49
50#. module: project_communications_meetings
51#: view:project.project:0
52msgid "Members"
53msgstr "Miembros"
54
55#. module: project_communications_meetings
56#: constraint:project.project:0
57msgid "Error! You cannot assign escalation to the same project!"
58msgstr "¡Error! No puede asignar un escalado al mismo proyecto."
59
60#. module: project_communications_meetings
61#: model:ir.model,name:project_communications_meetings.model_crm_meeting
62msgid "Meeting"
63msgstr "Reunión"
64
65#. module: project_communications_meetings
66#: model:ir.module.module,shortdesc:project_communications_meetings.module_meta_information
67msgid "Project Management"
68msgstr "Proyectos"
69
70#. module: project_communications_meetings
71#: constraint:project.project:0
72msgid "Error! project start-date must be lower then project end-date."
73msgstr "¡Error! La fecha de inicio del proyecto debe ser anterior a la fecha final del proyecto."
74
075
=== added file 'project_communications_meetings/i18n/project_communications_meetings.pot'
--- project_communications_meetings/i18n/project_communications_meetings.pot 1970-01-01 00:00:00 +0000
+++ project_communications_meetings/i18n/project_communications_meetings.pot 2013-02-19 14:36:22 +0000
@@ -0,0 +1,73 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * project_communications_meetings
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-09-30 00:39+0000\n"
10"PO-Revision-Date: 2011-09-30 00:39+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: project_communications_meetings
19#: model:ir.ui.menu,name:project_communications_meetings.menu_project_meeting_categories_def_act
20msgid "Meeting Categories"
21msgstr ""
22
23#. module: project_communications_meetings
24#: model:ir.actions.act_window,name:project_communications_meetings.act_project_2_meeting
25#: model:ir.ui.menu,name:project_communications_meetings.menu_project_meeting
26#: model:ir.ui.menu,name:project_communications_meetings.menu_project_meeting_categories_act
27#: view:project.project:0
28#: field:project.project,crm_meetings:0
29msgid "Meetings"
30msgstr ""
31
32#. module: project_communications_meetings
33#: field:crm.meeting,project_id:0
34#: model:ir.model,name:project_communications_meetings.model_project_project
35msgid "Project"
36msgstr ""
37
38#. module: project_communications_meetings
39#: model:ir.ui.menu,name:project_communications_meetings.menu_project_attendee_invitations_act
40msgid "Meeting Invitations"
41msgstr ""
42
43#. module: project_communications_meetings
44#: model:ir.module.module,description:project_communications_meetings.module_meta_information
45msgid "Extensions for the Project management module. \n"
46" "
47msgstr ""
48
49#. module: project_communications_meetings
50#: view:project.project:0
51msgid "Members"
52msgstr ""
53
54#. module: project_communications_meetings
55#: constraint:project.project:0
56msgid "Error! You cannot assign escalation to the same project!"
57msgstr ""
58
59#. module: project_communications_meetings
60#: model:ir.model,name:project_communications_meetings.model_crm_meeting
61msgid "Meeting"
62msgstr ""
63
64#. module: project_communications_meetings
65#: model:ir.module.module,shortdesc:project_communications_meetings.module_meta_information
66msgid "Project Management"
67msgstr ""
68
69#. module: project_communications_meetings
70#: constraint:project.project:0
71msgid "Error! project start-date must be lower then project end-date."
72msgstr ""
73
074
=== added file 'project_communications_meetings/project_communications_meetings.py'
--- project_communications_meetings/project_communications_meetings.py 1970-01-01 00:00:00 +0000
+++ project_communications_meetings/project_communications_meetings.py 2013-02-19 14:36:22 +0000
@@ -0,0 +1,46 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from osv import fields, osv
23
24
25
26class project(osv.osv):
27
28 _inherit = "project.project"
29
30 _columns = {
31 'crm_meetings': fields.one2many('crm.meeting','project_id','Meetings'),
32 }
33
34
35project()
36
37class crm_meeting(osv.osv):
38 """ CRM Meeting Cases """
39
40 _inherit = 'crm.meeting'
41
42 _columns = {
43 'project_id':fields.many2one('project.project', 'Project'),
44 }
45
46crm_meeting()
047
=== added file 'project_communications_meetings/project_communications_meetings_view.xml'
--- project_communications_meetings/project_communications_meetings_view.xml 1970-01-01 00:00:00 +0000
+++ project_communications_meetings/project_communications_meetings_view.xml 2013-02-19 14:36:22 +0000
@@ -0,0 +1,47 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5
6#---------------------------------------------------------------------------------------------------------
7# Add meetings from project
8#---------------------------------------------------------------------------------------------------------
9 <act_window
10 domain="[('project_id', '=', active_id)]"
11 id="act_project_2_meeting"
12 name="Meetings"
13 res_model="crm.meeting"
14 src_model="project.project"
15 groups="project.group_project_manager,project.group_project_user" />
16
17 <!-- CRM Meetings Form View -->
18
19 <record model="ir.ui.view" id="crm_case_form_view_meet_avg">
20 <field name="name">CRM - Meetings Form</field>
21 <field name="model">crm.meeting</field>
22 <field name="inherit_id" ref="crm.crm_case_form_view_meet" />
23 <field name="type">form</field>
24 <field name="arch" type="xml">
25 <field name="categ_id" position="after">
26 <field name="project_id"/>
27 </field>
28 </field>
29 </record>
30
31 <!-- CRM Meeting Search View -->
32
33 <record id="view_crm_case_meetings_filter_avg" model="ir.ui.view">
34 <field name="name">CRM - Meetings Search</field>
35 <field name="model">crm.meeting</field>
36 <field name="type">search</field>
37 <field name="inherit_id" ref="crm.view_crm_case_meetings_filter" />
38 <field name="arch" type="xml">
39 <field name="categ_id" position="after">
40 <field name="project_id" select="2"/>
41 </field>
42 </field>
43 </record>
44
45
46 </data>
47</openerp>
048
=== added file 'project_communications_meetings/project_view.xml'
--- project_communications_meetings/project_view.xml 1970-01-01 00:00:00 +0000
+++ project_communications_meetings/project_view.xml 2013-02-19 14:36:22 +0000
@@ -0,0 +1,65 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5#---------------------------------------------------------------------------------------------------------
6# Extend the menus
7#---------------------------------------------------------------------------------------------------------
8
9 <menuitem name="Meetings" id="menu_project_meeting"
10 parent="project.menu_project_management" sequence="3"/>
11
12 <menuitem id="menu_project_meeting_categories_act"
13 name="Meetings"
14 parent="menu_project_meeting"
15 sequence="10" action="crm.crm_case_categ_meet"
16 groups="project.group_project_manager,project.group_project_user"/>
17
18
19 <menuitem id="menu_project_attendee_invitations_act"
20 name="Meeting Invitations" parent="menu_project_meeting"
21 sequence="20" action="crm.action_view_attendee_form"
22 groups="project.group_project_manager,project.group_project_user" />
23
24
25
26 <menuitem id="menu_project_meeting_categories_def_act"
27 name="Meeting Categories" parent="base.menu_definitions"
28 sequence="10" action="crm.crm_meeting_categ_action"
29 groups="project.group_project_manager" />
30
31
32 <menuitem id="project_menu_google"
33 name="Google Import-Export"
34 parent="project.menu_project_management"/>
35
36 <menuitem name="Synchronize Events"
37 id="project_menu_tools_google_calendar_synch"
38 parent="project_menu_google"
39 action="google_calendar.wizard_google_calendar_synch"
40 type="wizard"/>
41
42
43
44#---------------------------------------------------------------------------------------------------------
45# Extend the project
46#---------------------------------------------------------------------------------------------------------
47 <record id="edit_project" model="ir.ui.view">
48 <field name="name">project.project.form</field>
49 <field name="model">project.project</field>
50 <field name="type">form</field>
51 <field name="inherit_id" ref="project.edit_project"/>
52 <field name="arch" type="xml">
53 <page string='Other Info' position="after">
54 <page string="Meetings">
55 <field colspan="4" name="crm_meetings" nolabel="1" mode="tree,form" context="{'default_project_id': active_id}"/>
56 </page>
57 </page>
58
59
60 </field>
61 </record>
62
63
64 </data>
65</openerp>
066
=== added directory 'project_communications_meetings/security'
=== added file 'project_communications_meetings/security/ir.model.access.csv'
--- project_communications_meetings/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ project_communications_meetings/security/ir.model.access.csv 2013-02-19 14:36:22 +0000
@@ -0,0 +1,9 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2"access_crm_meetings_project_manager","crm.meeting.manager","crm.model_crm_meeting","project.group_project_manager",1,1,1,1
3"access_crm_meetings_project_user","crm.meeting.user","crm.model_crm_meeting","project.group_project_user",1,1,1,1
4"access_calendar_attendee_crm_project_user","calendar.attendee.crm.user","crm.model_calendar_attendee","project.group_project_user",1,1,1,1
5"access_calendar_attendee_crm_project_manager","calendar.attendee.crm.manager","crm.model_calendar_attendee","project.group_project_manager",1,1,1,1
6"access_res_partner_project_user","res.partner.crm.user","base.model_res_partner","project.group_project_user",1,1,1,1
7"access_res_partner_address_project_user","res.partner.address.crm.user","base.model_res_partner_address","project.group_project_user",1,1,1,1
8"access_res_partner_category_project_user","res.partner.category.crm.user","base.model_res_partner_category","project.group_project_user",1,1,1,1
9
010
=== added file 'project_communications_meetings/security/project_communications_meetings_security.xml'
--- project_communications_meetings/security/project_communications_meetings_security.xml 1970-01-01 00:00:00 +0000
+++ project_communications_meetings/security/project_communications_meetings_security.xml 2013-02-19 14:36:22 +0000
@@ -0,0 +1,16 @@
1<?xml version="1.0" ?>
2<openerp>
3<data>
4
5<!--
6 <record model="ir.rule" id="project_meeting_visibility_rule_project_user">
7 <field name="name" >Project Meetings According to User</field>
8 <field name="model_id" ref="crm.model_crm_meeting"/>
9 <field name="global" eval="True"/>
10 <field name="domain_force">['|','|','|',('user_id','=',False),('project_id.members','in', [user.id]),('user_id','=',user.id),('project_id.user_id','=',user.id)]</field>
11 <field name="groups" eval="[(4,ref('project.group_project_user'))]"/>
12 </record>
13-->
14
15</data>
16</openerp>
017
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,31 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import account_analytic_account
23import account_analytic_journal_plan
24import account_analytic_journal_commit
25import account_analytic_line
26import account_analytic_line_plan
27import account_analytic_line_commit
28import report
29import wizard
30
31# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
032
=== added file 'project_cost/__openerp__.py'
--- project_cost/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_cost/__openerp__.py 2013-02-19 14:36:22 +0000
@@ -0,0 +1,70 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 "name": "Project Management",
24 "version": "1.0",
25 "author": "Eficent, Nervia Consultores",
26 "website": "",
27 "category": "Generic Modules/Projects & Services",
28 "depends": ["account","product", "analytic", "board", "project", "purchase","hr_timesheet", "sale"],
29 "description": """Eficent Project Management. Project Cost Planning
30 - A planning analytic journal object is created. It is similar to the analytic journal, but used for planning purposes
31 - The planning analytic journals can be configured
32 - A planning analytic journal lines object is created, with the exceptions of referencing
33 to the planning analytic journal instead of the analytic journal, and considering
34 that the general account is not a required entry.
35 - The new object is visible as a separate entity, accesible from the Accounting area, with the corresponding search, tree, form views.
36 - New analytic account attributes: cumulated planned costs, cummulated planned earnings and cumulated balance.
37 The attributes are calculated based on the planning analytic journal lines.
38 The new attributes are visible on the following views:
39 − Analytic account forms: cumulated planned costs, cumulated planned earnings and cumulated balance
40 − Budget positions: cumulated planned costs
41
42 """,
43 "init_xml": [],
44 "update_xml": [
45 "account_analytic_journal_plan_view.xml",
46 "account_analytic_journal_commit_view.xml",
47 "account_analytic_journal_plan_report.xml",
48 "account_analytic_journal_commit_report.xml",
49 "account_analytic_line_view.xml",
50 "account_analytic_line_plan_view.xml",
51 "account_analytic_line_commit_view.xml",
52 "account_analytic_account_view.xml",
53 "wizard/account_analytic_journal_plan_report_view.xml",
54 "wizard/account_analytic_journal_commit_report_view.xml",
55 "project_view.xml",
56 "security/ir.model.access.csv",
57 "security/project_cost_security.xml",
58 "account_analytic_journal_plan_data.xml",
59 "account_analytic_journal_commit_data.xml",
60 ],
61 'demo_xml': [
62
63 ],
64 'test':[
65 ],
66 'installable': True,
67 'active': False,
68 'certificate': '',
69}
70# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
071
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,220 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from lxml import etree
23import time
24from datetime import datetime, date, timedelta
25import decimal_precision as dp
26from tools.translate import _
27from osv import fields, osv
28import netsvc
29import tools
30
31class account_analytic_account(osv.osv):
32
33 _inherit = 'account.analytic.account'
34
35 def _compute_level_tree_plan(self, cr, uid, ids, child_ids, res, field_names, context=None):
36 osv.logging.log(100, "36:project_cost/account_analytic_account:_compute_level_tree_plan")
37 def recursive_computation(account_id, res, repeated_account_ids=None):
38 if repeated_account_ids is None:
39 repeated_account_ids = []
40 currency_obj = self.pool.get('res.currency')
41 account = self.browse(cr, uid, account_id)
42 for son in account.child_ids:
43 if son.id in repeated_account_ids:
44 continue
45 res = recursive_computation(son.id, res)
46 repeated_account_ids.append(son.id)
47 for field in field_names:
48 if account.currency_id.id == son.currency_id.id or field=='quantity_plan':
49 res[account.id][field] += res[son.id][field]
50 else:
51 res[account.id][field] += currency_obj.compute(cr, uid, son.currency_id.id, account.currency_id.id, res[son.id][field], context=context)
52 return res
53 for account in self.browse(cr, uid, ids, context=context):
54 if account.id not in child_ids:
55 continue
56 res = recursive_computation(account.id, res)
57 return res
58
59 def _compute_level_tree_commit(self, cr, uid, ids, child_ids, res, field_names, context=None):
60 osv.logging.log(100, "60:project_cost/account_analytic_account:_compute_level_tree_commit")
61 def recursive_computation(account_id, res, repeated_account_ids=[]):
62 currency_obj = self.pool.get('res.currency')
63 account = self.browse(cr, uid, account_id)
64 for son in account.child_ids:
65 if son.id in repeated_account_ids:
66 continue
67 res = recursive_computation(son.id, res)
68 repeated_account_ids.append(son.id)
69 for field in field_names:
70 if account.currency_id.id == son.currency_id.id or field=='quantity_commit':
71 res[account.id][field] += res[son.id][field]
72 else:
73 res[account.id][field] += currency_obj.compute(cr, uid, son.currency_id.id, account.currency_id.id, res[son.id][field], context=context)
74 return res
75 for account in self.browse(cr, uid, ids, context=context):
76 if account.id not in child_ids:
77 continue
78 res = recursive_computation(account.id, res)
79 return res
80
81 def _debit_credit_bal_qtty_plan(self, cr, uid, ids, name, arg, context=None):
82 osv.logging.log(100, "82:project_cost/account_analytic_account:_debit_credit_bal_qtty_plan")
83 res = {}
84 if context is None:
85 context = {}
86 child_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
87 for i in child_ids:
88 res[i] = {}
89 for n in name:
90 res[i][n] = 0.0
91
92 if not child_ids:
93 return res
94
95 where_date = ''
96 where_clause_args = [tuple(child_ids)]
97 if context.get('from_date', False):
98 where_date += " AND l.date >= %s"
99 where_clause_args += [context['from_date']]
100 if context.get('to_date', False):
101 where_date += " AND l.date <= %s"
102 where_clause_args += [context['to_date']]
103 cr.execute("""
104 SELECT a.id,
105 sum(
106 CASE WHEN l.amount > 0
107 THEN l.amount
108 ELSE 0.0
109 END
110 ) as debit,
111 sum(
112 CASE WHEN l.amount < 0
113 THEN -l.amount
114 ELSE 0.0
115 END
116 ) as credit,
117 COALESCE(SUM(l.amount),0) AS balance,
118 COALESCE(SUM(l.unit_amount),0) AS quantity
119 FROM account_analytic_account a
120 LEFT JOIN account_analytic_line_plan l ON (a.id = l.account_id)
121 WHERE a.id IN %s
122 """ + where_date + """
123 GROUP BY a.id""", where_clause_args)
124 for ac_id, debit, credit, balance, quantity in cr.fetchall():
125 res[ac_id] = {'debit_plan': debit, 'credit_plan': credit, 'balance_plan': balance, 'quantity_plan': quantity}
126 return self._compute_level_tree_plan(cr, uid, ids, child_ids, res, ['debit_plan', 'credit_plan', 'balance_plan', 'quantity_plan'], context)
127
128 def _debit_credit_bal_qtty_commit(self, cr, uid, ids, name, arg, context=None):
129 osv.logging.log(100, "129:project_cost/account_analytic_account:_debit_credit_bal_qtty_commit")
130 res = {}
131 if context is None:
132 context = {}
133 child_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
134 for i in child_ids:
135 res[i] = {}
136 for n in name:
137 res[i][n] = 0.0
138
139 if not child_ids:
140 return res
141
142 where_date = ''
143 where_clause_args = [tuple(child_ids)]
144 if context.get('from_date', False):
145 where_date += " AND l.date >= %s"
146 where_clause_args += [context['from_date']]
147 if context.get('to_date', False):
148 where_date += " AND l.date <= %s"
149 where_clause_args += [context['to_date']]
150 cr.execute("""
151 SELECT a.id,
152 sum(
153 CASE WHEN l.amount > 0
154 THEN l.amount
155 ELSE 0.0
156 END
157 ) as debit,
158 sum(
159 CASE WHEN l.amount < 0
160 THEN -l.amount
161 ELSE 0.0
162 END
163 ) as credit,
164 COALESCE(SUM(l.amount),0) AS balance,
165 COALESCE(SUM(l.unit_amount),0) AS quantity
166 FROM account_analytic_account a
167 LEFT JOIN account_analytic_line_commit l ON (a.id = l.account_id)
168 WHERE a.id IN %s
169 """ + where_date + """
170 GROUP BY a.id""", where_clause_args)
171 for ac_id, debit, credit, balance, quantity in cr.fetchall():
172 res[ac_id] = {'debit_commit': debit, 'credit_commit': credit, 'balance_commit': balance, 'quantity_commit': quantity}
173 return self._compute_level_tree_commit(cr, uid, ids, child_ids, res, ['debit_commit', 'credit_commit', 'balance_commit', 'quantity_commit'], context)
174
175
176 _columns = {
177
178 #In case that the parent is deleted, we also delete this entity
179 'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2, ondelete='cascade'),
180
181 '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')),
182 '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')),
183 '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')),
184 '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')),
185 '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')),
186 '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')),
187 'quantity_plan': fields.function(_debit_credit_bal_qtty_plan, method=True, type='float', string='Quantity Debit', multi='debit_credit_bal_qtty_plan', digits_compute=dp.get_precision('Account')),
188 'quantity_commit': fields.function(_debit_credit_bal_qtty_commit, method=True, type='float', string='Quantity Commitments', multi='debit_credit_bal_qtty_commit', digits_compute=dp.get_precision('Account')),
189 'state': fields.selection([('draft','Draft'),('ready','Ready'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Closed'),('template', 'Template')], 'State', required=True,
190 help='* When an account is created its in \'Draft\' state.\
191 \n* When is ready to be used, it can be in \'Ready\' state.\
192 \n* If any associated partner is there, it can be in \'Open\' state.\
193 \n* If any pending balance is there it can be in \'Pending\'. \
194 \n* And finally when all the transactions are over, it can be in \'Close\' state. \
195 \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.\
196 \n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'),
197 'plan_line_ids': fields.one2many('account.analytic.line.plan', 'account_id', 'Analytic Entries'),
198 'commit_line_ids': fields.one2many('account.analytic.line.commit', 'account_id', 'Commitment Analytic Entries'),
199
200 }
201
202 _defaults = {
203 'state': 'draft',
204 }
205
206 def set_ready(self, cr, uid, ids, context=None):
207 osv.logging.log(100, "205:project_cost/account_analytic_account:set_ready")
208 self.write(cr, uid, ids, {'state':'ready'}, context=context)
209 return True
210
211 def copy(self, cr, uid, id, default=None, context=None):
212 osv.logging.log(100, "210:project_cost/account_analytic_account:copy")
213 if default is None:
214 default = {}
215 default['plan_line_ids'] = []
216 default['commit_line_ids'] = []
217 return super(account_analytic_account, self).copy(cr, uid, id, default, context=context)
218
219
220account_analytic_account()
0\ No newline at end of file221\ No newline at end of file
1222
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,153 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5#---------------------------------------------------------------------------------------------------------
6# Extend the menus
7#---------------------------------------------------------------------------------------------------------
8 <menuitem id="project_cost_analytic_account_menu"
9 name="Analytic Accounting"
10 parent="project.menu_project_management"
11 sequence="2"
12 groups="analytic.group_analytic_accounting"/>
13
14 <menuitem action="account.action_account_analytic_account_form" id="account_analytic_def_account"
15 parent="project_cost_analytic_account_menu"
16 groups="analytic.group_analytic_accounting"/>
17
18 <menuitem groups="analytic.group_analytic_accounting"
19 action="action_account_analytic_journal_plan_open_form"
20 id="account_analytic_journal_plan_entries_2"
21 parent="project_cost_analytic_account_menu"/>
22
23---------------------------------------------------------------------------------------------------------
24# Extend the analytic account
25#---------------------------------------------------------------------------------------------------------
26
27
28 <record id="view_account_analytic_account_tree_inh" model="ir.ui.view">
29 <field name="name">account.analytic.account.tree</field>
30 <field name="model">account.analytic.account</field>
31 <field name="type">tree</field>
32 <field name="field_parent">child_complete_ids</field>
33 <field name="inherit_id" ref="account.view_account_analytic_account_tree"/>
34 <field name="arch" type="xml">
35 <field name="balance" position="after">
36 <field name="debit_plan"/>
37 <field name="credit_plan"/>
38 <field name="balance_plan"/>
39 <field name="debit_commit"/>
40 <field name="credit_commit"/>
41 <field name="balance_commit"/>
42 </field>
43 </field>
44 </record>
45
46 <record id="view_account_analytic_account_form" model="ir.ui.view">
47 <field name="name">account.analytic.account.form</field>
48 <field name="model">account.analytic.account</field>
49 <field name="type">form</field>
50 <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
51 <field name="arch" type="xml">
52 <form string="Analytic Account" version="7.0">
53 <sheet string="Analytic Account">
54 <notebook>
55 <page string="Description" position="after">
56 <page string="Costs">
57 <field colspan="4" name="line_ids" nolabel="1" context="{'default_account_id': active_id}"/>
58 <field colspan="4" name="plan_line_ids" nolabel="1" context="{'default_account_id': active_id}">
59 <tree string="Planned analytic lines">
60 <field name="date"/>
61 <field name="period_id"/>
62 <field name="ref" />
63 <field name="name"/>
64 <field name="journal_id" invisible="False"/>
65 <field name="amount" sum="Total" />
66 <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" />
67 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" />
68 <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
69 <field name="general_account_id" />
70 <field name="user_id" invisible="True"/>
71 </tree>
72 <form string="Planned analytic lines">
73 <group colspan="4" col="6">
74 <field name="name"/>
75 <field name="ref"/>
76 <field name="account_id" invisible="True"/>
77 <field name="journal_id"/>
78 <field name="date"/>
79 <field name="period_id"/>
80 <field name="company_id" groups="base.group_multi_company"/>
81 </group>
82 <group colspan="2" col="4">
83 <separator string="Amount" colspan="4"/>
84 <field name="amount" colspan="4"/>
85 <field name="amount_currency" colspan="2"/>
86 <field name="currency_id" colspan="2" nolabel="1"/>
87 </group>
88 <group colspan="2" col="4">
89 <separator string="Product Information" colspan="4"/>
90 <field name="product_id" colspan="4" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
91 <field name="unit_amount" colspan="2" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
92 <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)"/>
93 </group>
94 <group colspan="2" col="2" groups="base.group_erp_manager">
95 <separator string="General Accounting" colspan="2"/>
96 <field name="general_account_id"/>
97 <field name="move_id" readonly="1"/>
98 </group>
99 </form>
100 </field>
101 <field colspan="4" name="commit_line_ids" nolabel="1" context="{'default_account_id': active_id}">
102 <tree string="Commitment analytic lines">
103 <field name="date"/>
104 <field name="period_id"/>
105 <field name="ref" />
106 <field name="name"/>
107 <field name="journal_id" invisible="False"/>
108 <field name="amount" sum="Total" />
109 <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" />
110 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" />
111 <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
112 <field name="general_account_id" />
113 <field name="user_id" invisible="True"/>
114 </tree>
115 <form string="Commitment analytic lines">
116 <group colspan="4" col="6">
117 <field name="name"/>
118 <field name="ref"/>
119 <field name="account_id" invisible="True"/>
120 <field name="journal_id"/>
121 <field name="date"/>
122 <field name="period_id"/>
123 <field name="company_id" groups="base.group_multi_company"/>
124 </group>
125 <group colspan="2" col="4">
126 <separator string="Amount" colspan="4"/>
127 <field name="amount" colspan="4"/>
128 <field name="amount_currency" colspan="2"/>
129 <field name="currency_id" colspan="2" nolabel="1"/>
130 </group>
131 <group colspan="2" col="4">
132 <separator string="Product Information" colspan="4"/>
133 <field name="product_id" colspan="4" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
134 <field name="unit_amount" colspan="2" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
135 <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)"/>
136 </group>
137 <group colspan="2" col="2" groups="base.group_erp_manager">
138 <separator string="General Accounting" colspan="2"/>
139 <field name="general_account_id"/>
140 <field name="move_id" readonly="1"/>
141 </group>
142 </form>
143 </field>
144 </page>
145 </page>
146 </notebook>
147 </sheet>
148 </form>
149 </field>
150 </record>
151
152 </data>
153</openerp>
0154
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,53 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from lxml import etree
23import time
24from datetime import datetime, date, timedelta
25import decimal_precision as dp
26from tools.translate import _
27from osv import fields, osv
28import netsvc
29import tools
30
31
32
33class account_analytic_journal_commit(osv.osv):
34
35 _name = 'account.analytic.journal.commit'
36 _description = 'Analytic Journal Commitments'
37 _columns = {
38 'name': fields.char('Commitments Journal Name', size=64, required=True),
39 'code': fields.char('Commitments Journal Code', size=8),
40 '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."),
41 '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."),
42 'line_ids': fields.one2many('account.analytic.line.commit', 'journal_id', 'Lines'),
43 'company_id': fields.many2one('res.company', 'Company', required=True),
44 'analytic_journal': fields.many2one('account.analytic.journal', 'Actual Analytic journal', required=False),
45 }
46 _defaults = {
47 'active': True,
48 'type': 'general',
49 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
50 }
51
52
53account_analytic_journal_commit()
054
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,21 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data noupdate="1">
4 <record id="analytic_journal_commit_sale" model="account.analytic.journal.commit">
5 <field name="code">SAL</field>
6 <field name="name">Sales</field>
7 <field name="type">sale</field>
8 </record>
9 <record id="analytic_journal_commit_purchase" model="account.analytic.journal.commit">
10 <field name="code">PUR</field>
11 <field name="name">Purchases</field>
12 <field name="type">purchase</field>
13 </record>
14 <record id="analytic_journal_commit_time" model="account.analytic.journal.commit">
15 <field name="code">TS</field>
16 <field name="name">Timesheet</field>
17 <field name="type">general</field>
18 </record>
19
20 </data>
21</openerp>
022
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <report auto="False" id="account_analytic_journal_commit_print1" menu="False"
5 model="account.analytic.journal.commit" name="account.analytic.account.journal.commit"
6 rml="project_cost/report/account_analytic_journal_commit.rml" string="Commitments Analytic Journal"/>
7 </data>
8</openerp>
0\ No newline at end of file9\ No newline at end of file
110
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,86 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5#---------------------------------------------------------------------------------------------------------
6# Analytic Journal
7#---------------------------------------------------------------------------------------------------------
8 <record id="view_account_analytic_journal_commit_tree" model="ir.ui.view">
9 <field name="name">account.analytic.journal.commit.tree</field>
10 <field name="model">account.analytic.journal.commit</field>
11 <field name="type">tree</field>
12 <field name="arch" type="xml">
13 <tree string="Analytic Journal">
14 <field name="code"/>
15 <field name="name"/>
16 <field name="type"/>
17 <field name="analytic_journal"/>
18 </tree>
19 </field>
20 </record>
21
22 <record id="view_account_analytic_journal_commit_search" model="ir.ui.view">
23 <field name="name">account.analytic.journal.commit.search</field>
24 <field name="model">account.analytic.journal.commit</field>
25 <field name="type">search</field>
26 <field name="arch" type="xml">
27 <search string="Analytic Journals">
28 <group>
29 <field name="code"/>
30 <field name="name"/>
31 <field name="type"/>
32 <field name="analytic_journal"/>
33 </group>
34 <newline/>
35 <group expand="0" string="Group By...">
36 <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
37 </group>
38 </search>
39 </field>
40 </record>
41
42 <record id="view_account_analytic_journal_commit_form" model="ir.ui.view">
43 <field name="name">account.analytic.journal.commit.form</field>
44 <field name="model">account.analytic.journal.commit</field>
45 <field name="type">form</field>
46 <field name="arch" type="xml">
47 <form string="Analytic Journal">
48 <field name="name" select="1"/>
49 <field name="code" select="1"/>
50 <field name="type" select="2"/>
51 <field name="active" select="2"/>
52 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
53 <field name="analytic_journal"/>
54 </form>
55 </field>
56 </record>
57 <record id="action_account_analytic_journal_commit_form" model="ir.actions.act_window">
58 <field name="name">Commitment Analytic Journals</field>
59 <field name="res_model">account.analytic.journal.commit</field>
60 <field name="view_type">form</field>
61 <field name="view_mode">tree,form</field>
62 <field name="search_view_id" ref="view_account_analytic_journal_commit_search" />
63 </record>
64 <menuitem groups="analytic.group_analytic_accounting"
65 action="action_account_analytic_journal_commit_form"
66 id="account_def_analytic_journal_commit"
67 parent="account.menu_analytic_accounting" sequence="6"/>
68
69
70#---------------------------------------------------------------------------------------------------------
71# Reporting
72#---------------------------------------------------------------------------------------------------------
73
74 <record id="action_account_analytic_journal_commit_tree" model="ir.actions.act_window">
75 <field name="name">Print Commitment Analytic Journals</field>
76 <field name="res_model">account.analytic.journal.commit</field>
77 <field name="view_type">tree</field>
78 <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>
79 </record>
80 <menuitem groups="analytic.group_analytic_accounting"
81 action="action_account_analytic_journal_commit_tree"
82 id="account_analytic_journal_commit_print" parent="account.next_id_40"/>
83
84
85 </data>
86</openerp>
087
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,55 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from lxml import etree
23import time
24from datetime import datetime, date, timedelta
25import decimal_precision as dp
26from tools.translate import _
27from osv import fields, osv
28import netsvc
29import tools
30
31
32
33class account_analytic_journal_plan(osv.osv):
34
35 _name = 'account.analytic.journal.plan'
36 _description = 'Analytic Journal Plan'
37 _columns = {
38 'name': fields.char('Planning Journal Name', size=64, required=True),
39 'code': fields.char('Planning Journal Code', size=8),
40 '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."),
41 '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."),
42 'line_ids': fields.one2many('account.analytic.line.plan', 'journal_id', 'Lines'),
43 'company_id': fields.many2one('res.company', 'Company', required=True),
44 'analytic_journal': fields.many2one('account.analytic.journal', 'Actual Analytic journal', required=False),
45
46 }
47 _defaults = {
48 'active': True,
49 'type': 'general',
50 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
51 }
52
53
54account_analytic_journal_plan()
55
056
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,21 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data noupdate="1">
4 <record id="analytic_journal_plan_sale" model="account.analytic.journal.plan">
5 <field name="code">SAL</field>
6 <field name="name">Sales</field>
7 <field name="type">sale</field>
8 </record>
9 <record id="analytic_journal_plan_purchase" model="account.analytic.journal.plan">
10 <field name="code">PUR</field>
11 <field name="name">Purchases</field>
12 <field name="type">purchase</field>
13 </record>
14 <record id="analytic_journal_plan_time" model="account.analytic.journal.plan">
15 <field name="code">TS</field>
16 <field name="name">Timesheet</field>
17 <field name="type">general</field>
18 </record>
19
20 </data>
21</openerp>
022
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <report auto="False" id="account_analytic_journal_plan_print1" menu="False"
5 model="account.analytic.journal.plan" name="account.analytic.account.journal.plan"
6 rml="project_cost/report/account_analytic_journal_plan.rml" string="Planning Analytic Journal"/>
7 </data>
8</openerp>
0\ No newline at end of file9\ No newline at end of file
110
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,86 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5#---------------------------------------------------------------------------------------------------------
6# Analytic Journal
7#---------------------------------------------------------------------------------------------------------
8 <record id="view_account_analytic_journal_plan_tree" model="ir.ui.view">
9 <field name="name">account.analytic.journal.plan.tree</field>
10 <field name="model">account.analytic.journal.plan</field>
11 <field name="type">tree</field>
12 <field name="arch" type="xml">
13 <tree string="Analytic Journal">
14 <field name="code"/>
15 <field name="name"/>
16 <field name="type"/>
17 <field name="analytic_journal"/>
18 </tree>
19 </field>
20 </record>
21
22 <record id="view_account_analytic_journal_plan_search" model="ir.ui.view">
23 <field name="name">account.analytic.journal.plan.search</field>
24 <field name="model">account.analytic.journal.plan</field>
25 <field name="type">search</field>
26 <field name="arch" type="xml">
27 <search string="Analytic Journals">
28 <group>
29 <field name="code"/>
30 <field name="name"/>
31 <field name="type"/>
32 <field name="analytic_journal"/>
33 </group>
34 <newline/>
35 <group expand="0" string="Group By...">
36 <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
37 </group>
38 </search>
39 </field>
40 </record>
41
42 <record id="view_account_analytic_journal_plan_form" model="ir.ui.view">
43 <field name="name">account.analytic.journal.plan.form</field>
44 <field name="model">account.analytic.journal.plan</field>
45 <field name="type">form</field>
46 <field name="arch" type="xml">
47 <form string="Analytic Journal">
48 <field name="name" select="1"/>
49 <field name="code" select="1"/>
50 <field name="type" select="2"/>
51 <field name="active" select="2"/>
52 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
53 <field name="analytic_journal"/>
54 </form>
55 </field>
56 </record>
57 <record id="action_account_analytic_journal_plan_form" model="ir.actions.act_window">
58 <field name="name">Planning Analytic Journals</field>
59 <field name="res_model">account.analytic.journal.plan</field>
60 <field name="view_type">form</field>
61 <field name="view_mode">tree,form</field>
62 <field name="search_view_id" ref="view_account_analytic_journal_plan_search" />
63 </record>
64 <menuitem groups="analytic.group_analytic_accounting"
65 action="action_account_analytic_journal_plan_form"
66 id="account_def_analytic_journal_plan"
67 parent="account.menu_analytic_accounting" sequence="6"/>
68
69
70#---------------------------------------------------------------------------------------------------------
71# Reporting
72#---------------------------------------------------------------------------------------------------------
73
74 <record id="action_account_analytic_journal_plan_tree" model="ir.actions.act_window">
75 <field name="name">Print Planning Analytic Journals</field>
76 <field name="res_model">account.analytic.journal.plan</field>
77 <field name="view_type">tree</field>
78 <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>
79 </record>
80 <menuitem groups="analytic.group_analytic_accounting"
81 action="action_account_analytic_journal_plan_tree"
82 id="account_analytic_journal_plan_print" parent="account.next_id_40"/>
83
84
85 </data>
86</openerp>
087
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,50 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22
23import time
24
25from osv import fields
26from osv import osv
27from tools.translate import _
28
29
30
31class account_analytic_line(osv.osv):
32
33 _inherit = 'account.analytic.line'
34
35 def _get_period(self, cr, uid, context=None):
36 periods = self.pool.get('account.period').find(cr, uid)
37 if periods:
38 return periods[0]
39 return False
40
41 _columns = {
42 'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
43 }
44
45 _defaults = {
46 'period_id': _get_period,
47 }
48
49
50account_analytic_line()
0\ No newline at end of file51\ No newline at end of file
152
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,184 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from lxml import etree
23import time
24from datetime import datetime, date, timedelta
25import decimal_precision as dp
26from tools.translate import _
27from osv import fields, osv
28import netsvc
29import tools
30
31class account_analytic_line_commit(osv.osv):
32 _name = 'account.analytic.line.commit'
33 _description = 'Analytic Line Commitment'
34
35
36
37 def _get_period(self, cr, uid, context=None):
38 periods = self.pool.get('account.period').find(cr, uid)
39 if periods:
40 return periods[0]
41 return False
42
43 _columns = {
44 'name': fields.char('Description', size=256, required=True),
45 'date': fields.date('Date', required=True, select=True),
46 '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')),
47 'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.'),
48 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True, domain=[('type','<>','view')]),
49 'user_id': fields.many2one('res.users', 'User'),
50 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
51 'product_uom_id': fields.many2one('product.uom', 'UoM'),
52 'product_id': fields.many2one('product.product', 'Product'),
53 'general_account_id': fields.many2one('account.account', 'General Account', required=False, ondelete='restrict'),
54 'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='restrict', select=True),
55 'journal_id': fields.many2one('account.analytic.journal.commit', 'Commitment Analytic Journal', required=True, ondelete='restrict', select=True),
56 'code': fields.char('Code', size=8),
57 'ref': fields.char('Ref.', size=64),
58 'currency_id': fields.many2one('res.currency', 'Currency'),
59 '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')),
60 'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
61
62 }
63
64 _defaults = {
65 'date': lambda *a: time.strftime('%Y-%m-%d'),
66 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
67 'amount': 0.00,
68 'period_id': _get_period,
69 }
70 _order = 'date desc'
71
72 def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
73 if context is None:
74 context = {}
75 if context.get('from_date',False):
76 args.append(['date', '>=', context['from_date']])
77 if context.get('to_date',False):
78 args.append(['date','<=', context['to_date']])
79 return super(account_analytic_line_commit, self).search(cr, uid, args, offset, limit,
80 order, context=context, count=count)
81
82 def _check_company(self, cr, uid, ids, context=None):
83 lines = self.browse(cr, uid, ids, context=context)
84 for l in lines:
85 if l.move_id and not l.account_id.company_id.id == l.move_id.account_id.company_id.id:
86 return False
87 return True
88
89 # Compute the cost based on the price type define into company
90 # property_valuation_price_type property
91 def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, company_id,
92 unit=False, journal_id=False, context=None):
93
94 res={}
95
96 if context==None:
97 context={}
98
99 product_obj = self.pool.get('product.product')
100
101 if prod_id:
102 prod = product_obj.browse(cr, uid, prod_id, context=context)
103 res['value']={ }
104# 'product_uom_id': prod.uom_id.id,
105# 'unit_amount': quantity or 1.0
106# }
107
108 if not journal_id:
109 j_ids = self.pool.get('account.analytic.journal.commit').search(cr, uid, [('type','=','purchase')])
110 journal_id = j_ids and j_ids[0] or False
111 if not journal_id or not prod_id:
112 return res
113
114 analytic_journal_obj =self.pool.get('account.analytic.journal.commit')
115 product_price_type_obj = self.pool.get('product.price.type')
116 j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
117
118 result = 0.0
119
120 if j_id.type <> 'sale':
121 a = prod.product_tmpl_id.property_account_expense.id
122 if not a:
123 a = prod.categ_id.property_account_expense_categ.id
124 if not a:
125 raise osv.except_osv(_('Error !'),
126 _('There is no expense account defined ' \
127 'for this product: "%s" (id:%d)') % \
128 (prod.name, prod.id,))
129 else:
130 a = prod.product_tmpl_id.property_account_income.id
131 if not a:
132 a = prod.categ_id.property_account_income_categ.id
133 if not a:
134 raise osv.except_osv(_('Error !'),
135 _('There is no income account defined ' \
136 'for this product: "%s" (id:%d)') % \
137 (prod.name, prod_id,))
138
139 flag = False
140 # Compute based on pricetype
141 product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context=context)
142 pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
143 if journal_id:
144 journal = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
145 if journal.type == 'sale':
146 product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
147 if product_price_type_ids:
148 pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
149 # Take the company currency as the reference one
150 if pricetype.field == 'list_price':
151 flag = True
152 ctx = context.copy()
153 if unit:
154 # price_get() will respect a 'uom' in its context, in order
155 # to return a default price for those units
156 ctx['uom'] = unit
157 amount_unit = prod.price_get(pricetype.field, context=ctx)[prod.id]
158 prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
159 amount = amount_unit * quantity or 1.0
160 result = round(amount, prec)
161
162 if not flag:
163 result *= -1
164
165 res['value'].update({
166 'amount': result,
167 'general_account_id': a,
168 })
169
170 return res
171
172 def view_header_get(self, cr, user, view_id, view_type, context=None):
173 if context is None:
174 context = {}
175 if context.get('account_id', False):
176 # account_id in context may also be pointing to an account.account.id
177 cr.execute('select name from account_analytic_account where id=%s', (context['account_id'],))
178 res = cr.fetchone()
179 if res:
180 res = _('Entries: ')+ (res[0] or '')
181 return res
182 return False
183
184account_analytic_line_commit()
0\ No newline at end of file185\ No newline at end of file
1186
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,110 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5
6#---------------------------------------------------------------------------------------------------------
7# Add Commitment analytic account lines
8#---------------------------------------------------------------------------------------------------------
9 <record id="view_account_analytic_line_commit_form" model="ir.ui.view">
10 <field name="name">account.analytic.line.commit.form</field>
11 <field name="model">account.analytic.line.commit</field>
12 <field name="type">form</field>
13 <field name="arch" type="xml">
14 <form string="Analytic Entry">
15 <group colspan="4" col="6">
16 <field name="name"/>
17 <field name="ref"/>
18 <field name="account_id"/>
19 <field name="journal_id"/>
20 <field name="date"/>
21 <field name="period_id"/>
22 <field name="company_id" groups="base.group_multi_company"/>
23 </group>
24 <group colspan="2" col="4">
25 <separator string="Amount" colspan="4"/>
26 <field name="amount" colspan="4"/>
27 <field name="amount_currency" colspan="2"/>
28 <field name="currency_id" colspan="2" nolabel="1"/>
29 </group>
30 <group colspan="2" col="4">
31 <separator string="Product Information" colspan="4"/>
32 <field name="product_id" colspan="4"/>
33 <field name="unit_amount" colspan="2"/>
34 <field name="product_uom_id" colspan="2" nolabel="1"/>
35 <field name="user_id" colspan="2"/>
36 </group>
37 </form>
38 </field>
39 </record>
40 <record id="view_account_analytic_line_commit_tree" model="ir.ui.view">
41 <field name="name">account.analytic.line.commit.tree</field>
42 <field name="model">account.analytic.line.commit</field>
43 <field name="type">tree</field>
44 <field name="arch" type="xml">
45 <tree editable="top" string="Analytic Entries">
46 <field name="date"/>
47 <field name="ref" invisible="False"/>
48 <field name="name"/>
49 <field name="journal_id" invisible="False"/>
50 <field name="amount" sum="Total" invisible="False"/>
51 <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" invisible="False"/>
52 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" invisible="False"/>
53 <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" invisible="False"/>
54 <field domain="[('type','=','normal')]" name="account_id"/>
55 <field name="user_id" invisible="1"/>
56 </tree>
57 </field>
58 </record>
59 <record id="view_account_analytic_line_commit_filter" model="ir.ui.view">
60 <field name="name">account.analytic.line.commit.select</field>
61 <field name="model">account.analytic.line.commit</field>
62 <field name="type">search</field>
63 <field name="arch" type="xml">
64 <search string="Search Analytic Lines">
65 <group col='6' colspan='4'>
66 <field name="date"/>
67 <field name="name"/>
68 <field name="account_id"/>
69 <field name="user_id"/>
70 </group>
71 <newline/>
72 <group expand="0" string="Extended Filters...">
73 <field name="journal_id" widget="selection"/>
74 <field name="product_id" widget="selection"/>
75 <field name="amount" select="1"/>
76 </group>
77 <newline/>
78 </search>
79 </field>
80 </record>
81 <record id="action_account_analytic_line_commit_form" model="ir.actions.act_window">
82 <field name="name">Commitment Analytic Entries</field>
83 <field name="type">ir.actions.act_window</field>
84 <field name="res_model">account.analytic.line.commit</field>
85 <field name="view_type">form</field>
86 <field name="context">{"search_default_user_id":uid}</field>
87 <field name="view_id" ref="view_account_analytic_line_commit_tree"/>
88 </record>
89
90
91#---------------------------------------------------------------------------------------------------------
92# Open journal entries
93#---------------------------------------------------------------------------------------------------------
94
95 <record id="action_account_analytic_journal_commit_open_form" model="ir.actions.act_window">
96 <field name="name">Analytic Journal Commitment Items</field>
97 <field name="res_model">account.analytic.line.commit</field>
98 <field name="view_type">form</field>
99 <field name="view_mode">tree,form</field>
100 <field name="search_view_id" ref="view_account_analytic_line_commit_filter" />
101 </record>
102 <menuitem groups="analytic.group_analytic_accounting"
103 action="action_account_analytic_journal_commit_open_form"
104 id="account_analytic_journal_commit_entries"
105 parent="account.menu_finance_entries"
106 sequence="7"/>
107
108
109 </data>
110</openerp>
0111
=== 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-02-19 14:36:22 +0000
@@ -0,0 +1,191 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
5# Jordi Ballester Alomar <jordi.ballester@eficent.com>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from lxml import etree
23import time
24from datetime import datetime, date, timedelta
25import decimal_precision as dp
26from tools.translate import _
27from osv import fields, osv
28import netsvc
29import tools
30
31class account_analytic_line_plan(osv.osv):
32 _name = 'account.analytic.line.plan'
33 _description = 'Analytic Line Plan'
34
35
36
37 def _get_period(self, cr, uid, context=None):
38 osv.logging.log(100, "[Alca]: 38:project_cost/account_analytic_line_plan:_get_period")
39 periods = self.pool.get('account.period').find(cr, uid)
40 if periods:
41 return periods[0]
42 return False
43
44 _columns = {
45 'name': fields.char('Description', size=256, required=True),
46 'date': fields.date('Date', required=True, select=True),
47 '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')),
48 'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.'),
49 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True, domain=[('type','<>','view')]),
50 'user_id': fields.many2one('res.users', 'User'),
51 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
52 'product_uom_id': fields.many2one('product.uom', 'UoM'),
53 'product_id': fields.many2one('product.product', 'Product'),
54 'general_account_id': fields.many2one('account.account', 'General Account', required=False, ondelete='restrict'),
55 'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='restrict', select=True),
56 'journal_id': fields.many2one('account.analytic.journal.plan', 'Planning Analytic Journal', required=True, ondelete='restrict', select=True),
57 'code': fields.char('Code', size=8),
58 'ref': fields.char('Ref.', size=64),
59 '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),
60 '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),
61 'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
62 'notes': fields.text('Notes'),
63 }
64
65 _defaults = {
66 'date': lambda *a: time.strftime('%Y-%m-%d'),
67 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
68 'amount': 0.00,
69 'period_id': _get_period,
70 'journal_id': lambda self, cr, uid, context : context['journal_id'] if context and 'journal_id' in context else None,
71 }
72 _order = 'date desc'
73
74 def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
75 osv.logging.log(100, "[Alca]: 75:project_cost/account_analytic_line_plan:search")
76 if context is None:
77 context = {}
78 if context.get('from_date',False):
79 args.append(['date', '>=', context['from_date']])
80 if context.get('to_date',False):
81 args.append(['date','<=', context['to_date']])
82 return super(account_analytic_line_plan, self).search(cr, uid, args, offset, limit,
83 order, context=context, count=count)
84
85 def _check_company(self, cr, uid, ids, context=None):
86 osv.logging.log(100, "[Alca]: 86:project_cost/account_analytic_line_plan:_check_company")
87 lines = self.browse(cr, uid, ids, context=context)
88 for l in lines:
89 if l.move_id and not l.account_id.company_id.id == l.move_id.account_id.company_id.id:
90 return False
91 return True
92
93 # Compute the cost based on the price type define into company
94 # property_valuation_price_type property
95 def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, company_id,
96 unit=False, journal_id=False, context=None):
97 osv.logging.log(100, "[Alca]: 97:project_cost/account_analytic_line_plan:on_change_unit_amount")
98
99 res={}
100
101 if context==None:
102 context={}
103
104 product_obj = self.pool.get('product.product')
105
106 if prod_id:
107 prod = product_obj.browse(cr, uid, prod_id, context=context)
108 res['value']={ }
109# 'product_uom_id': prod.uom_id.id,
110# 'unit_amount': quantity or 1.0
111# }
112
113 if not journal_id:
114 j_ids = self.pool.get('account.analytic.journal.plan').search(cr, uid, [('type','=','purchase')])
115 journal_id = j_ids and j_ids[0] or False
116 if not journal_id or not prod_id:
117 return res
118
119 analytic_journal_obj =self.pool.get('account.analytic.journal.plan')
120 product_price_type_obj = self.pool.get('product.price.type')
121 j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
122
123 result = 0.0
124
125 if j_id.type <> 'sale':
126 a = prod.product_tmpl_id.property_account_expense.id
127 if not a:
128 a = prod.categ_id.property_account_expense_categ.id
129 if not a:
130 raise osv.except_osv(_('Error !'),
131 _('There is no expense account defined ' \
132 'for this product: "%s" (id:%d)') % \
133 (prod.name, prod.id,))
134 else:
135 a = prod.product_tmpl_id.property_account_income.id
136 if not a:
137 a = prod.categ_id.property_account_income_categ.id
138 if not a:
139 raise osv.except_osv(_('Error !'),
140 _('There is no income account defined ' \
141 'for this product: "%s" (id:%d)') % \
142 (prod.name, prod_id,))
143
144 flag = False
145 # Compute based on pricetype
146 product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context=context)
147 pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
148 if journal_id:
149 journal = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
150 if journal.type == 'sale':
151 product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
152 if product_price_type_ids:
153 pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
154 # Take the company currency as the reference one
155 if pricetype.field == 'list_price':
156 flag = True
157 ctx = context.copy()
158 if unit:
159 # price_get() will respect a 'uom' in its context, in order
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches