summaryrefslogtreecommitdiff
path: root/addons/project_issue
diff options
context:
space:
mode:
authorFrederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com>2014-08-25 16:42:57 +0200
committerFrederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com>2014-08-25 16:42:57 +0200
commitd7f93defb899b2b48a14d679e5dffffdb4a00eff (patch)
treef8572183b480477622917a1f504cf49a8e202f6e /addons/project_issue
parent2b67528fe9e366829d44d8aba756bc6e359b4c61 (diff)
parent36146b3fadc47543f4b696ab75c31b3459afb15b (diff)
Merge branch 'master' into master-pos-new-payment-screen-fva
Conflicts: addons/point_of_sale/point_of_sale.py addons/point_of_sale/point_of_sale_view.xml
Diffstat (limited to 'addons/project_issue')
-rw-r--r--addons/project_issue/project_issue.py9
-rw-r--r--addons/project_issue/project_issue_menu.xml2
-rw-r--r--addons/project_issue/project_issue_view.xml4
-rw-r--r--addons/project_issue/report/project_issue_report.py17
-rw-r--r--addons/project_issue/report/project_issue_report_view.xml5
5 files changed, 18 insertions, 19 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 0c3ba5683fd..56a9799786b 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -21,6 +21,7 @@
from datetime import datetime
+from openerp import api
from openerp import SUPERUSER_ID
from openerp import tools
from openerp.osv import fields, osv, orm
@@ -449,6 +450,7 @@ class project_issue(osv.Model):
res_id = super(project_issue, self).message_new(cr, uid, msg, custom_values=defaults, context=context)
return res_id
+ @api.cr_uid_ids_context
def message_post(self, cr, uid, thread_id, body='', subject=None, type='notification', subtype=None, parent_id=False, attachments=None, context=None, content_subtype='html', **kwargs):
""" Overrides mail_thread message_post so that we can set the date of last action field when
a new message is posted on the issue.
@@ -515,6 +517,13 @@ class account_analytic_account(osv.Model):
res = super(account_analytic_account, self)._trigger_project_creation(cr, uid, vals, context=context)
return res or (vals.get('use_issues') and not 'project_creation_in_progress' in context)
+ def unlink(self, cr, uid, ids, context=None):
+ proj_ids = self.pool['project.project'].search(cr, uid, [('analytic_account_id', 'in', ids)])
+ has_issues = self.pool['project.issue'].search(cr, uid, [('project_id', 'in', proj_ids)], count=True, context=context)
+ if has_issues:
+ raise osv.except_osv(_('Warning!'), _('Please remove existing issues in the project linked to the accounts you want to delete.'))
+ return super(account_analytic_account, self).unlink(cr, uid, ids, context=context)
+
class project_project(osv.Model):
_inherit = 'project.project'
diff --git a/addons/project_issue/project_issue_menu.xml b/addons/project_issue/project_issue_menu.xml
index 308b4884844..26981256c7f 100644
--- a/addons/project_issue/project_issue_menu.xml
+++ b/addons/project_issue/project_issue_menu.xml
@@ -15,7 +15,7 @@
<field name="search_view_id" ref="view_project_issue_filter"/>
<field name="help" type="html">
<p>
- The OpenERP issues tacker allows you to efficiantly manage things
+ The Odoo issues tacker allows you to efficiantly manage things
like internal requests, software development bugs, customer
complaints, project troubles, material breakdowns, etc.
</p>
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index 1047fef10e6..502598193a6 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -266,7 +266,7 @@
</field>
<field name="help" type="html">
<p>
- The OpenERP issues tacker allows you to efficiantly manage things
+ The Odoo issues tacker allows you to efficiantly manage things
like internal requests, software development bugs, customer
complaints, project troubles, material breakdowns, etc.
</p>
@@ -340,7 +340,7 @@
<field name="view_mode">kanban,tree,form,calendar,graph</field>
<field name="help" type="html">
<p>
- The OpenERP issues tacker allows you to efficiantly manage things
+ The Odoo issues tacker allows you to efficiantly manage things
like internal requests, software development bugs, customer
complaints, project troubles, material breakdowns, etc.
</p>
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index 5ac7b6e48c6..2ab9b1a0da4 100644
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -29,13 +29,10 @@ class project_issue_report(osv.osv):
_auto = False
_columns = {
- 'name': fields.char('Year', size=64, required=False, readonly=True),
'section_id':fields.many2one('crm.case.section', 'Sale Team', readonly=True),
- 'month':fields.selection(fields.date.MONTHS, 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
- 'day': fields.char('Day', size=128, readonly=True),
'opening_date': fields.date('Date of Opening', readonly=True),
- 'creation_date': fields.date('Creation Date', readonly=True),
+ 'create_date': fields.date('Create Date', readonly=True),
'date_closed': fields.date('Date of Closing', readonly=True),
'date_last_stage_update': fields.date('Last Stage Update', readonly=True),
'stage_id': fields.many2one('project.task.type', 'Stage'),
@@ -63,18 +60,15 @@ class project_issue_report(osv.osv):
CREATE OR REPLACE VIEW project_issue_report AS (
SELECT
c.id as id,
- to_char(c.create_date, 'YYYY') as name,
- to_char(c.create_date, 'MM') as month,
- to_char(c.create_date, 'YYYY-MM-DD') as day,
- to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
- to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
- date_trunc('day',c.date_last_stage_update) as date_last_stage_update,
+ date(c.date_open) as opening_date,
+ date(c.create_date) as create_date,
+ date(c.date_last_stage_update) as date_last_stage_update,
c.user_id,
c.working_hours_open,
c.working_hours_close,
c.section_id,
c.stage_id,
- to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
+ date(c.date_closed) as date_closed,
c.company_id as company_id,
c.priority as priority,
c.project_id as project_id,
@@ -83,7 +77,6 @@ class project_issue_report(osv.osv):
c.partner_id,
c.channel,
c.task_id,
- date_trunc('day',c.create_date) as create_date,
c.day_open as delay_open,
c.day_close as delay_close,
(SELECT count(id) FROM mail_message WHERE model='project.issue' AND res_id=c.id) AS email
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index 8de0e7e47bc..3382c6e3625 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -34,7 +34,6 @@
<field name="model">project.issue.report</field>
<field name="arch" type="xml">
<search string="Search">
- <field name="creation_date"/>
<field name="project_id"/>
<field name="user_id"/>
<field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
@@ -54,9 +53,7 @@
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
- <filter string="Day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}" help="Creation Date"/>
- <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'month'}" help="Creation Date"/>
- <filter string="Year" icon="terp-go-year" domain="[]" context="{'group_by':'name'}" help="Creation Date"/>
+ <filter string="Create Date" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" help="Create Date"/>
<filter string="Last Stage Update" context="{'group_by':'date_last_stage_update'}"/>
</group>
</search>