Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
7928 Weergaven

We have both sales and purchase orders nominated in different currencies.

All tree views are simply adding the figures (which is totally useless and unacceptable by anyone who is not a programmer :) ).

I want to add a 'group by' filter in the search view using "currency_id". But it doesn't work as it seems I cannot use this type of field here.

any other field related to the currency I could use? Or any other idea to make sense of these tree views?

 

TIA

Avatar
Annuleer
Beste antwoord

On sale order, currency_id is a related field based on pricelist_id so you could use pricelist_id, or you could create a new module, inherit sale.order and override the field to make it stored.  I think a simple store=True would be fine as the currency on a price list is unlikely to change.

 

On Invoices, create a new view in your module, inherit from the invoice search view and add the currency_id in as a group by.

       <record id="view_my_module_account_invoice_search" model="ir.ui.view">
            <field name="name">my.module.account.invoice.search</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.view_account_invoice_filter"/>
            <field name="arch" type="xml">
                <xpath expr="//group/filter[@string='Due Date']" position="after">
                    <filter string="Currency" domain="[]" context="{'group_by':'currency_id'}"/>
                </xpath>
            </field>
        </record>

Avatar
Annuleer
Auteur Beste antwoord

For infos: step-by-step:

1. activate developper mode

2. go to sales / Sales order

3. select "edit search view"

4. insert "<filter string="Currency" icon="terp-partner" domain="[]" context="{'group_by':'pricelist_id'}"/>" just after the line starting with " <filter string="Order Date" icon..."

5. go to reporting / sales analysis

6. redo point 3 & 4 here too.

Voila.

Thank you Adrian.

 

Avatar
Annuleer

Thanks, this helped me today!

Gerelateerde posts Antwoorden Weergaven Activiteit
1
aug. 15
8288
0
mrt. 15
4982
0
dec. 24
9517
3
sep. 24
21775
5
dec. 24
53062