diff options
| author | Jorge Pinna Puissant <jpp@odoo.com> | 2019-01-24 13:26:12 +0000 |
|---|---|---|
| committer | Jorge Pinna Puissant <jpp@odoo.com> | 2019-01-24 13:26:12 +0000 |
| commit | 93614a35eb08d05a4ac0eb11207d34245eb70c72 (patch) | |
| tree | f06267c80cffd8d556cc264a25820f8bf75846c9 /addons | |
| parent | c5eeae0d5a4a697ea038591b3aa64f9d6e3c20af (diff) | |
[FIX] account: invoice outstanding credits display
Before this commit, in the customer invoice form, when the outstanding
credits have a big reference or name, the form displayed the name in a
multiple line which made difficult to read and to understand when a
credit starts, and when a credit stops. It also overlapped the name and
the amounts.
Now, when the name is too big, it's truncated, and the full name is
shown when the mouse hovers the field.
OPW-1915966
closes odoo/odoo#30518
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/models/account_invoice.py | 5 | ||||
| -rw-r--r-- | addons/account/static/src/xml/account_payment.xml | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 891c048d216..dfaa6e5944d 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -144,8 +144,13 @@ class AccountInvoice(models.Model): amount_to_show = line.company_id.currency_id.with_context(date=line.date).compute(abs(line.amount_residual), self.currency_id) if float_is_zero(amount_to_show, precision_rounding=self.currency_id.rounding): continue + if line.ref : + title = '%s : %s' % (line.move_id.name, line.ref) + else: + title = line.move_id.name info['content'].append({ 'journal_name': line.ref or line.move_id.name, + 'title': title, 'amount': amount_to_show, 'currency': currency_id.symbol, 'id': line.id, diff --git a/addons/account/static/src/xml/account_payment.xml b/addons/account/static/src/xml/account_payment.xml index 88d0ae3c3d0..530af03348c 100644 --- a/addons/account/static/src/xml/account_payment.xml +++ b/addons/account/static/src/xml/account_payment.xml @@ -16,8 +16,8 @@ <td> <a title="assign to invoice" role="button" class="oe_form_field outstanding_credit_assign" t-att-data-id="line.id" style="margin-right: 10px;">Add</a> </td> - <td> - <span class="oe_form_field" style="margin-right: 30px;"><t t-esc="line.journal_name"></t></span> + <td style="max-width: 10em;"> + <div class="oe_form_field" style="margin-right: 30px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;" t-att-title="line.title"><t t-esc="line.journal_name"></t></div> </td> </t> <t t-if="!outstanding"> |
