[IMP]CRM Actoin : better display name
This commit is contained in:
parent
e1385de5e0
commit
f1388adcc5
@ -31,7 +31,7 @@ class CrmAction(models.Model):
|
|||||||
|
|
||||||
state = fields.Selection([('draft', 'Todo'), ('done', 'Done'),
|
state = fields.Selection([('draft', 'Todo'), ('done', 'Done'),
|
||||||
('cancel', 'Canceled')], string='Status',
|
('cancel', 'Canceled')], string='Status',
|
||||||
required=True, readonly=True, default='draft')
|
required=True, default='draft')
|
||||||
priority = fields.Selection([('0', 'Not evaluated'), ('1', 'Low'),
|
priority = fields.Selection([('0', 'Not evaluated'), ('1', 'Low'),
|
||||||
('2', 'Medium'), ('3', 'High'),
|
('2', 'Medium'), ('3', 'High'),
|
||||||
('4', 'Urgent')],
|
('4', 'Urgent')],
|
||||||
@ -57,8 +57,11 @@ class CrmAction(models.Model):
|
|||||||
@api.depends('action_type_id.name', 'details')
|
@api.depends('action_type_id.name', 'details')
|
||||||
def _compute_display_name(self):
|
def _compute_display_name(self):
|
||||||
for action in self:
|
for action in self:
|
||||||
|
details = u'...'
|
||||||
|
if action.details:
|
||||||
|
details = u' '.join(action.details.split()[:5]) + details
|
||||||
action.display_name = u'[{}]{}'.format(action.action_type_name,
|
action.display_name = u'[{}]{}'.format(action.action_type_name,
|
||||||
action.details or u'')
|
details)
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def confirm(self):
|
def confirm(self):
|
||||||
|
@ -113,7 +113,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<calendar string="Actions" color="user_id" date_start="date">
|
<calendar string="Actions" color="user_id" date_start="date">
|
||||||
<field name="partner_id" />
|
<field name="partner_id" />
|
||||||
<field name="details" />
|
<field name="display_name" />
|
||||||
</calendar>
|
</calendar>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user