diff --git a/.tx/config b/.tx/config index b09a0702e25..c119721519d 100644 --- a/.tx/config +++ b/.tx/config @@ -192,9 +192,9 @@ file_filter = addons/crm_phone_validation/i18n/.po source_file = addons/crm_phone_validation/i18n/crm_phone_validation.pot source_lang = en -[odoo-master.crm_project_issue] -file_filter = addons/crm_project_issue/i18n/.po -source_file = addons/crm_project_issue/i18n/crm_project_issue.pot +[odoo-master.crm_project] +file_filter = addons/crm_project/i18n/.po +source_file = addons/crm_project/i18n/crm_project.pot source_lang = en [odoo-master.decimal_precision] @@ -567,16 +567,6 @@ file_filter = addons/project/i18n/.po source_file = addons/project/i18n/project.pot source_lang = en -[odoo-master.project_issue] -file_filter = addons/project_issue/i18n/.po -source_file = addons/project_issue/i18n/project_issue.pot -source_lang = en - -[odoo-master.project_issue_sheet] -file_filter = addons/project_issue_sheet/i18n/.po -source_file = addons/project_issue_sheet/i18n/project_issue_sheet.pot -source_lang = en - [odoo-master.project_timesheet_holidays] file_filter = addons/project_timesheet_holidays/i18n/.po source_file = addons/project_timesheet_holidays/i18n/project_timesheet_holidays.pot @@ -607,11 +597,6 @@ file_filter = addons/rating_project/i18n/.po source_file = addons/rating_project/i18n/rating_project.pot source_lang = en -[odoo-master.rating_project_issue] -file_filter = addons/rating_project_issue/i18n/.po -source_file = addons/rating_project_issue/i18n/rating_project_issue.pot -source_lang = en - [odoo-master.report] file_filter = addons/report/i18n/.po source_file = addons/report/i18n/report.pot @@ -902,16 +887,6 @@ file_filter = addons/website_project/i18n/.po source_file = addons/website_project/i18n/website_project.pot source_lang = en -[odoo-master.website_project_issue] -file_filter = addons/website_project_issue/i18n/.po -source_file = addons/website_project_issue/i18n/website_project_issue.pot -source_lang = en - -[odoo-master.website_project_issue_sheet] -file_filter = addons/website_project_issue_sheet/i18n/.po -source_file = addons/website_project_issue_sheet/i18n/website_project_issue_sheet.pot -source_lang = en - [odoo-master.website_project_timesheet] file_filter = addons/website_project_timesheet/i18n/.po source_file = addons/website_project_timesheet/i18n/website_project_timesheet.pot @@ -922,9 +897,9 @@ file_filter = addons/website_quote/i18n/.po source_file = addons/website_quote/i18n/website_quote.pot source_lang = en -[odoo-master.website_rating_project_issue] -file_filter = addons/website_rating_project_issue/i18n/.po -source_file = addons/website_rating_project_issue/i18n/website_rating_project_issue.pot +[odoo-master.website_rating_project] +file_filter = addons/website_rating_project/i18n/.po +source_file = addons/website_rating_project/i18n/website_rating_project.pot source_lang = en [odoo-master.website_sale] diff --git a/addons/crm_project_issue/__init__.py b/addons/crm_project/__init__.py similarity index 100% rename from addons/crm_project_issue/__init__.py rename to addons/crm_project/__init__.py diff --git a/addons/crm_project_issue/__manifest__.py b/addons/crm_project/__manifest__.py similarity index 57% rename from addons/crm_project_issue/__manifest__.py rename to addons/crm_project/__manifest__.py index 879a0a0b00d..f4a96def000 100644 --- a/addons/crm_project_issue/__manifest__.py +++ b/addons/crm_project/__manifest__.py @@ -1,21 +1,21 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { - 'name': 'Lead to Issue', - 'summary': 'Create Issues from Leads', + 'name': 'Lead to Tasks', + 'summary': 'Create Tasks from Leads', 'sequence': '19', 'category': 'Project', 'complexity': 'easy', 'description': """ -Lead to Issues -============== +Lead to Tasks +============= -Link module to map leads to issues +Link module to map leads to tasks """, 'data': [ 'security/ir.model.access.csv', - 'wizard/crm_lead2projectissue_wizard_view.xml', + 'wizard/crm_lead_convert2task_views.xml', 'views/crm_lead_views.xml' ], - 'depends': ['crm', 'project_issue'], + 'depends': ['crm', 'project'], } diff --git a/addons/crm_project_issue/i18n/af.po b/addons/crm_project/i18n/af.po similarity index 100% rename from addons/crm_project_issue/i18n/af.po rename to addons/crm_project/i18n/af.po diff --git a/addons/crm_project_issue/i18n/am.po b/addons/crm_project/i18n/am.po similarity index 100% rename from addons/crm_project_issue/i18n/am.po rename to addons/crm_project/i18n/am.po diff --git a/addons/crm_project_issue/i18n/ar.po b/addons/crm_project/i18n/ar.po similarity index 100% rename from addons/crm_project_issue/i18n/ar.po rename to addons/crm_project/i18n/ar.po diff --git a/addons/crm_project_issue/i18n/bg.po b/addons/crm_project/i18n/bg.po similarity index 100% rename from addons/crm_project_issue/i18n/bg.po rename to addons/crm_project/i18n/bg.po diff --git a/addons/crm_project_issue/i18n/bs.po b/addons/crm_project/i18n/bs.po similarity index 100% rename from addons/crm_project_issue/i18n/bs.po rename to addons/crm_project/i18n/bs.po diff --git a/addons/crm_project_issue/i18n/ca.po b/addons/crm_project/i18n/ca.po similarity index 100% rename from addons/crm_project_issue/i18n/ca.po rename to addons/crm_project/i18n/ca.po diff --git a/addons/crm_project_issue/i18n/crm_project_issue.pot b/addons/crm_project/i18n/crm_project.pot similarity index 100% rename from addons/crm_project_issue/i18n/crm_project_issue.pot rename to addons/crm_project/i18n/crm_project.pot diff --git a/addons/crm_project_issue/i18n/cs.po b/addons/crm_project/i18n/cs.po similarity index 100% rename from addons/crm_project_issue/i18n/cs.po rename to addons/crm_project/i18n/cs.po diff --git a/addons/crm_project_issue/i18n/da.po b/addons/crm_project/i18n/da.po similarity index 100% rename from addons/crm_project_issue/i18n/da.po rename to addons/crm_project/i18n/da.po diff --git a/addons/crm_project_issue/i18n/de.po b/addons/crm_project/i18n/de.po similarity index 100% rename from addons/crm_project_issue/i18n/de.po rename to addons/crm_project/i18n/de.po diff --git a/addons/crm_project_issue/i18n/el.po b/addons/crm_project/i18n/el.po similarity index 100% rename from addons/crm_project_issue/i18n/el.po rename to addons/crm_project/i18n/el.po diff --git a/addons/crm_project_issue/i18n/en_AU.po b/addons/crm_project/i18n/en_AU.po similarity index 100% rename from addons/crm_project_issue/i18n/en_AU.po rename to addons/crm_project/i18n/en_AU.po diff --git a/addons/crm_project_issue/i18n/en_GB.po b/addons/crm_project/i18n/en_GB.po similarity index 100% rename from addons/crm_project_issue/i18n/en_GB.po rename to addons/crm_project/i18n/en_GB.po diff --git a/addons/crm_project_issue/i18n/es.po b/addons/crm_project/i18n/es.po similarity index 100% rename from addons/crm_project_issue/i18n/es.po rename to addons/crm_project/i18n/es.po diff --git a/addons/crm_project_issue/i18n/es_AR.po b/addons/crm_project/i18n/es_AR.po similarity index 100% rename from addons/crm_project_issue/i18n/es_AR.po rename to addons/crm_project/i18n/es_AR.po diff --git a/addons/crm_project_issue/i18n/es_BO.po b/addons/crm_project/i18n/es_BO.po similarity index 100% rename from addons/crm_project_issue/i18n/es_BO.po rename to addons/crm_project/i18n/es_BO.po diff --git a/addons/crm_project_issue/i18n/es_CL.po b/addons/crm_project/i18n/es_CL.po similarity index 100% rename from addons/crm_project_issue/i18n/es_CL.po rename to addons/crm_project/i18n/es_CL.po diff --git a/addons/crm_project_issue/i18n/es_CO.po b/addons/crm_project/i18n/es_CO.po similarity index 100% rename from addons/crm_project_issue/i18n/es_CO.po rename to addons/crm_project/i18n/es_CO.po diff --git a/addons/crm_project_issue/i18n/es_CR.po b/addons/crm_project/i18n/es_CR.po similarity index 100% rename from addons/crm_project_issue/i18n/es_CR.po rename to addons/crm_project/i18n/es_CR.po diff --git a/addons/crm_project_issue/i18n/es_DO.po b/addons/crm_project/i18n/es_DO.po similarity index 100% rename from addons/crm_project_issue/i18n/es_DO.po rename to addons/crm_project/i18n/es_DO.po diff --git a/addons/crm_project_issue/i18n/es_EC.po b/addons/crm_project/i18n/es_EC.po similarity index 100% rename from addons/crm_project_issue/i18n/es_EC.po rename to addons/crm_project/i18n/es_EC.po diff --git a/addons/crm_project_issue/i18n/es_PA.po b/addons/crm_project/i18n/es_PA.po similarity index 100% rename from addons/crm_project_issue/i18n/es_PA.po rename to addons/crm_project/i18n/es_PA.po diff --git a/addons/crm_project_issue/i18n/es_PE.po b/addons/crm_project/i18n/es_PE.po similarity index 100% rename from addons/crm_project_issue/i18n/es_PE.po rename to addons/crm_project/i18n/es_PE.po diff --git a/addons/crm_project_issue/i18n/es_PY.po b/addons/crm_project/i18n/es_PY.po similarity index 100% rename from addons/crm_project_issue/i18n/es_PY.po rename to addons/crm_project/i18n/es_PY.po diff --git a/addons/crm_project_issue/i18n/es_VE.po b/addons/crm_project/i18n/es_VE.po similarity index 100% rename from addons/crm_project_issue/i18n/es_VE.po rename to addons/crm_project/i18n/es_VE.po diff --git a/addons/crm_project_issue/i18n/et.po b/addons/crm_project/i18n/et.po similarity index 100% rename from addons/crm_project_issue/i18n/et.po rename to addons/crm_project/i18n/et.po diff --git a/addons/crm_project_issue/i18n/eu.po b/addons/crm_project/i18n/eu.po similarity index 100% rename from addons/crm_project_issue/i18n/eu.po rename to addons/crm_project/i18n/eu.po diff --git a/addons/crm_project_issue/i18n/fa.po b/addons/crm_project/i18n/fa.po similarity index 100% rename from addons/crm_project_issue/i18n/fa.po rename to addons/crm_project/i18n/fa.po diff --git a/addons/crm_project_issue/i18n/fi.po b/addons/crm_project/i18n/fi.po similarity index 100% rename from addons/crm_project_issue/i18n/fi.po rename to addons/crm_project/i18n/fi.po diff --git a/addons/crm_project_issue/i18n/fo.po b/addons/crm_project/i18n/fo.po similarity index 100% rename from addons/crm_project_issue/i18n/fo.po rename to addons/crm_project/i18n/fo.po diff --git a/addons/crm_project_issue/i18n/fr.po b/addons/crm_project/i18n/fr.po similarity index 100% rename from addons/crm_project_issue/i18n/fr.po rename to addons/crm_project/i18n/fr.po diff --git a/addons/crm_project_issue/i18n/fr_BE.po b/addons/crm_project/i18n/fr_BE.po similarity index 100% rename from addons/crm_project_issue/i18n/fr_BE.po rename to addons/crm_project/i18n/fr_BE.po diff --git a/addons/crm_project_issue/i18n/fr_CA.po b/addons/crm_project/i18n/fr_CA.po similarity index 100% rename from addons/crm_project_issue/i18n/fr_CA.po rename to addons/crm_project/i18n/fr_CA.po diff --git a/addons/crm_project_issue/i18n/gl.po b/addons/crm_project/i18n/gl.po similarity index 100% rename from addons/crm_project_issue/i18n/gl.po rename to addons/crm_project/i18n/gl.po diff --git a/addons/crm_project_issue/i18n/gu.po b/addons/crm_project/i18n/gu.po similarity index 100% rename from addons/crm_project_issue/i18n/gu.po rename to addons/crm_project/i18n/gu.po diff --git a/addons/crm_project_issue/i18n/he.po b/addons/crm_project/i18n/he.po similarity index 100% rename from addons/crm_project_issue/i18n/he.po rename to addons/crm_project/i18n/he.po diff --git a/addons/crm_project_issue/i18n/hi.po b/addons/crm_project/i18n/hi.po similarity index 100% rename from addons/crm_project_issue/i18n/hi.po rename to addons/crm_project/i18n/hi.po diff --git a/addons/crm_project_issue/i18n/hr.po b/addons/crm_project/i18n/hr.po similarity index 100% rename from addons/crm_project_issue/i18n/hr.po rename to addons/crm_project/i18n/hr.po diff --git a/addons/crm_project_issue/i18n/hu.po b/addons/crm_project/i18n/hu.po similarity index 100% rename from addons/crm_project_issue/i18n/hu.po rename to addons/crm_project/i18n/hu.po diff --git a/addons/crm_project_issue/i18n/hy.po b/addons/crm_project/i18n/hy.po similarity index 100% rename from addons/crm_project_issue/i18n/hy.po rename to addons/crm_project/i18n/hy.po diff --git a/addons/crm_project_issue/i18n/id.po b/addons/crm_project/i18n/id.po similarity index 100% rename from addons/crm_project_issue/i18n/id.po rename to addons/crm_project/i18n/id.po diff --git a/addons/crm_project_issue/i18n/is.po b/addons/crm_project/i18n/is.po similarity index 100% rename from addons/crm_project_issue/i18n/is.po rename to addons/crm_project/i18n/is.po diff --git a/addons/crm_project_issue/i18n/it.po b/addons/crm_project/i18n/it.po similarity index 100% rename from addons/crm_project_issue/i18n/it.po rename to addons/crm_project/i18n/it.po diff --git a/addons/crm_project_issue/i18n/ja.po b/addons/crm_project/i18n/ja.po similarity index 100% rename from addons/crm_project_issue/i18n/ja.po rename to addons/crm_project/i18n/ja.po diff --git a/addons/crm_project_issue/i18n/ka.po b/addons/crm_project/i18n/ka.po similarity index 100% rename from addons/crm_project_issue/i18n/ka.po rename to addons/crm_project/i18n/ka.po diff --git a/addons/crm_project_issue/i18n/kab.po b/addons/crm_project/i18n/kab.po similarity index 100% rename from addons/crm_project_issue/i18n/kab.po rename to addons/crm_project/i18n/kab.po diff --git a/addons/crm_project_issue/i18n/kk.po b/addons/crm_project/i18n/kk.po similarity index 100% rename from addons/crm_project_issue/i18n/kk.po rename to addons/crm_project/i18n/kk.po diff --git a/addons/crm_project_issue/i18n/ko.po b/addons/crm_project/i18n/ko.po similarity index 100% rename from addons/crm_project_issue/i18n/ko.po rename to addons/crm_project/i18n/ko.po diff --git a/addons/crm_project_issue/i18n/ln.po b/addons/crm_project/i18n/ln.po similarity index 100% rename from addons/crm_project_issue/i18n/ln.po rename to addons/crm_project/i18n/ln.po diff --git a/addons/crm_project_issue/i18n/lo.po b/addons/crm_project/i18n/lo.po similarity index 100% rename from addons/crm_project_issue/i18n/lo.po rename to addons/crm_project/i18n/lo.po diff --git a/addons/crm_project_issue/i18n/lt.po b/addons/crm_project/i18n/lt.po similarity index 100% rename from addons/crm_project_issue/i18n/lt.po rename to addons/crm_project/i18n/lt.po diff --git a/addons/crm_project_issue/i18n/lv.po b/addons/crm_project/i18n/lv.po similarity index 100% rename from addons/crm_project_issue/i18n/lv.po rename to addons/crm_project/i18n/lv.po diff --git a/addons/crm_project_issue/i18n/mk.po b/addons/crm_project/i18n/mk.po similarity index 100% rename from addons/crm_project_issue/i18n/mk.po rename to addons/crm_project/i18n/mk.po diff --git a/addons/crm_project_issue/i18n/ml_IN.po b/addons/crm_project/i18n/ml_IN.po similarity index 100% rename from addons/crm_project_issue/i18n/ml_IN.po rename to addons/crm_project/i18n/ml_IN.po diff --git a/addons/crm_project_issue/i18n/mn.po b/addons/crm_project/i18n/mn.po similarity index 100% rename from addons/crm_project_issue/i18n/mn.po rename to addons/crm_project/i18n/mn.po diff --git a/addons/crm_project_issue/i18n/nb.po b/addons/crm_project/i18n/nb.po similarity index 100% rename from addons/crm_project_issue/i18n/nb.po rename to addons/crm_project/i18n/nb.po diff --git a/addons/crm_project_issue/i18n/nl.po b/addons/crm_project/i18n/nl.po similarity index 100% rename from addons/crm_project_issue/i18n/nl.po rename to addons/crm_project/i18n/nl.po diff --git a/addons/crm_project_issue/i18n/nl_BE.po b/addons/crm_project/i18n/nl_BE.po similarity index 100% rename from addons/crm_project_issue/i18n/nl_BE.po rename to addons/crm_project/i18n/nl_BE.po diff --git a/addons/crm_project_issue/i18n/pl.po b/addons/crm_project/i18n/pl.po similarity index 100% rename from addons/crm_project_issue/i18n/pl.po rename to addons/crm_project/i18n/pl.po diff --git a/addons/crm_project_issue/i18n/pt.po b/addons/crm_project/i18n/pt.po similarity index 100% rename from addons/crm_project_issue/i18n/pt.po rename to addons/crm_project/i18n/pt.po diff --git a/addons/crm_project_issue/i18n/pt_BR.po b/addons/crm_project/i18n/pt_BR.po similarity index 100% rename from addons/crm_project_issue/i18n/pt_BR.po rename to addons/crm_project/i18n/pt_BR.po diff --git a/addons/crm_project_issue/i18n/ro.po b/addons/crm_project/i18n/ro.po similarity index 100% rename from addons/crm_project_issue/i18n/ro.po rename to addons/crm_project/i18n/ro.po diff --git a/addons/crm_project_issue/i18n/ru.po b/addons/crm_project/i18n/ru.po similarity index 100% rename from addons/crm_project_issue/i18n/ru.po rename to addons/crm_project/i18n/ru.po diff --git a/addons/crm_project_issue/i18n/sk.po b/addons/crm_project/i18n/sk.po similarity index 100% rename from addons/crm_project_issue/i18n/sk.po rename to addons/crm_project/i18n/sk.po diff --git a/addons/crm_project_issue/i18n/sl.po b/addons/crm_project/i18n/sl.po similarity index 100% rename from addons/crm_project_issue/i18n/sl.po rename to addons/crm_project/i18n/sl.po diff --git a/addons/crm_project_issue/i18n/sq.po b/addons/crm_project/i18n/sq.po similarity index 100% rename from addons/crm_project_issue/i18n/sq.po rename to addons/crm_project/i18n/sq.po diff --git a/addons/crm_project_issue/i18n/sr.po b/addons/crm_project/i18n/sr.po similarity index 100% rename from addons/crm_project_issue/i18n/sr.po rename to addons/crm_project/i18n/sr.po diff --git a/addons/crm_project_issue/i18n/sr@latin.po b/addons/crm_project/i18n/sr@latin.po similarity index 100% rename from addons/crm_project_issue/i18n/sr@latin.po rename to addons/crm_project/i18n/sr@latin.po diff --git a/addons/crm_project_issue/i18n/sv.po b/addons/crm_project/i18n/sv.po similarity index 100% rename from addons/crm_project_issue/i18n/sv.po rename to addons/crm_project/i18n/sv.po diff --git a/addons/crm_project_issue/i18n/ta.po b/addons/crm_project/i18n/ta.po similarity index 100% rename from addons/crm_project_issue/i18n/ta.po rename to addons/crm_project/i18n/ta.po diff --git a/addons/crm_project_issue/i18n/th.po b/addons/crm_project/i18n/th.po similarity index 100% rename from addons/crm_project_issue/i18n/th.po rename to addons/crm_project/i18n/th.po diff --git a/addons/crm_project_issue/i18n/tr.po b/addons/crm_project/i18n/tr.po similarity index 100% rename from addons/crm_project_issue/i18n/tr.po rename to addons/crm_project/i18n/tr.po diff --git a/addons/crm_project_issue/i18n/uk.po b/addons/crm_project/i18n/uk.po similarity index 100% rename from addons/crm_project_issue/i18n/uk.po rename to addons/crm_project/i18n/uk.po diff --git a/addons/crm_project_issue/i18n/vi.po b/addons/crm_project/i18n/vi.po similarity index 100% rename from addons/crm_project_issue/i18n/vi.po rename to addons/crm_project/i18n/vi.po diff --git a/addons/crm_project_issue/i18n/zh_CN.po b/addons/crm_project/i18n/zh_CN.po similarity index 100% rename from addons/crm_project_issue/i18n/zh_CN.po rename to addons/crm_project/i18n/zh_CN.po diff --git a/addons/crm_project_issue/i18n/zh_TW.po b/addons/crm_project/i18n/zh_TW.po similarity index 100% rename from addons/crm_project_issue/i18n/zh_TW.po rename to addons/crm_project/i18n/zh_TW.po diff --git a/addons/crm_project_issue/security/ir.model.access.csv b/addons/crm_project/security/ir.model.access.csv similarity index 100% rename from addons/crm_project_issue/security/ir.model.access.csv rename to addons/crm_project/security/ir.model.access.csv diff --git a/addons/crm_project_issue/views/crm_lead_views.xml b/addons/crm_project/views/crm_lead_views.xml similarity index 60% rename from addons/crm_project_issue/views/crm_lead_views.xml rename to addons/crm_project/views/crm_lead_views.xml index 4ea470237c2..874c9afb997 100644 --- a/addons/crm_project_issue/views/crm_lead_views.xml +++ b/addons/crm_project/views/crm_lead_views.xml @@ -1,17 +1,17 @@ - - - crm.lead.form.inherit.lead2projectissue + + + crm.lead.form crm.lead - diff --git a/addons/project_issue/__init__.py b/addons/crm_project/wizard/__init__.py similarity index 73% rename from addons/project_issue/__init__.py rename to addons/crm_project/wizard/__init__.py index dc5e6b693d1..1c10ad19d6b 100644 --- a/addons/project_issue/__init__.py +++ b/addons/crm_project/wizard/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from . import models +from . import crm_lead_convert2task diff --git a/addons/crm_project_issue/wizard/crm_lead2projectissue_wizard.py b/addons/crm_project/wizard/crm_lead_convert2task.py similarity index 63% rename from addons/crm_project_issue/wizard/crm_lead2projectissue_wizard.py rename to addons/crm_project/wizard/crm_lead_convert2task.py index a382bf07128..2ada685b53d 100644 --- a/addons/crm_project_issue/wizard/crm_lead2projectissue_wizard.py +++ b/addons/crm_project/wizard/crm_lead_convert2task.py @@ -2,32 +2,32 @@ from odoo import api, fields, models -class CrmLeadToProjectIssueWizard(models.TransientModel): - """ wizard to convert a Lead into a Project Issue and move the Mail Thread """ +class CrmLeadConvert2Task(models.TransientModel): + """ wizard to convert a Lead into a Project task and move the Mail Thread """ - _name = "crm.lead2projectissue.wizard" + _name = "crm.lead.convert2task" _inherit = 'crm.partner.binding' @api.model def default_get(self, fields): - result = super(CrmLeadToProjectIssueWizard, self).default_get(fields) + result = super(CrmLeadConvert2Task, self).default_get(fields) lead_id = self.env.context.get('active_id') if lead_id: result['lead_id'] = lead_id return result lead_id = fields.Many2one('crm.lead', string='Lead', domain=[('type', '=', 'lead')]) - project_id = fields.Many2one('project.project', string='Project', domain=[('use_issues', '=', True)]) + project_id = fields.Many2one('project.project', string='Project', domain=[('use_tasks', '=', True)]) @api.multi - def action_lead_to_project_issue(self): + def action_lead_to_project_task(self): self.ensure_one() # get the lead to transform lead = self.lead_id partner_id = self._find_matching_partner() if not partner_id and (lead.partner_name or lead.contact_name): partner_id = lead.handle_partner_assignation()[lead.id] - # create new project.issue + # create new project.task vals = { "name": lead.name, "description": lead.description, @@ -36,23 +36,23 @@ class CrmLeadToProjectIssueWizard(models.TransientModel): "partner_id": partner_id, "user_id": None } - issue = self.env['project.issue'].create(vals) + task = self.env['project.task'].create(vals) # move the mail thread - lead.message_change_thread(issue) + lead.message_change_thread(task) # move attachments attachments = self.env['ir.attachment'].search([('res_model', '=', 'crm.lead'), ('res_id', '=', lead.id)]) - attachments.write({'res_model': 'project.issue', 'res_id': issue.id}) + attachments.write({'res_model': 'project.task', 'res_id': task.id}) # archive the lead lead.write({'active': False}) - # return the action to go to the form view of the new Issue - view = self.env.ref('project_issue.project_issue_form_view') + # return the action to go to the form view of the new Task + view = self.env.ref('project.view_task_form2') return { - 'name': 'Issue created', + 'name': 'Task created', 'view_type': 'form', 'view_mode': 'form', 'view_id': view.id, - 'res_model': 'project.issue', + 'res_model': 'project.task', 'type': 'ir.actions.act_window', - 'res_id': issue.id, + 'res_id': task.id, 'context': self.env.context } diff --git a/addons/crm_project_issue/wizard/crm_lead2projectissue_wizard_view.xml b/addons/crm_project/wizard/crm_lead_convert2task_views.xml similarity index 56% rename from addons/crm_project_issue/wizard/crm_lead2projectissue_wizard_view.xml rename to addons/crm_project/wizard/crm_lead_convert2task_views.xml index 0405e9ac5cf..1984f8d4d79 100644 --- a/addons/crm_project_issue/wizard/crm_lead2projectissue_wizard_view.xml +++ b/addons/crm_project/wizard/crm_lead_convert2task_views.xml @@ -2,16 +2,16 @@ - - crm.lead2projectissue.wizard.form - crm.lead2projectissue.wizard + + crm.lead.convert2task.form + crm.lead.convert2task -
+
-
@@ -19,9 +19,9 @@
- - Convert to Issue - crm.lead2projectissue.wizard + + Convert to Task + crm.lead.convert2task form form new diff --git a/addons/crm_project_issue/wizard/__init__.py b/addons/crm_project_issue/wizard/__init__.py deleted file mode 100644 index 6ebdf03c7ab..00000000000 --- a/addons/crm_project_issue/wizard/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from . import crm_lead2projectissue_wizard diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index c672cab2835..555a23be2cf 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -2172,8 +2172,8 @@ class MailThread(models.AbstractModel): :param new_res_id : the new res_id of the mail.message :param new_model : the name of the new model of the mail.message - Example : my_lead.message_change_thread(my_project_issue) - will transfer the context of the thread of my_lead to my_project_issue + Example : my_lead.message_change_thread(my_project_task) + will transfer the context of the thread of my_lead to my_project_task """ self.ensure_one() # get the subtype of the comment Message diff --git a/addons/pad_project/__manifest__.py b/addons/pad_project/__manifest__.py index 71f042df6ee..85b1da9aa98 100644 --- a/addons/pad_project/__manifest__.py +++ b/addons/pad_project/__manifest__.py @@ -15,7 +15,7 @@ This module adds a PAD in all project form views. ], 'data': [ 'views/project_config_settings_views.xml', - 'views/project_task.xml' + 'views/project_views.xml' ], 'auto_install': True, } diff --git a/addons/pad_project/models/__init__.py b/addons/pad_project/models/__init__.py index 70a1000c2b4..66c35af5995 100644 --- a/addons/pad_project/models/__init__.py +++ b/addons/pad_project/models/__init__.py @@ -2,4 +2,4 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import project_config_settings -from . import project_task +from . import project diff --git a/addons/pad_project/models/project_task.py b/addons/pad_project/models/project.py similarity index 53% rename from addons/pad_project/models/project_task.py rename to addons/pad_project/models/project.py index 47fb1eb72a0..113a32b9b68 100644 --- a/addons/pad_project/models/project_task.py +++ b/addons/pad_project/models/project.py @@ -9,3 +9,10 @@ class ProjectTask(models.Model): _inherit = ["project.task", 'pad.common'] description_pad = fields.Char('Pad URL', pad_content_field='description') + use_pad = fields.Boolean(related="project_id.use_pads", string="Use collaborative pad") + + +class ProjectProject(models.Model): + _inherit = "project.project" + + use_pads = fields.Boolean("Use collaborative pads", help="Use collaborative pad for the tasks on this project.") diff --git a/addons/pad_project/views/project_task.xml b/addons/pad_project/views/project_task.xml deleted file mode 100644 index 17ccd54a36b..00000000000 --- a/addons/pad_project/views/project_task.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - project.task.form.inherit - project.task - - - - - - - - diff --git a/addons/pad_project/views/project_views.xml b/addons/pad_project/views/project_views.xml new file mode 100644 index 00000000000..63d5f61084b --- /dev/null +++ b/addons/pad_project/views/project_views.xml @@ -0,0 +1,29 @@ + + + + project.task.form.inherit + project.task + + + + {'invisible': [('use_pad', '=', True)]} + + + + + + + + + + project.project.view.form + project.project + + + + + + + + + diff --git a/addons/project/data/project_data.xml b/addons/project/data/project_data.xml index 40568f36c2d..6aff15a116a 100644 --- a/addons/project/data/project_data.xml +++ b/addons/project/data/project_data.xml @@ -98,7 +98,6 @@ followers - project.task discover everyone diff --git a/addons/project/data/project_demo.xml b/addons/project/data/project_demo.xml index 490392516b9..ba068404bdf 100644 --- a/addons/project/data/project_demo.xml +++ b/addons/project/data/project_demo.xml @@ -66,7 +66,6 @@ Website for Sales & WMS 3 - project.task @@ -74,7 +73,6 @@ Research & Development followers - project.task @@ -83,7 +81,6 @@ E-Learning Integration Trainings - project.task employees
@@ -94,7 +91,6 @@ Designs followers - project.task employees
@@ -104,7 +100,6 @@ Data Import/Export Plugin Databases - project.task followers
diff --git a/addons/project/data/web_planner_data.xml b/addons/project/data/web_planner_data.xml index 9e3f0d63056..0b2aae71788 100644 --- a/addons/project/data/web_planner_data.xml +++ b/addons/project/data/web_planner_data.xml @@ -117,10 +117,10 @@ Your Projects -

Depending on what you need and how you want to operate, there are several ways to work with Odoo. First, decide if you want to think in terms of tasks or issues. Then, activate the Timesheets app if you need it.

-

1. Learn about Tasks, Issues and Timesheets.

+

Depending on what you need and how you want to operate, there are several ways to work with Odoo. First, decide if you want to think in terms of tasks. Then, activate the Timesheets app if you need it.

+

1. Learn about Tasks and Timesheets.

-
+
@@ -138,24 +138,7 @@

Tasks are the main mechanism in Odoo and are activated by default.

-
-
-
- - - Issues - -
-
-

- A problem or request from a customer that needs to be identified, solved and followed up asap.

-

Example:

-

A customer sends a complaint to support@yourcompany.com: an Issue is automatically created into a 'Support level 1' project based on the original email from the customer.


-

To use Issues, install the Issue Tracking app. -

-
-
-
+
@@ -171,9 +154,7 @@
  • Getting statistics on how much time a task takes to be completed
  • Invoicing your customers on Time & Material projects
  • To use Timesheets, go to your Project Settings and activate:

    -

  • for Tasks: 'Log work activities on tasks'
  • -
  • for Issues: 'Activate timesheets on issues'
  • + 'project.action_config_settings')">Project Settings and activate 'Log work activities on tasks'

    You can learn more about Timesheets in the 'Use Timesheets' section of this planner.

    @@ -189,36 +170,26 @@
  • #1
    - Tasks - Issues with Timesheet
  • #2
    - Tasks - Issues with Timesheet
  • #3
    - Tasks - Issues with Timesheet
  • #4
    - Tasks - Issues with Timesheet
  • #5
    - Tasks - Issues with Timesheet
  • @@ -255,7 +226,7 @@ Kanban Stages

    It is time to think about how you will transform your activities into real projects in Odoo.
    - For that, the most important part is defining the stages of your projects. Stages are the different steps a task or an issue can go through, from its creation to its ending. They will appear in what we call the 'Kanban' view of your projects. + For that, the most important part is defining the stages of your projects. Stages are the different steps a task can go through, from its creation to its ending. They will appear in what we call the 'Kanban' view of your projects.

    @@ -371,9 +342,9 @@ Implement - Tasks & Issues + Tasks

    - Creating Tasks and/or Issues is the next step in managing your Projects.
    + Creating Tasks is the next step in managing your Projects.
    In Odoo, it is pretty straightforward, but here are some explanations you may find useful.

    @@ -390,7 +361,7 @@

    Add a Deadline
    - The deadline will help you determine if a task or issue is progressing as expected and to anticipate its next update. + The deadline will help you determine if a task is progressing as expected and to anticipate its next update.

    @@ -398,7 +369,7 @@

    Use Tags
    - Tags are complementary to your project stages: they can work as a second level categorization which is very useful if you have a lot of Tasks or Issues to manage. Also, it becomes very easy to find Tasks or Issues by typing the Tag into the main Search bar. + Tags are complementary to your project stages: they can work as a second level categorization which is very useful if you have a lot of Tasks to manage. Also, it becomes very easy to find Tasks by typing the Tag into the main Search bar.

    @@ -406,7 +377,7 @@

    Use Status Indicator
    - The Status indicator helps you manage Tasks and Issues by giving them one of 3 different colour: Grey, Green or Red. The meaning of these Statuses can be freely configured, for example: + The Status indicator helps you manage Tasks by giving them one of 3 different colour: Grey, Green or Red. The meaning of these Statuses can be freely configured, for example:

  • Grey: the Task is in progress (someone is working on it)
  • Green: the Task is ready for next stage (the job for this stage is complete)
  • Red: the Task is blocked (there's a problem)
  • @@ -417,7 +388,7 @@

    Set Priorities
    - The is used to indicate priority: in Kanban views, high priority Tasks or Issues will be displayed on top. This is particulary useful if you use a Scrum methodology to indicate the tasks for the week. Similarly to Status, you can change the meaning of the Star indicator from the Project Stages tab. + The is used to indicate priority: in Kanban views, high priority Tasks will be displayed on top. This is particulary useful if you use a Scrum methodology to indicate the tasks for the week. Similarly to Status, you can change the meaning of the Star indicator from the Project Stages tab.

    @@ -434,7 +405,7 @@
    @@ -528,7 +498,7 @@

    Invoice your customers (every month)

    - If you work on a Time & Material project, you'll probably want to extract a Timesheet of the tasks and issues to invoice directly to the customer. To do that: + If you work on a Time & Material project, you'll probably want to extract a Timesheet of the tasks to invoice directly to the customer. To do that:

    • Activate 'Allow invoicing based on timesheets' from the Human Resources Settings. @@ -536,21 +506,18 @@
    • This will add an Invoice Tasks menu in the Project module, that can be used to select the Timesheet to invoice.

    Analyze reports (every a year)

    -

    It's usually a good idea to take time to analyze your tasks and issues once a year. Here are some KPIs you should take a look at. Ask yourself 'How can they be improved?'

    +

    It's usually a good idea to take time to analyze your tasks once a year. Here are some KPIs you should take a look at. Ask yourself 'How can they be improved?'

    For tasks:

    • What is the number of missed deadlines?
    • What is the difference between initial time estimation and final time spent?
    • -
    -

    For issues:

    -
      -
    • What is the average time before an issue is assigned / closed?
    • -
    • What is the average number of working hours necessary to close an issue?
    • +
    • What is the average time before a task is assigned / closed?
    • +
    • What is the average number of working hours necessary to close a task?

    About Employees:

    • What is their average number of working hours over the year?
    • -
    • What is their average number of tasks or issues worked on / closed?
    • +
    • What is their average number of tasks worked on / closed?
    Need help with Timesheets management? Contact us now:
    @@ -601,7 +568,7 @@ We can automate steps in your workflow, for example:

  • Send an alert when a task is stuck in red for more than a few days
  • -
  • Send an automatic confirmation to all issue emails sent to your customer support
  • +
  • Send an automatic confirmation to all emails sent to your customer support
  • @@ -823,12 +790,12 @@

    Follow only what you need
    - The simplest way to use notifications is to follow a whole project: you will receive notifications for all the new and existing tasks or issues of a project. + The simplest way to use notifications is to follow a whole project: you will receive notifications for all the new and existing tasks of a project.

    Don't hesitate to select only the events you are interested in!

    -

    Another good way to limit the number of notifications you receive is to only follow your Project's 'Task Assigned' events. Then you'll be notified when a Task or Issue is created, and can manually decide if you want to be notified for its other events too.

    +

    Another good way to limit the number of notifications you receive is to only follow your Project's 'Task Assigned' events. Then you'll be notified when a Task is created, and can manually decide if you want to be notified for its other events too.

    @@ -839,10 +806,10 @@

    Rely on the chatter
    - Below every Task and Issue (or more generally, below every Document in Odoo) is an area called Chatter. + Below every Task (or more generally, below every Document in Odoo) is an area called Chatter.

    It's for logging every change, event or message related to the Document.

    -

    So if you're looking for the history of a Task, or the latest message on an Issue, simply go to the corresponding Document and you'll find it!

    +

    So if you're looking for the history of a Task, or the latest message on a Task, simply go to the corresponding Document and you'll find it!

    @@ -864,10 +831,10 @@

    - Create tasks and issues by email
    - In Odoo, every project has an email alias. If you send an email to this alias, it will automatically create a task or issue in the first stage of the project, with all the email recipients as its default followers.

    + Create tasks by email
    + In Odoo, every project has an email alias. If you send an email to this alias, it will automatically create a task in the first stage of the project, with all the email recipients as its default followers.

    - This is particularly useful to manage help and support: all incoming email from customers will be transformed into an issue that you'll be able to track easily! + This is particularly useful to manage help and support: all incoming email from customers will be transformed into a task that you'll be able to track easily!

    @@ -902,7 +869,7 @@ Ask participants to prepare
    To run an effective meeting, prepare participants beforehand. Inform them of how they are expected to contribute.

    - For example, risk and issue owners should come prepared to share the status of their item and, ideally, a path to resolution. + For example, risk and task owners should come prepared to share the status of their item and, ideally, a path to resolution.

    @@ -924,7 +891,7 @@ Start with an answer.
    The worst question to ask is, "What did you do this week?" It invariably generates unnecessary, time-consuming dialogue from team members. Plus, you should already know what everyone on the team did during the week.

    - For example, risk and issue owners should come prepared to share the status of their item and, ideally, a path to resolution. + For example, risk and task owners should come prepared to share the status of their item and, ideally, a path to resolution.

    It is better to start with a "project answer", such as: "We are two weeks late", "We are at planned budget" or "We are 50% complete with the process model". Also if you can, start the meeting on a positive note, such as milestones that have been met or are ahead of schedule. This will make participants feel motivated to engage in the conversation.

    @@ -934,17 +901,17 @@
    Prepare an agenda (and keep to it)

    Be aware of the team’s productivity and time: try to keep meetings to one hour or less.

    -

    Use separate meetings to solve big issues or issues that aren’t important for the entire team.

    +

    Use separate meetings to solve big tasks or tasks that aren’t important for the entire team.

  • Roll call (5 min) Let everyone know who is in attendance before starting. This is important for remote team members who have dialled in and will save you time later.
  • -
  • New business issues (5 min) - You may have learned something during the week that affects the project. Share the news early in the meeting to help team members consider the issue as you walk through the project status session. Not every issue warrants spending time here, so keep discussions to a minimum.
  • +
  • New business tasks (5 min) + You may have learned something during the week that affects the project. Share the news early in the meeting to help team members consider the task as you walk through the project status session. Not every task warrants spending time here, so keep discussions to a minimum.
  • Project plan status review (20 min) Walk through your project plan and allow each team member to provide a brief status of assignments due this week and tasks planned for the next two weeks. You want to know whether tasks are on track and if any will miss their projected deadline. You also want to allow the team member to share any special considerations that might affect other tasks or members of the project. Carefully manage this part because some team members will want to pontificate and spend more time than is really needed. Remember, you’re the project manager.
  • Critical items (10 min) Upon completing the project status review session, summarize the critical items.
  • Q&A and discussion time (10 min) - Always give your team time to ask questions on issues that were not discussed. This gives you another opportunity to reinforce key points that you've picked up during the week or discovered during the meeting.
  • + Always give your team time to ask questions on tasks that were not discussed. This gives you another opportunity to reinforce key points that you've picked up during the week or discovered during the meeting.
  • Summary and follow-up items (5 min) Always wrap up with a project status summary and a list of action items dentified in the meeting to help move the project along.
  • Adjourn (5 min) @@ -956,7 +923,7 @@

    Follow every meeting with a recap email - As soon as the meeting is over, publish meeting minutes and distribute them along with the updated project schedule, issues/action item matrix, and any other appropriate documents. Try to use the same template throughout meetings and improve it continuously. + As soon as the meeting is over, publish meeting minutes and distribute them along with the updated project schedule, task/action item matrix, and any other appropriate documents. Try to use the same template throughout meetings and improve it continuously.

  • @@ -1002,15 +969,15 @@ Exercise 2
    - Delay to close an Issue + Delay to close an Task

    - Exercise: Try to create a graph with the monthly evolution of the 'Average delay to close' of Issues. + Exercise: Try to create a graph with the monthly evolution of the 'Average delay to close' of Tasks.

  • - Issues analysis + Tasks analysis
  • @@ -1064,7 +1031,7 @@ planner_project diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 945c5ded9e2..7d46b94393d 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -13,9 +13,6 @@ class ProjectTaskType(models.Model): _description = 'Task Stage' _order = 'sequence, id' - def _get_mail_template_id_domain(self): - return [('model', '=', 'project.task')] - def _get_default_project_ids(self): default_project_id = self.env.context.get('default_project_id') return [default_project_id] if default_project_id else None @@ -40,7 +37,7 @@ class ProjectTaskType(models.Model): mail_template_id = fields.Many2one( 'mail.template', string='Email Template', - domain=lambda self: self._get_mail_template_id_domain(), + domain=[('model', '=', 'project.task')], help="If set an email will be sent to the customer when the task or issue reaches this step.") fold = fields.Boolean(string='Folded in Kanban', help='This stage is folded in the kanban view when there are no records in that stage to display.') @@ -101,11 +98,6 @@ class Project(models.Model): for project in self: project.task_needaction_count = mapped_data.get(project.id, 0) - @api.model - def _get_alias_models(self): - """ Overriden in project_issue to offer more options """ - return [('project.task', "Tasks")] - @api.multi def attachment_tree_view(self): self.ensure_one() @@ -168,9 +160,6 @@ class Project(models.Model): result['use_tasks'] = True return result - # Lambda indirection method to avoid passing a copy of the overridable method when declaring the field - _alias_models = lambda self: self._get_alias_models() - active = fields.Boolean(default=True, help="If the active field is set to False, it will allow you to hide the project without removing it.") sequence = fields.Integer(default=10, help="Gives the sequence order when displaying a list of Projects.") @@ -201,8 +190,6 @@ class Project(models.Model): alias_id = fields.Many2one('mail.alias', string='Alias', ondelete="restrict", required=True, help="Internal email associated with this project. Incoming emails are automatically synchronized " "with Tasks (or optionally Issues if the Issue Tracker module is installed).") - alias_model = fields.Selection(_alias_models, string="Alias Model", index=True, required=True, default='project.task', - help="The kind of document created when an email is received on this project's email alias") privacy_visibility = fields.Selection([ ('followers', _('On invitation only')), ('employees', _('Visible by all employees')), @@ -263,9 +250,6 @@ class Project(models.Model): @api.multi def write(self, vals): - # if alias_model has been changed, update alias_model_id accordingly - if vals.get('alias_model'): - vals['alias_model_id'] = self.env['ir.model']._get(vals.get('alias_model', 'project.task')).id res = super(Project, self).write(vals) if 'active' in vals: # archiving/unarchiving a project does it on its tasks, too @@ -320,14 +304,6 @@ class Task(models.Model): _mail_post_access = 'read' _order = "priority desc, sequence, date_start, name, id" - @api.model - def default_get(self, field_list): - """ Set 'date_assign' if user_id is set. """ - result = super(Task, self).default_get(field_list) - if 'user_id' in result: - result['date_assign'] = fields.Datetime.now() - return result - def _get_default_partner(self): if 'default_project_id' in self.env.context: default_project_id = self.env['project.project'].browse(self.env.context['default_project_id']) @@ -353,9 +329,10 @@ class Task(models.Model): name = fields.Char(string='Task Title', track_visibility='always', required=True, index=True) description = fields.Html(string='Description') priority = fields.Selection([ - ('0','Non Starred'), - ('1','Starred') - ], default='0', index=True, string="Starred") + ('0', 'Low'), + ('1', 'Normal'), + ('2', 'High') + ], default='0', index=True, string="Priority") sequence = fields.Integer(string='Sequence', index=True, default=10, help="Gives the sequence order when displaying a list of tasks.") stage_id = fields.Many2one('project.task.type', string='Stage', track_visibility='onchange', index=True, @@ -417,6 +394,38 @@ class Task(models.Model): child_ids = fields.One2many('project.task', 'parent_id', string="Sub-tasks") subtask_project_id = fields.Many2one('project.project', related="project_id.subtask_project_id", string='Sub-task Project', readonly=True) subtask_count = fields.Integer(compute='_compute_subtask_count', type='integer', string="Sub-task count") + email_from = fields.Char(string='Email', help="These people will receive email.", index=True) + email_cc = fields.Char(string='Watchers Emails', help="""These email addresses will be added to the CC field of all inbound + and outbound emails for this record before being sent. Separate multiple email addresses with a comma""") + # Computed field about working time elapsed between record creation and assignation/closing. + working_hours_open = fields.Float(compute='_compute_elapsed', string='Working hours to assign', store=True, group_operator="avg") + working_hours_close = fields.Float(compute='_compute_elapsed', string='Working hours to close', store=True, group_operator="avg") + working_days_open = fields.Float(compute='_compute_elapsed', string='Working days to assign', store=True, group_operator="avg") + working_days_close = fields.Float(compute='_compute_elapsed', string='Working days to close', store=True, group_operator="avg") + + @api.multi + @api.depends('create_date', 'date_end', 'date_assign') + def _compute_elapsed(self): + task_linked_to_calendar = self.filtered( + lambda task: task.project_id.resource_calendar_id and task.create_date + ) + for task in task_linked_to_calendar: + dt_create_date = fields.Datetime.from_string(task.create_date) + + if task.date_assign: + dt_date_assign = fields.Datetime.from_string(task.date_assign) + task.working_hours_open = task.project_id.resource_calendar_id.get_work_hours_count( + dt_create_date, dt_date_assign, False, compute_leaves=True) + task.working_days_open = task.working_hours_open / 24.0 + + if task.date_end: + dt_date_end = fields.Datetime.from_string(task.date_end) + task.working_hours_close = task.project_id.resource_calendar_id.get_work_hours_count( + dt_create_date, dt_date_end, False, compute_leaves=True) + task.working_days_close = task.working_hours_close / 24.0 + + (self - task_linked_to_calendar).update(dict.fromkeys( + ['working_hours_open', 'working_hours_close', 'working_days_open', 'working_days_close'], 0.0)) @api.depends('stage_id', 'kanban_state') def _compute_kanban_state_label(self): @@ -428,6 +437,10 @@ class Task(models.Model): else: task.kanban_state_label = task.legend_done + @api.onchange('partner_id') + def _onchange_partner_id(self): + self.email_from = self.partner_id.email + @api.onchange('project_id') def _onchange_project(self): default_partner_id = self.env.context.get('default_partner_id') @@ -436,8 +449,11 @@ class Task(models.Model): self.partner_id = self.project_id.partner_id or default_partner if self.project_id not in self.stage_id.project_ids: self.stage_id = self.stage_find(self.project_id.id, [('fold', '=', False)]) + if not self.email_from: + self.email_from = self.partner_id.email else: self.partner_id = default_partner + self.email_from = default_partner.email self.stage_id = False @api.onchange('user_id') @@ -466,11 +482,6 @@ class Task(models.Model): if task.parent_id.project_id and task.project_id != task.parent_id.project_id.subtask_project_id: raise UserError(_("You can't define a parent task if its project is not correctly configured. The sub-task's project of the parent task's project should be this task's project")) - @api.constrains('date_start', 'date_end') - def _check_dates(self): - if any(self.filtered(lambda task: task.date_start and task.date_end and task.date_start > task.date_end)): - raise ValidationError(_('Error ! Task starting date must be lower than its ending date.')) - # Override view according to the company definition @api.model def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False): @@ -561,6 +572,9 @@ class Task(models.Model): # user_id change: update date_assign if vals.get('user_id'): vals['date_assign'] = fields.Datetime.now() + # Stage change: Update date_end if folded stage + if vals.get('stage_id'): + vals.update(self.update_date_end(vals['stage_id'])) task = super(Task, self.with_context(context)).create(vals) return task @@ -569,18 +583,25 @@ class Task(models.Model): now = fields.Datetime.now() # stage change: update date_last_stage_update if 'stage_id' in vals: + vals.update(self.update_date_end(vals['stage_id'])) vals['date_last_stage_update'] = now # reset kanban state when changing stage if 'kanban_state' not in vals: vals['kanban_state'] = 'normal' # user_id change: update date_assign - if vals.get('user_id'): + if vals.get('user_id') and 'date_assign' not in vals: vals['date_assign'] = now result = super(Task, self).write(vals) return result + def update_date_end(self, stage_id): + project_task_type = self.env['project.task.type'].browse(stage_id) + if project_task_type.fold: + return {'date_end': fields.Datetime.now()} + return {'date_end': False} + # --------------------------------------------------- # Mail gateway # --------------------------------------------------- @@ -646,17 +667,28 @@ class Task(models.Model): @api.model def message_new(self, msg, custom_values=None): - """ Override to updates the document according to the email. """ + """ Overrides mail_thread message_new that is called by the mailgateway + through message_process. + This override updates the document according to the email. + """ + # remove default author when going through the mail gateway. Indeed we + # do not want to explicitly set user_id to False; however we do not + # want the gateway user to be responsible if no other responsible is + # found. + create_context = dict(self.env.context or {}) + create_context['default_user_id'] = False if custom_values is None: custom_values = {} defaults = { - 'name': msg.get('subject'), + 'name': msg.get('subject') or _("No Subject"), + 'email_from': msg.get('from'), + 'email_cc': msg.get('cc'), 'planned_hours': 0.0, 'partner_id': msg.get('author_id') } defaults.update(custom_values) - task = super(Task, self).message_new(msg, custom_values=defaults) + task = super(Task, self.with_context(create_context)).message_new(msg, custom_values=defaults) email_list = task.email_split(msg) partner_ids = [p for p in task._find_partner_from_emails(email_list, force_create=False) if p] task.message_subscribe(partner_ids) @@ -692,7 +724,10 @@ class Task(models.Model): recipients = super(Task, self).message_get_suggested_recipients() for task in self.filtered('partner_id'): reason = _('Customer Email') if task.partner_id.email else _('Customer') - task._message_add_suggested_recipient(recipients, partner=task.partner_id, reason=reason) + if task.partner_id: + task._message_add_suggested_recipient(recipients, partner=task.partner_id, reason=reason) + elif task.email_from: + task._message_add_suggested_recipient(recipients, partner=task.email_from, reason=reason) return recipients @api.multi @@ -713,6 +748,22 @@ class Task(models.Model): res['headers'] = repr(headers) return res + def _message_post_after_hook(self, message): + if self.email_from and not self.partner_id: + # we consider that posting a message with a specified recipient (not a follower, a specific one) + # on a document without customer means that it was created through the chatter using + # suggested recipients. This heuristic allows to avoid ugly hacks in JS. + new_partner = message.partner_ids.filtered(lambda partner: partner.email == self.email_from) + if new_partner: + self.search([ + ('partner_id', '=', False), + ('email_from', '=', new_partner.email), + ('stage_id.fold', '=', False)]).write({'partner_id': new_partner.id}) + return super(Task, self)._message_post_after_hook(message) + + def action_assign_to_me(self): + self.write({'user_id': self.env.user.id}) + def action_open_parent_task(self): return { 'name': _('Parent Task'), @@ -812,9 +863,9 @@ class AccountAnalyticAccount(models.Model): return result class ProjectTags(models.Model): - """ Tags of project's tasks (or issues) """ + """ Tags of project's tasks """ _name = "project.tags" - _description = "Tags of project's tasks, issues..." + _description = "Tags of project's tasks" name = fields.Char(required=True) color = fields.Integer(string='Color Index', default=10) diff --git a/addons/project/models/project_config_settings.py b/addons/project/models/project_config_settings.py index 4f6b6f2f491..faa0946f98f 100644 --- a/addons/project/models/project_config_settings.py +++ b/addons/project/models/project_config_settings.py @@ -19,5 +19,9 @@ class ProjectConfiguration(models.TransientModel): module_hr_timesheet_attendance = fields.Boolean("Attendances") module_sale_timesheet = fields.Boolean("Time Billing") module_hr_expense = fields.Boolean("Expenses") - module_project_issue = fields.Boolean("Issue Tracking") group_subtask_project = fields.Boolean("Sub-tasks", implied_group="project.group_subtask_project") + + @api.onchange('module_sale_timesheet') + def _onchange_module_sale_timesheet(self): + if self.module_sale_timesheet: + self.module_hr_timesheet = True diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py index b95293d61cb..22dcca906e2 100644 --- a/addons/project/report/project_report.py +++ b/addons/project/report/project_report.py @@ -13,23 +13,23 @@ class ReportProjectTaskUser(models.Model): name = fields.Char(string='Task Title', readonly=True) user_id = fields.Many2one('res.users', string='Assigned To', readonly=True) date_start = fields.Datetime(string='Assignation Date', readonly=True) - no_of_days = fields.Integer(string='# Working Days', readonly=True) date_end = fields.Datetime(string='Ending Date', readonly=True) date_deadline = fields.Date(string='Deadline', readonly=True) date_last_stage_update = fields.Datetime(string='Last Stage Update', readonly=True) project_id = fields.Many2one('project.project', string='Project', readonly=True) - closing_days = fields.Float(string='# Days to Close', + working_days_close = fields.Float(string='# Working Days to Close', digits=(16,2), readonly=True, group_operator="avg", - help="Number of Days to close the task") - opening_days = fields.Float(string='# Days to Assign', + help="Number of Working Days to close the task") + working_days_open = fields.Float(string='# Working Days to Assign', digits=(16,2), readonly=True, group_operator="avg", - help="Number of Days to Open the task") + help="Number of Working Days to Open the task") delay_endings_days = fields.Float(string='# Days to Deadline', digits=(16,2), readonly=True) nbr = fields.Integer('# of Tasks', readonly=True) # TDE FIXME master: rename into nbr_tasks priority = fields.Selection([ - ('0','Non Starred'), - ('1','Starred') - ], size=1, readonly=True, string="Starred") + ('0', 'Low'), + ('1', 'Normal'), + ('2', 'High') + ], size=1, readonly=True, string="Priority") state = fields.Selection([ ('normal', 'In Progress'), ('blocked', 'Blocked'), @@ -48,7 +48,6 @@ class ReportProjectTaskUser(models.Model): t.date_end as date_end, t.date_last_stage_update as date_last_stage_update, t.date_deadline as date_deadline, - abs((extract('epoch' from (t.write_date-t.date_start)))/(3600*24)) as no_of_days, t.user_id, t.project_id, t.priority, @@ -57,8 +56,8 @@ class ReportProjectTaskUser(models.Model): t.partner_id, t.stage_id as stage_id, t.kanban_state as state, - (extract('epoch' from (t.write_date-t.create_date)))/(3600*24) as closing_days, - (extract('epoch' from (t.date_start-t.create_date)))/(3600*24) as opening_days, + t.working_days_close as working_days_close, + t.working_days_open as working_days_open, (extract('epoch' from (t.date_deadline-(now() at time zone 'UTC'))))/(3600*24) as delay_endings_days """ return select_str diff --git a/addons/project/tests/test_project_flow.py b/addons/project/tests/test_project_flow.py index 2a89411c50d..4edb87361e4 100644 --- a/addons/project/tests/test_project_flow.py +++ b/addons/project/tests/test_project_flow.py @@ -54,8 +54,6 @@ class TestProjectFlow(TestProjectBase): # Test: messages self.assertEqual(len(task.message_ids), 2, 'project: message_process: newly created task should have 2 messages: creation and email') - self.assertEqual(task.message_ids[1].subtype_id.name, 'Task Opened', - 'project: message_process: first message of new task should have Task Created subtype') self.assertEqual(task.message_ids[0].author_id, self.user_projectuser.partner_id, 'project: message_process: second message should be the one from Agrolait (partner failed)') self.assertEqual(task.message_ids[0].subject, 'Frogs', diff --git a/addons/project/views/project_config_settings_views.xml b/addons/project/views/project_config_settings_views.xml index 8ec189d2e02..0ab6b51ac6e 100644 --- a/addons/project/views/project_config_settings_views.xml +++ b/addons/project/views/project_config_settings_views.xml @@ -159,20 +159,6 @@ -

    Issue Management

    -
    -
    -
    - -
    -
    -
    -
    -
    diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index 0ebe971be03..23397729a79 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -31,7 +31,7 @@ - + @@ -127,8 +127,7 @@
    -
    @@ -161,8 +160,6 @@ @ -