Browse Source

[ADD] Add start_date to contract_line display_name

In order to help distinguishing lines with the same name
pull/208/head
Quentin Groulard 5 years ago
committed by Thomas Binsfeld
parent
commit
1161905e97
  1. 6
      product_contract/models/contract_line.py

6
product_contract/models/contract_line.py

@ -7,6 +7,7 @@ from odoo import api, fields, models
class AccountAnalyticInvoiceLine(models.Model): class AccountAnalyticInvoiceLine(models.Model):
_inherit = 'account.analytic.invoice.line' _inherit = 'account.analytic.invoice.line'
_rec_name = 'display_name'
sale_order_line_id = fields.Many2one( sale_order_line_id = fields.Many2one(
comodel_name="sale.order.line", comodel_name="sale.order.line",
@ -51,3 +52,8 @@ class AccountAnalyticInvoiceLine(models.Model):
rec.termination_notice_rule_type = ( rec.termination_notice_rule_type = (
rec.product_id.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)
Loading…
Cancel
Save