From c169237260709f16300e08db5578468d6bb27e75 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 26 Jul 2010 15:11:14 +0530 Subject: [PATCH] [FIX/IMP] Project/Project_issue : Improvements lp bug: https://launchpad.net/bugs/609023 fixed bzr revid: jvo@tinyerp.com-20100726094114-rl6nd2u4r52je3t1 --- addons/project/project.py | 11 +---------- addons/project/project_view.xml | 3 +-- addons/project_issue/project_issue.py | 17 +++++++++++++++-- addons/project_issue/project_issue_view.xml | 18 ++++++++++++++++++ 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 816e85c29b4..3f7412fa8dc 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -134,7 +134,6 @@ class project(osv.osv): 'warn_header': fields.text('Mail Header', help="Header added at the beginning of the email for the warning message sent to the customer when a task is closed."), 'warn_footer': fields.text('Mail Footer', help="Footer added at the beginning of the email for the warning message sent to the customer when a task is closed."), 'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages'), - 'project_escalation_id': fields.many2one('project.project','Project Escalation', help='If any issue is escalated from the current Project, it will be listed under the project selected here.'), } _order = "sequence" @@ -153,16 +152,8 @@ class project(osv.osv): return False return True - def _check_escalation(self, cr, uid, ids): - project_obj = self.browse(cr, uid, ids[0]) - if project_obj.project_escalation_id: - if project_obj.project_escalation_id.id == project_obj.id: - return False - return True - _constraints = [ - (_check_dates, 'Error! project start-date must be lower then project end-date.', ['date_start', 'date']), - (_check_escalation, 'Error! You cannot assign escalation to the same project!', ['project_escalation_id']) + (_check_dates, 'Error! project start-date must be lower then project end-date.', ['date_start', 'date']) ] def set_template(self, cr, uid, ids, context=None): diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index ce92e9875fa..850cef4eda6 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -40,7 +40,6 @@ - @@ -166,7 +165,7 @@ {'search_default_Current':1} - Consult and define yours projects here. A project content a set of related activities that will be performed by your company. Any project can be put into a hierarchy, as a child of a Parent Project. This allows you to design large project structure very useful for work organization. + Consult and define your projects here. A project contains a set of related activities that will be performed by your company. Any project can be put into a hierarchy, as a child of a Parent Project. This allows you to design large project structure very useful for work organization. diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 4b070a6682b..b61c4a03c0b 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -181,7 +181,7 @@ class project_issue(osv.osv, crm.crm_case): method=True, multi='day_open', type="float", store=True), 'day_close': fields.function(_compute_day, string='Days to Close', \ method=True, multi='day_close', type="float", store=True), - 'assigned_to': fields.related('task_id', 'user_id', type='many2one', relation='res.users', string='Assigned to', help='This is the current user to whom the related task have been assigned', readonly=True), + 'assigned_to': fields.many2one('res.users', 'Assigned to', help='This is the current user to whom the related task have been assigned'), 'working_hours_open': fields.function(_compute_day, string='Working Hours to Open the Issue', \ method=True, multi='working_days_open', type="float", store=True), 'working_hours_close': fields.function(_compute_day, string='Working Hours to Close the Issue', \ @@ -406,8 +406,21 @@ project_issue() class project(osv.osv): _inherit = "project.project" _columns = { - 'resource_calendar_id': fields.many2one('resource.calendar', 'Working Time', help="Timetable working hours to adjust the gantt diagram report"), + 'resource_calendar_id' : fields.many2one('resource.calendar', 'Working Time', help="Timetable working hours to adjust the gantt diagram report"), + 'project_escalation_id' : fields.many2one('project.project','Project Escalation', help='If any issue is escalated from the current Project, it will be listed under the project selected here.'), + 'reply_to' : fields.char('Reply-To Email Address', size=256) } + + def _check_escalation(self, cr, uid, ids): + project_obj = self.browse(cr, uid, ids[0]) + if project_obj.project_escalation_id: + if project_obj.project_escalation_id.id == project_obj.id: + return False + return True + + _constraints = [ + (_check_escalation, 'Error! You cannot assign escalation to the same project!', ['project_escalation_id']) + ] project() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 766850038c6..3845cf6bce0 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -286,5 +286,23 @@ + # ------------------------------------------------------ + # Project + # ------------------------------------------------------ + + + project.project.form.inherited + project.project + form + + + + + + + + + +