コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
13902 ビュー

How can I add "Date from" & "Date to" fields in Search view in Sales > Invoicing > All Uninvoiced Entries. The current code is as follows. How to change it. Please advice.

<search string="Search Analytic Lines">
                <group>
                    <filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-camera_test" help="Analytic Journal Items related to a sale journal."/>
                    <filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase" help="Analytic Journal Items related to a purchase journal."/>
                    <filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]" icon="terp-folder-orange"/>
                    <separator orientation="vertical"/>
                    <field name="date"/>
                    <field name="name"/>
                    <field name="account_id"/>
                    <field name="user_id">
                        <filter string="My Entries" domain="[('user_id','=',uid)]" icon="terp-personal"/>
                    </field>
                </group>
                <newline/>
                <group string="Group By..." expand="0">
                    <filter string="Account" context="{'group_by':'account_id'}" groups="base.group_extended" icon="terp-folder-green"/>
                    <filter string="Journal" context="{'group_by':'journal_id'}" icon="terp-folder-orange"/>
                    <filter string="User" context="{'group_by':'user_id'}" icon="terp-personal"/>
                    <separator orientation="vertical"/>
                    <filter string="Fin.Account" context="{'group_by':'general_account_id'}" icon="terp-folder-green"/>
                    <separator orientation="vertical"/>
                    <filter string="Product" context="{'group_by':'product_id'}" icon="terp-accessories-archiver"/>
                </group>
            </search>
アバター
破棄
最善の回答

Hi, You can add two fields in your .py :

'date_from':fields.function(lambda *a,**k:{}, method=True, type='date',string="Date from"),
'date_to':fields.function(lambda *a,**k:{}, method=True, type='date',string="Date to"),

and in search_view:

<field name="date_from" filter_domain="[('date_invoice','&gt;=',self)]"/>
<field name="date_to" filter_domain="[('date_invoice','&lt;=',self)]"/>
アバター
破棄

add domain as state in 'draft' or 'manual'

Many thanks!

関連投稿 返信 ビュー 活動
0
7月 22
1945
1
3月 15
5118
1
10月 23
2291
1
1月 23
5928
3
6月 16
7927