Skip to content
Permalink
Browse files

[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
  • Loading branch information...
william-andre committed Jul 16, 2019
1 parent 044904b commit 81db46f2c216391ff9942efbd2bdb0f5c44d081b
Showing with 5 additions and 4 deletions.
  1. +5 −4 addons/account/models/account_move.py
@@ -2997,10 +2997,11 @@ def default_get(self, default_fields):
def name_get(self):
result = []
for line in self:
if line.ref:
result.append((line.id, (line.move_id.name or '') + '(' + line.ref + ')'))
else:
result.append((line.id, line.move_id.name))
name = line.move_id.name or ''
ref = line.ref or line.name or line.product_id.display_name
if ref:
name += " (%s)" % ref
result.append((line.id, name))
return result

# -------------------------------------------------------------------------

0 comments on commit 81db46f

Please sign in to comment.
You can’t perform that action at this time.