[IMP] account: display the product in the name_get of account.move.line

It is difficult to select an account.move.line of an invoice if there is a product but no label on the line. By showing the name of the product, we know what line we are choosing

closes odoo/odoo#37596

X-original-commit: cf53f9c1909f85bdcb34f9acf79df1c8dc2a2da5
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This commit is contained in:
wan
2019-09-30 12:30:08 +00:00
committed by fw-bot
parent 338997d7a1
commit f701070177
+4 -3
View File
@@ -3215,10 +3215,11 @@ class AccountMoveLine(models.Model):
def name_get(self):
result = []
for line in self:
name = line.move_id.name or ''
if line.ref:
result.append((line.id, (line.move_id.name or '') + '(' + line.ref + ')'))
else:
result.append((line.id, line.move_id.name))
name += " (%s)" % line.ref
name += (line.name or line.product_id.display_name) and (' ' + (line.name or line.product_id.display_name)) or ''
result.append((line.id, name))
return result
# -------------------------------------------------------------------------