<field name="user_id"/>
<field name="date_deadline"/>
<field name="create_date"/>
+ <field name="categ_ids"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
</div>
<div class="oe_kanban_footer_left">
<div class="oe_left">
- <field name="categ_id"/>
+ <!-- <field name="categ_ids" widget="many2many_tags"/> -->
+ <t t-raw="record.categ_ids.raw_value"/>
</div>
<div class="oe_right">
Creation: <field name="create_date"/>
'followers': fields.function(_get_followers, method=True, fnct_search=_search_followers,
type='many2many', relation='res.users', string='Followers'),
}
-
+
def dummy(self, cr, uid, ids, context):
return True
# restore order of the search
result.sort(lambda x,y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
return result
-
+
def _read_group_user_id(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
res_users = self.pool.get('res.users')
project_id = self._resolve_project_id_from_context(cr, uid, context=context)
return True
def action_close(self, cr, uid, ids, context=None):
- """ This action closes the task
+ """ This action closes the task
"""
task_id = len(ids) and ids[0] or False
self._check_child_task(cr, uid, ids, context=context)
def do_close(self, cr, uid, ids, context=None):
""" Compatibility when changing to case_close. """
return self.case_close(cr, uid, ids, context=context)
-
+
def case_close(self, cr, uid, ids, context=None):
""" Closes Task """
if not isinstance(ids, list): ids = [ids]
def do_cancel(self, cr, uid, ids, context=None):
""" Compatibility when changing to case_cancel. """
return self.case_cancel(cr, uid, ids, context=context)
-
+
def case_cancel(self, cr, uid, ids, context=None):
tasks = self.browse(cr, uid, ids, context=context)
self._check_child_task(cr, uid, ids, context=context)
def do_open(self, cr, uid, ids, context=None):
""" Compatibility when changing to case_open. """
return self.case_open(cr, uid, ids, context=context)
-
+
def case_open(self, cr, uid, ids, context=None):
if not isinstance(ids,list): ids = [ids]
self.case_set(cr, uid, ids, 'open', {'date_start': fields.datetime.now()}, context=context)
def do_draft(self, cr, uid, ids, context=None):
""" Compatibility when changing to case_draft. """
return self.case_draft(cr, uid, ids, context=context)
-
+
def case_draft(self, cr, uid, ids, context=None):
self.case_set(cr, uid, ids, 'draft', {}, context=context)
self.case_draft_send_note(cr, uid, ids, context=context)
def do_pending(self, cr, uid, ids, context=None):
""" Compatibility when changing to case_pending. """
return self.case_pending(cr, uid, ids, context=context)
-
+
def case_pending(self, cr, uid, ids, context=None):
self.case_set(cr, uid, ids, 'pending', {}, context=context)
return self.case_pending_send_note(cr, uid, ids, context=context)
-
+
def _delegate_task_attachments(self, cr, uid, task_id, delegated_task_id, context=None):
attachment = self.pool.get('ir.attachment')
attachment_ids = attachment.search(cr, uid, [('res_model', '=', self._name), ('res_id', '=', task_id)], context=context)
new_stage = vals.get('stage_id')
vals_reset_kstate = dict(vals, kanban_state='normal')
for t in self.browse(cr, uid, ids, context=context):
- #TO FIX:Kanban view doesn't raise warning
+ #TO FIX:Kanban view doesn't raise warning
#stages = [stage.id for stage in t.project_id.type_ids]
#if new_stage not in stages:
#raise osv.except_osv(_('Warning !'), _('Stage is not defined in the project.'))
result += "\n"
return result
-
+
# ---------------------------------------------------
# OpenChatter methods and notifications
# ---------------------------------------------------
)
""")
+
+class project_category(osv.osv):
+ """ Category of project's task (or issue) """
+ _name = "project.category"
+ _description = "Category of project's task, issue, ..."
+ _columns = {
+ 'name': fields.char('Name', size=64, required=True, translate=True),
+ }
<field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/>
<field name="stage_id" widget="selection" readonly="1"/>
<field name="state" groups="base.group_no_one"/>
- <field name="categ_id" invisible="1"/>
+ <field name="categ_ids" invisible="1"/>
<field name="task_id" invisible="1"/>
</tree>
</field>
'date_closed': fields.datetime('Closed', readonly=True,select=True),
'date': fields.datetime('Date'),
'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel."),
- 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('object_id.model', '=', 'crm.project.bug')]"),
+ 'categ_ids': fields.many2many('project.category', 'project_issue_categ_rel', 'project_issue_id', 'project_category_id', 'Categories'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True),
'version_id': fields.many2one('project.issue.version', 'Version'),
'stage_id': fields.many2one ('project.task.type', 'Stage',
'section_id': lambda s, cr, uid, c: s._get_default_section_id(cr, uid, c),
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),
'priority': crm.AVAILABLE_PRIORITIES[2][0],
- 'categ_id' : lambda *a: False,
}
_group_by_full = {
def convert_issue_task(self, cr, uid, ids, context=None):
if context is None:
context = {}
-
+
case_obj = self.pool.get('project.issue')
data_obj = self.pool.get('ir.model.data')
task_obj = self.pool.get('project.task')
-
+
result = data_obj._get_id(cr, uid, 'project', 'view_task_search_form')
res = data_obj.read(cr, uid, result, ['res_id'])
id2 = data_obj._get_id(cr, uid, 'project', 'view_task_form2')
}
- def _convert(self, cr, uid, ids, xml_id, context=None):
- data_obj = self.pool.get('ir.model.data')
- id2 = data_obj._get_id(cr, uid, 'project_issue', xml_id)
- categ_id = False
- if id2:
- categ_id = data_obj.browse(cr, uid, id2, context=context).res_id
- if categ_id:
- self.write(cr, uid, ids, {'categ_id': categ_id})
- return True
+ # def _convert(self, cr, uid, ids, xml_id, context=None):
+ # data_obj = self.pool.get('ir.model.data')
+ # id2 = data_obj._get_id(cr, uid, 'project_issue', xml_id)
+ # categ_id = False
+ # if id2:
+ # categ_id = data_obj.browse(cr, uid, id2, context=context).res_id
+ # if categ_id:
+ # self.write(cr, uid, ids, {'categ_id': categ_id})
+ # return True
- def convert_to_feature(self, cr, uid, ids, context=None):
- return self._convert(cr, uid, ids, 'feature_request_categ', context=context)
+ # def convert_to_feature(self, cr, uid, ids, context=None):
+ # return self._convert(cr, uid, ids, 'feature_request_categ', context=context)
- def convert_to_bug(self, cr, uid, ids, context=None):
- return self._convert(cr, uid, ids, 'bug_categ', context=context)
+ # def convert_to_bug(self, cr, uid, ids, context=None):
+ # return self._convert(cr, uid, ids, 'bug_categ', context=context)
def copy(self, cr, uid, id, default=None, context=None):
issue = self.read(cr, uid, id, ['name'], context=context)
default['name'] = issue['name'] + _(' (copy)')
return super(project_issue, self).copy(cr, uid, id, default=default,
context=context)
-
+
def write(self, cr, uid, ids, vals, context=None):
#Update last action date every time the user change the stage, the state or send a new email
logged_fields = ['stage_id', 'state', 'message_ids']
# -------------------------------------------------------
# Mail gateway
# -------------------------------------------------------
-
+
def message_new(self, cr, uid, msg, custom_values=None, context=None):
""" Overrides mail_thread message_new that is called by the mailgateway
through message_process.
custom_values.update(self.message_partner_by_email(cr, uid, msg.get('from'), 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)
+ # self.convert_to_bug(cr, uid, [res_id], context=context)
return res_id
def message_update(self, cr, uid, ids, msg, update_vals=None, context=None):
update_vals[key] = res.group(2).lower()
return super(project_issue, self).message_update(cr, uid, ids, update_vals=update_vals, context=context)
-
+
# -------------------------------------------------------
# OpenChatter methods and notifications
# -------------------------------------------------------
-
+
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)
class account_analytic_account(osv.osv):
_inherit = 'account.analytic.account'
_description = 'Analytic Account'
-
+
_columns = {
'use_issues' : fields.boolean('Issues Tracking', help="Check this field if this project manages issues"),
}
-
+
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')
<field name="partner_id" ref="base.res_partner_agrolait"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
- <field name="categ_id" ref="bug_categ"/>
<field name="project_id" ref="project.project_project_22"/>
<field eval="15.0" name="duration"/>
<field eval=""Bug in Accounts module"" name="name"/>
<field eval=""agr@agrolait.com"" name="email_from"/>
- <field name="stage_id" ref="project.project_tt_specification"/>
+ <field name="stage_id" ref="project.project_tt_specification"/>
</record>
<record id="crm_case_programnotgivingproperoutput0" model="project.issue">
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="3.5" name="duration"/>
- <field name="categ_id" ref="bug_categ"/>
<field eval=""Program not giving proper output"" name="name"/>
<field name="project_id" ref="project.project_project_22"/>
<field name="stage_id" ref="project.project_tt_specification"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="2.3" name="duration"/>
- <field name="categ_id" ref="bug_categ"/>
<field name="project_id" ref="project.project_project_23"/>
<field eval=""Output incorrect"" name="name"/>
<field name="stage_id" ref="project.project_tt_development"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="4.0" name="duration"/>
- <field name="categ_id" ref="bug_categ"/>
<field name="project_id" ref="project.project_project_22"/>
<field eval=""Problem loading page"" name="name"/>
<field name="stage_id" ref="project.project_tt_testing"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="1.0" name="duration"/>
- <field name="categ_id" ref="bug_categ"/>
<field name="project_id" ref="project.project_project_22"/>
<field eval=""Page not Found"" name="name"/>
<field name="stage_id" ref="project.project_tt_development"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="4.0" name="duration"/>
- <field name="categ_id" ref="bug_categ"/>
<field name="project_id" ref="project.project_project_22"/>
<field eval=""Programming Error"" name="name"/>
<field name="stage_id" ref="project.project_tt_testing"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="2.0" name="duration"/>
- <field name="categ_id" ref="bug_categ"/>
<field name="project_id" ref="project.project_project_9"/>
<field eval=""Logical Error in Program"" name="name"/>
<field name="stage_id" ref="project.project_tt_testing"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="7.3" name="duration"/>
- <field name="categ_id" ref="bug_categ"/>
<field name="project_id" ref="project.project_project_9"/>
<field eval=""Constraint Error"" name="name"/>
<field name="stage_id" ref="project.project_tt_testing"/>
<field name="partner_id" ref="base.res_partner_5"/>
<field eval="1" name="active"/>
<field eval="1.3" name="duration"/>
- <field name="categ_id" ref="feature_request_categ"/>
<field name="project_id" ref="project.project_project_22"/>
<field eval=""Error in Program"" name="name"/>
<field name="stage_id" ref="project.project_tt_testing"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="13.0" name="duration"/>
- <field name="categ_id" ref="feature_request_categ"/>
<field name="project_id" ref="project.project_project_9"/>
<field eval=""Patches Error in Program"" name="name"/>
<field name="stage_id" ref="project.project_tt_testing"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="3.2" name="duration"/>
- <field name="categ_id" ref="feature_request_categ"/>
<field name="project_id" ref="project.project_project_21"/>
<field eval=""New Features To Be Added"" name="name"/>
<field name="stage_id" ref="project.project_tt_merge"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="3.0" name="duration"/>
- <field name="categ_id" ref="feature_request_categ"/>
<field name="project_id" ref="project.project_project_21"/>
<field eval=""Add menus to the module"" name="name"/>
<field eval=""info@opensides.be"" name="email_from"/>
- <field name="stage_id" ref="project.project_tt_development"/>
+ <field name="stage_id" ref="project.project_tt_development"/>
</record>
<record id="crm_case_includeattendancesheetinproject0" model="project.issue">
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="2.0" name="duration"/>
- <field name="categ_id" ref="feature_request_categ"/>
<field name="project_id" ref="project.project_project_9"/>
<field eval=""Include Attendance sheet in Project"" name="name"/>
<field eval=""contact@tecsas.fr"" name="email_from"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="2.45" name="duration"/>
- <field name="categ_id" ref="feature_request_categ"/>
<field name="project_id" ref="project.project_project_22"/>
<field eval=""Create new object"" name="name"/>
<field name="stage_id" ref="project.project_tt_specification"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="15.0" name="duration"/>
- <field name="categ_id" ref="feature_request_categ"/>
<field name="project_id" ref="project.project_project_22"/>
<field eval=""Improve Reports in HRMS"" name="name"/>
<field name="stage_id" ref="project.project_tt_development"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="1" name="active"/>
<field eval="06.15" name="duration"/>
- <field name="categ_id" ref="feature_request_categ"/>
<field name="project_id" ref="project.project_project_22"/>
<field eval=""Improve Reports in PMS"" name="name"/>
<field name="stage_id" ref="project.project_tt_specification"/>
<field name="user_id"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>
<field name="email_from"/>
- </group><group>
+ </group>
+ <group>
<field name="task_id" on_change="onchange_task_id(task_id)"/>
- <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
+ <field name="categ_ids" widget="many2many_tags"/>
<field name="version_id" widget="selection"/>
<field name="priority"/>
<field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/>
<field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/>
<field name="stage_id" widget="selection" readonly="1"/>
<field name="state" groups="base.group_no_one"/>
- <field name="categ_id" invisible="1"/>
+ <field name="categ_ids" invisible="1"/>
<field name="task_id" invisible="1"/>
</tree>
</field>
domain="[]" context="{'group_by':'version_id'}"/>
<separator orientation="vertical"/>
<filter string="Category" icon="terp-stock_symbol-selection" domain="[]"
- context="{'group_by':'categ_id'}"/>
+ context="{'group_by':'categ_ids'}"/>
<filter string="Priority" icon="terp-rating-rated" domain="[]"
context="{'group_by':'priority'}"/>
<filter string="Stage" icon="terp-stage" domain="[]"
<t t-name="kanban-tooltip">
<ul class="oe_kanban_tooltip">
<li><b>Project:</b> <field name="project_id"/></li>
- <li><b>Category:</b> <field name="categ_id"/></li>
+ <li><b>Category:</b> <field name="categ_ids"/></li>
</ul>
</t>
<t t-name="kanban-box">
'opening_date': fields.date('Date of Opening', readonly=True),
'creation_date': fields.date('Creation Date', readonly=True),
'date_closed': fields.date('Date of Closing', readonly=True),
- 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue')]"),
+ 'categ_ids': fields.many2many('project.category', 'project_issue_categ_rel', 'project_issue_id', 'project_category_id', 'Categories'),
'stage_id': fields.many2one('project.task.type', 'Stage'),
'nbr': fields.integer('# of Issues', readonly=True),
'working_hours_open': fields.float('Avg. Working Hours to Open', readonly=True),
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="section_id" invisible="1"/>
<field name="user_id" invisible="1"/>
- <field name="categ_id" invisible="1"/>
+ <field name="categ_ids" invisible="1"/>
<field name="channel_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
- <field name="task_id" invisible="1"/>
+ <field name="task_id" invisible="1"/>
<field name="date_closed" invisible="1"/>
<field name="state" invisible="1"/>
<field name="day" invisible="1"/>