Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal precision not applied with statinfo widget #8203

Closed
yannprada opened this issue Aug 24, 2015 · 1 comment
Closed

Decimal precision not applied with statinfo widget #8203

yannprada opened this issue Aug 24, 2015 · 1 comment

Comments

@yannprada
Copy link
Contributor

Decimal precision not applied with statinfo widget

Impacted versions:

  • 8.0

Steps to reproduce:

  1. create float field , using decimal precision:
my_float = fields.Float(digits=dp.get_precision('Account'))
  1. create a form view, put this field in a statinfo widget:
<button class="oe_inline oe_stat_button" icon="fa-file-text-o"
        name="btn_something" type="object">
    <field string="Something" widget="statinfo" name="my_float"/>
</button>
  1. create a record

Current behavior:

  • Statinfo widget does not apply the precision on your float

Expected behavior:

  • Statinfo widget apply the precision on your float
@yannprada
Copy link
Contributor Author

Nevermind, I found a good working example, using the monetary widget inside the stat button, at account/partner_view.xml in the record with id partner_view_buttons:

<button type="action" 
    class="oe_stat_button"
    id="invoice_button"
    icon="fa-pencil-square-o"
    name="%(account.action_invoice_refund_out_tree)d"
    attrs="{'invisible': [('customer', '=', False)]}" 
    context="{'search_default_partner_id': active_id,'default_partner_id': active_id}">
    <div><strong><field name="total_invoiced" widget="monetary"/></strong><br/>Invoiced</div>
</button>

nle-odoo added a commit to odoo-dev/odoo that referenced this issue Apr 12, 2019
Since f4fbaf1 the structure of checkboxes has been improved, now we
have something like:

```
 <input type="checkbox" id="checkbox-18" class="custom-control-input">
 <label for="checkbox-18" class="custom-control-label">&odoo#8203;</label>
```

With the first input invisible (whilst before it was visible and the
clickable element).

This cause an issue in an editable list view:

- we have a boolean readonly field in a cell
- we are on focused on a line (not in the boolean field cell)
- we click on the boolean field

=> the check mark is toggled

This is because when we switch cell, we try to activate the widget of
the other cell. Before f4fbaf1 this issue did not happen since the
browser do not generate a click event when clicking a disabled checkbox.

With this changeset, a disabled FieldBoolean is not focusable as is the
case for other fields, so we can't "activate" it.

Without the fix, the added test fails with:

 [clicking disabled checkbox did not work]

opw-1958433
closes odoo#32652
robodoo pushed a commit that referenced this issue Apr 12, 2019
Since f4fbaf1 the structure of checkboxes has been improved, now we
have something like:

```
 <input type="checkbox" id="checkbox-18" class="custom-control-input">
 <label for="checkbox-18" class="custom-control-label">&#8203;</label>
```

With the first input invisible (whilst before it was visible and the
clickable element).

This cause an issue in an editable list view:

- we have a boolean readonly field in a cell
- we are on focused on a line (not in the boolean field cell)
- we click on the boolean field

=> the check mark is toggled

This is because when we switch cell, we try to activate the widget of
the other cell. Before f4fbaf1 this issue did not happen since the
browser do not generate a click event when clicking a disabled checkbox.

With this changeset, a disabled FieldBoolean is not focusable as is the
case for other fields, so we can't "activate" it.

Without the fix, the added test fails with:

 [clicking disabled checkbox did not work]

opw-1958433
closes #32652

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant