[IMP] project, industry_fsm: adapt task's planning and fsm kanban

The goal here is to share the same kanban between fsm and project. A few tweaks are also done to the project kanban.
As in fsm the kanban group by is different we still had to do a primary inherit in fsm.

related task 2009563
This commit is contained in:
MaxLarue
2019-08-23 10:15:40 +00:00
committed by jem-odoo
parent 4667ee3f6e
commit 322edd8df4
2 changed files with 15 additions and 11 deletions
+1
View File
@@ -513,6 +513,7 @@ class Task(models.Model):
string='Customer',
default=lambda self: self._get_default_partner(),
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
partner_city = fields.Char(related='partner_id.city', readonly=False)
manager_id = fields.Many2one('res.users', string='Project Manager', related='project_id.user_id', readonly=True, related_sudo=False)
company_id = fields.Many2one('res.company', string='Company', required=True, default=_default_company_id)
color = fields.Integer(string='Color Index')
+14 -11
View File
@@ -564,14 +564,15 @@
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title"><field name="name"/></strong><br/>
<small class="o_kanban_record_subtitle text-muted">
<field name="project_id" invisible="context.get('default_project_id', False)"/>
</small>
<small class="o_kanban_record_subtitle text-muted">
<t t-if="record.partner_id.value"><span><field name="partner_id"/></span></t>
<t t-else="record.email_from.raw_value"><span><field name="email_from"/></span></t>
</small>
<strong class="o_kanban_record_title"><field name="name"/></strong>
<span invisible="context.get('default_project_id', False) or context.get('fsm_mode', False)"><br/><field name="project_id"/></span>
<br />
<t t-if="record.partner_id.value">
<span>
<field name="partner_id"/><t t-if="record.partner_city.value"> • <field name="partner_city" /></t>
</span>
</t>
<t t-else="record.email_from.raw_value"><span><field name="email_from"/></span></t>
</div>
<div class="o_dropdown_kanban dropdown" t-if="!selection_mode" groups="base.group_user">
<a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" data-display="static" href="#" aria-label="Dropdown menu" title="Dropdown menu">
@@ -588,7 +589,7 @@
</div>
</div>
<div class="o_kanban_record_body">
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" invisible="context.get('fsm_mode', False)"/>
<div t-if="record.displayed_image_id.value">
<field name="displayed_image_id" widget="attachment_image"/>
</div>
@@ -607,10 +608,12 @@
</b>
<t t-if="record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().startOf('day')" t-set="deadline_class">oe_kanban_text_red</t>
<t t-elif="record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().endOf('day')" t-set="deadline_class">text-warning font-weight-bold</t>
<span t-attf-class="#{deadline_class || ''}"><field name="date_deadline"/></span>
<t t-if="record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().startOf('day')" t-set="date" t-value="moment(record.date_deadline.raw_value.toISOString()).format('h:mm A')" />
<t t-elif="record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().endOf('day')" t-set="date" t-value="moment(record.date_deadline.raw_value.toISOString()).format('h:mm A')" />
<span name="date" t-attf-class="#{deadline_class || ''}"><t t-esc="date" /></span>
</div>
<div class="oe_kanban_bottom_right" t-if="!selection_mode">
<field name="kanban_state" widget="state_selection" groups="base.group_user"/>
<field name="kanban_state" widget="state_selection" groups="base.group_user" invisible="context.get('fsm_mode', False)"/>
<img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</div>
</div>