mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[ADD] Add start_date to contract_line display_name
In order to help distinguishing lines with the same name
This commit is contained in:
committed by
Denis Roussel
parent
412ec28dfc
commit
74f487d665
@@ -7,6 +7,7 @@ from odoo import api, fields, models
|
||||
|
||||
class AccountAnalyticInvoiceLine(models.Model):
|
||||
_inherit = 'account.analytic.invoice.line'
|
||||
_rec_name = 'display_name'
|
||||
|
||||
sale_order_line_id = fields.Many2one(
|
||||
comodel_name="sale.order.line",
|
||||
@@ -51,3 +52,8 @@ class AccountAnalyticInvoiceLine(models.Model):
|
||||
rec.termination_notice_rule_type = (
|
||||
rec.product_id.termination_notice_rule_type
|
||||
)
|
||||
|
||||
@api.depends('name', 'date_start')
|
||||
def _compute_display_name(self):
|
||||
for rec in self:
|
||||
rec.display_name = ("%s - %s") % (rec.date_start, rec.name)
|
||||
|
||||
Reference in New Issue
Block a user