[IMP]:improvement in project_* modules

bzr revid: pap@tinyerp.co.in-20100713072102-i0pn11yxexubdc8z
This commit is contained in:
pap (openerp)
2010-07-13 12:51:02 +05:30
parent 73496a6c9e
commit 6f8d4e5edf
13 changed files with 31 additions and 140 deletions
+2 -1
View File
@@ -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,
+9 -1
View File
@@ -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
-3
View File
@@ -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.
-2
View File
@@ -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'],
+1 -1
View File
@@ -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>
-27
View File
@@ -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>
+1 -1
View File
@@ -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:
@@ -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:
@@ -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>
@@ -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"/>
+2
View File
@@ -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:
@@ -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()
@@ -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)"/>