Community mailing list archives

community@mail.odoo.com

Re: Monetary formatted values in all financial amounts

by
OpenERP Master
- 09/07/2015 02:37:26
Hello,

So just for the record, it is not possible to use any currency symbol in a tree view or a listview. The widget by Odoo only is defined in the form js. A bug was reported back in 2013 and added to the wish list. I was able to accomplish the required functionality by using a pseudo css selector.

I also noticed some questionable behavior. When you click edit, and then click on a record, the data is actually has a layer displayed on top of it with a form instance. IMO this is questionable design. You can notice because readonly fields will have value left justified but then reverted when you save. It is sort of ugly.

Also, the way a monetary field is displayed is by using a span tag and then having 2 elements inside. It sort of seems half - assed

On Thu, Sep 3, 2015 at 11:17 AM, OpenERP Master <openerpmaster@gmail.com> wrote:
Hello,

I am not sure the solution you have presented works. The currency field works, but only in a form view. It does not display any currency symbol in a tree view, which is the problem that I have. I created a new module and tested, but was not able to get the currency symbol to display on a tree view.

On Thu, Sep 3, 2015 at 4:58 AM, Caudal Eric <caudaleric@gmail.com> wrote:

To be noted this localized: sometimes before, sometimes after...


On Thu, Sep 3, 2015, 17:22 Leonardo "LeartS" Donelli <learts92@gmail.com> wrote:
Odoo has a "standard" way to do this: you can pass the option
'currency_field' to the monetary fields, and the widget will show the
currency symbol (even in the correct position according to the
currency rules!). The problem is that for every model where you want
to display the currency you must have a field referencing the
currency!

This is an example from the sale view, the total untaxed amount
(where, in fact, you can see the currency)::

    

If you really want to always display a $ amount after every monetary
value, as an extremely ugly but simple hack (and you will lose
multiple currency support) you can extend the xml for the monetary
widget that you find here[1] and just add a "$" sign after the amount.
There are better ways to do it, like extending the currency_field
mechanism to default to a standard currency ($ in your case) when no
currency_field is specified, but it requires a little (just a little!)
more work.

1: https://github.com/odoo/odoo/blob/8.0/addons/web/static/src/xml/base.xml#L2017
2015-09-03 6:36 GMT+02:00 OpenERP Master <openerpmaster@gmail.com>:
> I am not sure how to proceed. For anyone, I will send you $100 USD via
> PayPal if you can provide a working solution to show the $ sign as a
> widget="whatever" on a tree view.
>
> On Thu, Aug 20, 2015 at 2:52 AM, Leonardo "LeartS" Donelli
> <learts92@gmail.com> wrote:
>>
>> Take a look here: https://www.odoo.com/documentation/8.0/howtos/web.html
>> particularly:
>> https://www.odoo.com/documentation/8.0/howtos/web.html#the-form-view-fields
>>
>> What you want to do is extend the standard monetary widget.
>>
>> Here is an example of a module that extends a standard widget (the
>> datetime widget):
>> https://github.com/OCA/web/tree/8.0/web_widget_datepicker_options
>>
>> _______________________________________________
>> Mailing-List: https://www.odoo.com/groups/community-59
>> Post to: mailto:community@mail.odoo.com
>> Unsubscribe: https://www.odoo.com/groups?unsubscribe
>
>
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-59
> Post to: mailto:community@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

--

Eric  Caudal (from my mobile)

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe