[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'),
|
||||
('cancel', 'Canceled')], string='Status',
|
||||
required=True, readonly=True, default='draft')
|
||||
required=True, default='draft')
|
||||
priority = fields.Selection([('0', 'Not evaluated'), ('1', 'Low'),
|
||||
('2', 'Medium'), ('3', 'High'),
|
||||
('4', 'Urgent')],
|
||||
@ -57,8 +57,11 @@ class CrmAction(models.Model):
|
||||
@api.depends('action_type_id.name', 'details')
|
||||
def _compute_display_name(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.details or u'')
|
||||
details)
|
||||
|
||||
@api.multi
|
||||
def confirm(self):
|
||||
|
@ -113,7 +113,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Actions" color="user_id" date_start="date">
|
||||
<field name="partner_id" />
|
||||
<field name="details" />
|
||||
<field name="display_name" />
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
|
Loading…
x
Reference in New Issue
Block a user