Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
7902 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis Jawaban Terbai

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
Buang

Thanks, this helped me today!

Post Terkait Replies Tampilan Aktivitas
1
Agu 15
8249
0
Mar 15
4913
0
Des 24
9471
3
Sep 24
21676
5
Des 24
52964