From 0e90703ad0d1727c7a4511e30f335c0a3667357c Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Mon, 28 May 2012 18:00:54 +0530 Subject: [IMP]add boolean of project,projec_longterm,and project issue and create related project bzr revid: sgo@tinyerp.com-20120528123054-ntp1u33q1iavwtej --- addons/project_issue/project_issue.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 176ffa61acd..d49631fb771 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -512,14 +512,9 @@ class project(osv.osv): _columns = { '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.', states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'reply_to' : fields.char('Reply-To Email Address', size=256), - 'use_issues' : fields.boolean('Use Issues', help="Check this field if this project manages issues"), 'issue_count': fields.function(_issue_count, type='integer'), } - _defaults = { - 'use_issues': True, - } - def _check_escalation(self, cr, uid, ids, context=None): project_obj = self.browse(cr, uid, ids[0], context=context) if project_obj.project_escalation_id: @@ -532,4 +527,26 @@ class project(osv.osv): ] project() +class account_analytic_account(osv.osv): + + _inherit = 'account.analytic.account' + _description = 'Analytic Account' + + _columns = { + 'use_issues' : fields.boolean('Issue Tracking:', help="Check this field if this project manages issues"), + } +# _defaults = { +# 'use_issues': True, +# } + + def create(self, cr, uid, vals, context=None): + if context is None: + context = {} + obj_id = super(account_analytic_account, self).create(cr, uid, vals, context=context) + if vals.get('use_issues', False): + self.project_create(cr, uid, obj_id, vals, context) + return obj_id + +account_analytic_account() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: -- cgit v1.2.3 From 87040b2390a496a96c2c69e09cfb2f19769b1f27 Mon Sep 17 00:00:00 2001 From: "Amit Patel (OpenERP)" Date: Wed, 30 May 2012 12:29:34 +0530 Subject: [IMP]:project:improved project view bzr revid: apa@tinyerp.com-20120530065934-qpo4hsv4pcyhngjr --- addons/project_issue/project_issue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index d49631fb771..0c4b6af0956 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -533,7 +533,7 @@ class account_analytic_account(osv.osv): _description = 'Analytic Account' _columns = { - 'use_issues' : fields.boolean('Issue Tracking:', help="Check this field if this project manages issues"), + 'use_issues' : fields.boolean('Issues Tracking', help="Check this field if this project manages issues"), } # _defaults = { # 'use_issues': True, -- cgit v1.2.3 From 03dcaabc647307036ed5296d366cc6e5a3c35974 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 1 Jun 2012 16:51:34 +0200 Subject: [FIX] typo: the label 'Stage' should remain singular, not plural bzr revid: abo@openerp.com-20120601145134-pd660jzsl5bv409x --- addons/project_issue/project_issue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 177c21570cd..e1ba4216fdb 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -241,7 +241,7 @@ class project_issue(base_stage, osv.osv): 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('object_id.model', '=', 'crm.project.bug')]"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'version_id': fields.many2one('project.issue.version', 'Version'), - 'stage_id': fields.many2one ('project.task.type', 'Stages', + 'stage_id': fields.many2one ('project.task.type', 'Stage', domain="['|', ('project_ids', '=', project_id), ('case_default', '=', True)]"), 'project_id':fields.many2one('project.project', 'Project'), 'duration': fields.float('Duration'), -- cgit v1.2.3 From bb5f7d384d574461fc031de1cf41181a5bd6a90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 4 Jun 2012 16:12:54 +0200 Subject: [IMP] crm_lead, crm_claim, crm_fundraising, crm_helpdesk, hr_recruitment, project_issue, project_mailgate: cleaned and updated message_new and message_update to have a cleaner mailgate. Deleted references to state update. bzr revid: tde@openerp.com-20120604141254-4m2tnzwi88w8h2aj --- addons/project_issue/project_issue.py | 77 +++++++++++++++-------------------- 1 file changed, 32 insertions(+), 45 deletions(-) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index ad6e7afdbcc..78b58ccd5d7 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -467,69 +467,56 @@ class project_issue(base_stage, osv.osv): # ------------------------------------------------------- def message_new(self, cr, uid, msg, custom_values=None, context=None): - """Automatically called when new email message arrives""" - if context is None: - context = {} - subject = msg.get('subject') or _('No Title') - body = msg.get('body_text') - msg_from = msg.get('from') - priority = msg.get('priority') - vals = { - 'name': subject, - 'email_from': msg_from, + """ Overrides mail_thread message_new that is called by the mailgateway + through message_process. + This override updates the document according to the email. + """ + if custom_values is None: custom_values = {} + if context is None: context = {} + context['state_to'] = 'draft' + + custom_values.update({ + 'name': msg.get('subject') or _("No Subject"), + 'description': msg.get('body_text'), + 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), - 'description': body, 'user_id': False, - } - if priority: - vals['priority'] = priority - vals.update(self.message_partner_by_email(cr, uid, msg_from)) - context.update({'state_to' : 'draft'}) - - if custom_values and isinstance(custom_values, dict): - vals.update(custom_values) + }) + if msg.get('priority'): + custom_values['priority'] = msg.get('priority') + custom_values.update(self.message_partner_by_email(cr, uid, msg.get('from'), context=context)) - res_id = self.create(cr, uid, vals, context) - self.message_append_dict(cr, uid, [res_id], msg, context=context) + res_id = super(project_issue, self).message_new(cr, uid, msg, custom_values=custom_values, context=context) self.convert_to_bug(cr, uid, [res_id], context=context) return res_id - def message_update(self, cr, uid, ids, msg, vals=None, default_act='pending', context=None): - if vals is None: - vals = {} - + def message_update(self, cr, uid, ids, msg, update_vals=None, context=None): + """ Overrides mail_thread message_update that is called by the mailgateway + through message_process. + This method updates the document according to the email. + """ if isinstance(ids, (str, int, long)): ids = [ids] + if update_vals is None: update_vals = {} - vals.update({ - 'description': msg['body_text'] - }) - if msg.get('priority', False): - vals['priority'] = msg.get('priority') - + # Update doc values according to the message + update_vals['description'] = msg.get('body_text', '') + if msg.get('priority'): + update_vals['priority'] = msg.get('priority') + # Parse 'body_text' to find values to update maps = { 'cost': 'planned_cost', 'revenue': 'planned_revenue', - 'probability': 'probability' + 'probability': 'probability', } - - # Reassign the 'open' state to the case if this one is in pending or done - for record in self.browse(cr, uid, ids, context=context): - if record.state in ('pending', 'done'): - self.case_set(cr, uid, ids, 'open', {}, context=context) - - vls = { } - for line in msg['body_text'].split('\n'): + for line in msg.get('body_text', '').split('\n'): line = line.strip() res = tools.misc.command_re.match(line) if res and maps.get(res.group(1).lower(), False): key = maps.get(res.group(1).lower()) - vls[key] = res.group(2).lower() + update_vals[key] = res.group(2).lower() - vals.update(vls) - res = self.write(cr, uid, ids, vals) - self.message_append_dict(cr, uid, ids, msg, context=context) - return res + return super(project_issue, self).message_update(cr, uid, ids, update_vals=update_vals, context=context) # ------------------------------------------------------- # OpenChatter methods and notifications -- cgit v1.2.3 From 6aa0ca7a7e2f03edcd614cfa48831f67f83d58d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 5 Jun 2012 14:22:21 +0200 Subject: [IMP] mail_thread: cleaned message_get_subscribers and related methods; propagated change so that project_issue, mrp, crm_lead, project, project_task, hr_recruitment and hr_holidays now cleanly override message_get_subscribers. bzr revid: tde@openerp.com-20120605122221-nvxfxfcx5o82vkvx --- addons/project_issue/project_issue.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 78b58ccd5d7..8c61b19fae2 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -530,11 +530,12 @@ class project_issue(base_stage, osv.osv): return result def message_get_subscribers(self, cr, uid, ids, context=None): - sub_ids = self.message_get_subscribers_ids(cr, uid, ids, context=context); + """ Override to add responsible user. """ + user_ids = super(project_issue, self).message_get_subscribers(cr, uid, ids, context=context) for obj in self.browse(cr, uid, ids, context=context): - if obj.user_id: - sub_ids.append(obj.user_id.id) - return self.pool.get('res.users').read(cr, uid, sub_ids, context=context) + if obj.user_id and not obj.user_id.id in user_ids: + user_ids.append(obj.user_id.id) + return user_ids def stage_set_send_note(self, cr, uid, ids, stage_id, context=None): """ Override of the (void) default notification method. """ -- cgit v1.2.3 From 06c234a6c1589f84f452a287f1699918296554fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 7 Jun 2012 17:25:36 +0200 Subject: [REM] project_oissue, crm_meeting, project, hr_recruitment: removed get_needaction_user_ids definition, as the default behavior of mail.thread is sufficient. bzr revid: tde@openerp.com-20120607152536-h9vwg2t4ser8f3v2 --- addons/project_issue/project_issue.py | 7 ------- 1 file changed, 7 deletions(-) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 8c61b19fae2..743825e353f 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -522,13 +522,6 @@ class project_issue(base_stage, osv.osv): # OpenChatter methods and notifications # ------------------------------------------------------- - def get_needaction_user_ids(self, cr, uid, ids, context=None): - result = dict.fromkeys(ids, []) - for obj in self.browse(cr, uid, ids, context=context): - if obj.state == 'draft' and obj.user_id: - result[obj.id] = [obj.user_id.id] - return result - def message_get_subscribers(self, cr, uid, ids, context=None): """ Override to add responsible user. """ user_ids = super(project_issue, self).message_get_subscribers(cr, uid, ids, context=context) -- cgit v1.2.3 From b2a5ab368d64559375a861de6270f0d9ef3e5667 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 13 Jun 2012 12:07:31 +0200 Subject: [IMP] account_analytic_analysis: code improved for automation of project creation bzr revid: qdp-launchpad@openerp.com-20120613100731-9so4m41fz7yrtb5w --- addons/project_issue/project_issue.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 7d2337b7690..c7f72d04e32 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -614,17 +614,10 @@ class account_analytic_account(osv.osv): _columns = { 'use_issues' : fields.boolean('Issues Tracking', help="Check this field if this project manages issues"), } -# _defaults = { -# 'use_issues': True, -# } - def create(self, cr, uid, vals, context=None): - if context is None: - context = {} - obj_id = super(account_analytic_account, self).create(cr, uid, vals, context=context) - if vals.get('use_issues', False): - self.project_create(cr, uid, obj_id, vals, context) - return obj_id + def _trigger_project_creation(vals): + res = super(account_analytic_account, self)._trigger_project_creation(vals) + return res or vals.get('use_issues') account_analytic_account() -- cgit v1.2.3 From dc1edf44be5593f9048f442a8aec68ae5250d953 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 14 Jun 2012 12:09:22 +0200 Subject: [IMP] project: implemented the privacy/visibility record rule in a cleaner way + some cleanup and bug fixing related to contract management bzr revid: qdp-launchpad@openerp.com-20120614100922-5g29ui88nhqojon2 --- addons/project_issue/project_issue.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index c7f72d04e32..976a706ac54 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -607,7 +607,6 @@ class project(osv.osv): project() class account_analytic_account(osv.osv): - _inherit = 'account.analytic.account' _description = 'Analytic Account' @@ -615,8 +614,8 @@ class account_analytic_account(osv.osv): 'use_issues' : fields.boolean('Issues Tracking', help="Check this field if this project manages issues"), } - def _trigger_project_creation(vals): - res = super(account_analytic_account, self)._trigger_project_creation(vals) + def _trigger_project_creation(self, cr, uid, vals, context=None): + res = super(account_analytic_account, self)._trigger_project_creation(cr, uid, vals, context=context) return res or vals.get('use_issues') account_analytic_account() -- cgit v1.2.3 From 1b7487b0ccb85904095a67f06455d5d62ac5872c Mon Sep 17 00:00:00 2001 From: Tejas Tank Date: Tue, 26 Jun 2012 15:59:45 +0530 Subject: kanban project.issue bzr revid: tta@openerp.com-20120626102945-2yk3zdntgu2nui2l --- addons/project_issue/project_issue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index ad6e7afdbcc..127de5dae37 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -288,7 +288,7 @@ class project_issue(base_stage, osv.osv): 'stage_id': _read_group_stage_ids } - def set_priority(self, cr, uid, ids, priority): + def set_priority(self, cr, uid, ids, priority, *args): """Set lead priority """ return self.write(cr, uid, ids, {'priority' : priority}) -- cgit v1.2.3 From 788748604fcbb9eda51cb61bf400072d58272fd3 Mon Sep 17 00:00:00 2001 From: Tejas Tank Date: Wed, 27 Jun 2012 16:06:10 +0530 Subject: [IMP] kanban : project.task, project.issue, hr.applicant bzr revid: tta@openerp.com-20120627103610-1uwuz2geen0psq5j --- addons/project_issue/project_issue.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'addons/project_issue/project_issue.py') diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 127de5dae37..9963fc59cb0 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -222,6 +222,11 @@ class project_issue(base_stage, osv.osv): select=True, help='Sales team to which Case belongs to.\ Define Responsible user and Email account for mail gateway.'), 'partner_id': fields.many2one('res.partner', 'Partner', select=1), + 'partner_street': fields.related('partner_id', 'street', type='char', string='Street', readonly=True), + 'partner_city': fields.related('partner_id', 'city', type='char', string='City', readonly=True), + 'partner_state_id': fields.related('partner_id', 'state_id', type='char', string='State', readonly=True), + 'partner_country_id': fields.related('partner_id', 'country_id', type='char', string='Country', readonly=True), + 'partner_phone': fields.related('partner_id', 'phone', type='char', string='Phone', readonly=True), 'company_id': fields.many2one('res.company', 'Company'), 'description': fields.text('Description'), 'state': fields.related('stage_id', 'state', type="selection", store=True, -- cgit v1.2.3