Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

widget="monetary" for List Views

By
Gregor Heger
on 6/9/15, 10:00 AM 917 views

Hi,

as some people may know, using "widget="monetary" options="{'currency_field': 'currency_id'}" in form view, works, but doesn't work in List Views. By that, some of my list views become really confusing, because for each price column, I have to add a separate currency column.

I can't believe that this "monetary" widget still does not exist for listviews. Has anyone heard about an existing extension for odoo? Thanks!

1
Travis Waelbroeck
On 9/22/16, 12:33 PM

Hello,


The Monetary widget can be used in list views as well, but the "currency_id" field must be present within the tree itself as well.


For example, my invoice form did not have the currency for the price_unit field, so I was able to add it with the following custom view:


<record id="invoice_pretty_price_form_tree" model="ir.ui.view">
 <field name="name">Account Invoice Pretty Price Form Tree</field>
 <field name="model">account.invoice</field>
 <field name="inherit_id" ref="account.invoice_form"/>
 <field name="arch" type="xml">
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='price_unit']" position="before">
            <field name="currency_id"/>
        </xpath>
        <xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='price_unit']" position="replace">
            <field name="price_unit" widget="monetary" options="{'currency_field': 'currency_id'}"/>
        </xpath>
    </field>
</record>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/9/15, 10:00 AM
Seen: 917 times
Last updated: 9/22/16, 12:33 PM