summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpap (openerp) <pap@tinyerp.co.in>2010-07-13 12:51:02 +0530
committerpap (openerp) <pap@tinyerp.co.in>2010-07-13 12:51:02 +0530
commit6f8d4e5edf3176b95b05c1263a6578d282992f51 (patch)
tree26fb938306ce6434bb0b126f46e2f57aba49478b
parent73496a6c9e42ac8546fda7a5215c12d0c87a65b9 (diff)
[IMP]:improvement in project_* modules
bzr revid: pap@tinyerp.co.in-20100713072102-i0pn11yxexubdc8z
-rw-r--r--addons/project/__openerp__.py3
-rw-r--r--addons/project/project.py10
-rw-r--r--addons/project/project_demo.xml3
-rw-r--r--addons/project_gtd/__openerp__.py2
-rw-r--r--addons/project_gtd/project_gtd_view.xml2
-rw-r--r--addons/project_gtd/project_gtd_wizard.xml27
-rw-r--r--addons/project_gtd/wizard/__init__.py2
-rw-r--r--addons/project_gtd/wizard/project_gtd_daily.py51
-rw-r--r--addons/project_gtd/wizard/project_gtd_daily_view.xml46
-rw-r--r--addons/project_gtd/wizard/project_gtd_fill_view.xml4
-rw-r--r--addons/project_issue/project_issue.py2
-rw-r--r--addons/project_issue_sheet/project_issue_sheet.py9
-rw-r--r--addons/project_issue_sheet/project_issue_sheet_view.xml10
13 files changed, 31 insertions, 140 deletions
diff --git a/addons/project/__openerp__.py b/addons/project/__openerp__.py
index 726e87b5979..b5ff85fcc3c 100644
--- a/addons/project/__openerp__.py
+++ b/addons/project/__openerp__.py
@@ -56,7 +56,8 @@ work done on tasks, eso. It is able to render planning, order tasks, eso.
'board_project_demo.xml',
],
'test':[
- 'test/test_project.yml'
+ 'test/test_project.yml',
+ 'test/test_project_delegation.yml',
],
'installable': True,
'active': False,
diff --git a/addons/project/project.py b/addons/project/project.py
index 59e435f7dfa..12be7a0144d 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -355,6 +355,13 @@ class task(osv.osv):
if task['date_start'] > task['date_end']:
return False
return True
+
+ def _check_deadline_date(self, cr, uid, ids, context=None):
+ task = self.read(cr, uid, ids[0], ['date_start', 'date_deadline'])
+ if task['date_start'] and task['date_deadline']:
+ if task['date_deadline'] < task['date_start']:
+ return False
+ return True
_columns = {
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the task without removing it."),
@@ -403,7 +410,8 @@ class task(osv.osv):
_order = "sequence, priority, date_start, id"
_constraints = [
- (_check_dates, 'Error! task start-date must be lower then task end-date.', ['date_start', 'date_end'])
+ (_check_dates, 'Error! task start-date must be lower then task end-date.', ['date_start', 'date_end']),
+ (_check_deadline_date, 'Error! task deadline-date must be greater then task start-date.', ['date_deadline', 'date_start'])
]
#
# Override view according to the company definition
diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml
index 8b5e0ca89d8..34779ce4b3d 100644
--- a/addons/project/project_demo.xml
+++ b/addons/project/project_demo.xml
@@ -96,7 +96,6 @@
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="project_id" ref="project_project_21"/>
<field name="name">Internal testing + Software Install</field>
- <field name="date_deadline">2008-06-06</field>
</record>
<record id="project_task_188" model="project.task">
<field name="sequence">17</field>
@@ -210,7 +209,6 @@
<field name="project_id" ref="project_project_23"/>
<field name="state">open</field>
<field name="name">In house training</field>
- <field name="date_deadline">2007-06-06</field>
</record>
<record id="project_task_202" model="project.task">
<field name="sequence">50</field>
@@ -253,7 +251,6 @@
<field name="name">Latest in house tests</field>
</record>
<record id="project_message_1" model="project.message">
- <field name="date">2010-05-27</field>
<field name="project_id" ref="project.project_project_23"/>
<field name="user_id" ref="base.user_root"/>
<field name="description">Follow the procedure of Configuration wizard.
diff --git a/addons/project_gtd/__openerp__.py b/addons/project_gtd/__openerp__.py
index ba46d295234..971b2e8e324 100644
--- a/addons/project_gtd/__openerp__.py
+++ b/addons/project_gtd/__openerp__.py
@@ -43,10 +43,8 @@ performing those tasks.
'update_xml': [
'project_gtd_data.xml',
'project_gtd_view.xml',
- 'project_gtd_wizard.xml',
'security/ir.model.access.csv',
'wizard/project_gtd_empty_view.xml',
- 'wizard/project_gtd_daily_view.xml',
'wizard/project_gtd_fill_view.xml',
],
'demo_xml': ['project_gtd_demo.xml'],
diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml
index 919412cd27d..f880d6fc499 100644
--- a/addons/project_gtd/project_gtd_view.xml
+++ b/addons/project_gtd/project_gtd_view.xml
@@ -96,7 +96,7 @@
<field name="arch" type="xml">
<field name="progress" position="after">
<field name="context_id" widget="selection" groups="project_gtd.group_project_getting"/>
- <field name="timebox_id" select="1" groups="project_gtd.group_project_getting"/>
+ <field name="timebox_id" widget="selection" select="1" groups="project_gtd.group_project_getting"/>
</field>
</field>
</record>
diff --git a/addons/project_gtd/project_gtd_wizard.xml b/addons/project_gtd/project_gtd_wizard.xml
deleted file mode 100644
index e01db8218c6..00000000000
--- a/addons/project_gtd/project_gtd_wizard.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" ?>
-<openerp>
- <data>
-
- <!--<wizard string="My Daily Timebox"
- model="project.gtd.timebox"
- name="project.gtd.timebox.daily"
- id="open_gtd_timebox_daily"/>-->
-
-<!-- <menuitem name="My Daily Timebox" id="menu_open_time_daily_inbox" -->
-<!-- parent="menu_open_time" action="open_gtd_timebox_daily"-->
-<!-- icon="STOCK_JUSTIFY_FILL" type="wizard"/>-->
-
- <!-- <wizard string="Plannify Timebox"
- model="project.gtd.timebox"
- name="project.gtd.timebox.fill"
- id="open_gtd_timebox_fill"/>
-
--->
- <!--<wizard string="Empty Timebox"
- model="project.gtd.timebox"
- name="project.gtd.timebox.empty"
- id="open_gtd_timebox_empty"/>
--->
-
- </data>
-</openerp>
diff --git a/addons/project_gtd/wizard/__init__.py b/addons/project_gtd/wizard/__init__.py
index e92fa265ed3..aa2bbc22c45 100644
--- a/addons/project_gtd/wizard/__init__.py
+++ b/addons/project_gtd/wizard/__init__.py
@@ -19,8 +19,8 @@
#
##############################################################################
-import project_gtd_daily
import project_gtd_empty
import project_gtd_fill
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_gtd/wizard/project_gtd_daily.py b/addons/project_gtd/wizard/project_gtd_daily.py
deleted file mode 100644
index bacc1af85d9..00000000000
--- a/addons/project_gtd/wizard/project_gtd_daily.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-from osv import osv, fields
-from tools.translate import _
-
-class project_timebox_open(osv.osv_memory):
-
- _name = 'project.timebox.open'
- _description = 'Project Timebox Open'
-
- def open_tb(self, cr, uid, data, context=None):
- ids = self.pool.get('project.gtd.timebox').search(cr, uid, [])
- if not len(ids):
- raise osv.except_osv(_('Error !'), _('No timebox of the type defined !'))
- if len(ids) >= 1:
- domain = "[('id','in',["+','.join(map(str, ids))+"])]"
- value = {
- 'domain': domain,
- 'name': 'My Daily Timebox',
- 'view_type': 'form',
- 'view_mode': 'form,tree',
- 'res_model': 'project.gtd.timebox',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- if len(ids) == 1:
- value['res_id'] = ids[0]
- value['context'] = {'record_id':ids[0]}
- return value
-
-project_timebox_open()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/addons/project_gtd/wizard/project_gtd_daily_view.xml b/addons/project_gtd/wizard/project_gtd_daily_view.xml
deleted file mode 100644
index c49585f9112..00000000000
--- a/addons/project_gtd/wizard/project_gtd_daily_view.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <record id="view_project_gtd_daily" model="ir.ui.view">
- <field name="name">My Daily Timebox</field>
- <field name="model">project.timebox.open</field>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <form string="My Daily Timebox">
- <group width="340" height="70">
- <label string="You can open Daily Timebox"/>
- <newline/>
- <group>
- <button icon="gtk-cancel" special="cancel" string="_Cancel"/>
- <button name="open_tb" icon="gtk-ok" string="_Open Timebox" type="object" default_focus="1"/>
- </group>
- </group>
- </form>
- </field>
- </record>
-
- <record id="action_project_gtd_daily" model="ir.actions.act_window">
- <field name="name">My Daily Timebox</field>
- <field name="type">ir.actions.act_window</field>
- <field name="res_model">project.timebox.open</field>
- <field name="view_type">form</field>
- <field name="view_mode">form</field>
- <field name="view_id" ref="view_project_gtd_daily"/>
- <field name="context">{'record_id' : active_id}</field>
- <field name="target">new</field>
- </record>
-
- <record model="ir.values" id="project_gtd_daily_values">
- <field name="model_id" ref="model_project_gtd_timebox" />
- <field name="object" eval="1" />
- <field name="name">My Daily Timebox</field>
- <field name="key2">client_action_multi</field>
- <field name="value" eval="'ir.actions.act_window,' + str(ref('action_project_gtd_daily'))" />
- <field name="key">action</field>
- <field name="model">project.gtd.timebox</field>
- </record>
-
-
- </data>
-</openerp> \ No newline at end of file
diff --git a/addons/project_gtd/wizard/project_gtd_fill_view.xml b/addons/project_gtd/wizard/project_gtd_fill_view.xml
index 1c3d221c6ac..6206a0a5d89 100644
--- a/addons/project_gtd/wizard/project_gtd_fill_view.xml
+++ b/addons/project_gtd/wizard/project_gtd_fill_view.xml
@@ -8,8 +8,8 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Plannify Timebox">
- <field name="timebox_id" />
- <field name="timebox_to_id" />
+ <field name="timebox_id" widget="selection"/>
+ <field name="timebox_to_id" widget="selection"/>
<field colspan="4" name="task_ids" nolabel="1" domain="[('timebox_id','=',timebox_id),('state','=','open')]" />
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index ed648fb2969..7799d675bf2 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -297,6 +297,8 @@ class project_issue(osv.osv, crm.crm_case):
cases = self.browse(cr, uid, ids)
for case in cases:
data = {}
+ if case.task_id:
+ raise osv.except_osv(_('Warning !'), _('You cannot escalate this issue.\nThe relevant Project has not configured the Escalation Project!'))
if case.project_id.project_escalation_id:
data['project_id'] = case.project_id.project_escalation_id.id
if case.project_id.project_escalation_id.user_id:
diff --git a/addons/project_issue_sheet/project_issue_sheet.py b/addons/project_issue_sheet/project_issue_sheet.py
index 132fa50189b..d4c9240cae1 100644
--- a/addons/project_issue_sheet/project_issue_sheet.py
+++ b/addons/project_issue_sheet/project_issue_sheet.py
@@ -48,6 +48,15 @@ class hr_analytic_issue(osv.osv):
_columns = {
'issue_id' : fields.many2one('project.issue', 'Issue'),
}
+
+ def _get_analytic_account(self, cr, uid, context={}):
+ if context.get('account_id', False):
+ return context.get('account_id')
+ return False
+
+ _defaults = {
+ 'account_id' : _get_analytic_account,
+ }
hr_analytic_issue()
diff --git a/addons/project_issue_sheet/project_issue_sheet_view.xml b/addons/project_issue_sheet/project_issue_sheet_view.xml
index 0ff6413b226..655aced25c1 100644
--- a/addons/project_issue_sheet/project_issue_sheet_view.xml
+++ b/addons/project_issue_sheet/project_issue_sheet_view.xml
@@ -10,13 +10,13 @@
<notebook colspan="4">
<page string="Worklogs">
<field name="analytic_account_id" invisible="1"/>
- <field name="timesheet_ids" colspan="4" nolabel="1" context="{'default_user_id' : user_id, 'default_account_id' : analytic_account_id}">
+ <field name="timesheet_ids" colspan="4" nolabel="1" default_get="{'account_id':project_id}" context="{'default_user_id' : user_id, 'default_account_id' : analytic_account_id}">
<tree editable="top" string="Timesheet">
- <field name="date"/>
+ <field name="name"/>
+ <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
+ <field name="account_id" invisible="0" domain="[('partner_id', '=', parent.partner_id)]" on_change="on_change_account_id(account_id)"/>
<field name="user_id"/>
- <field name="account_id" invisible="0" domain="[('partner_id', '=', parent.partner_id)]" on_change="on_change_account_id(account_id)"/>
- <field name="name"/>
- <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
+ <field name="date"/>
<field invisible="1" name="journal_id"/>
<field invisible="1" name="product_id"/>
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>