Skip to content

Commit

Permalink
BAH-3521 | Add. Custom filters for quotations and invoices page
Browse files Browse the repository at this point in the history
  • Loading branch information
mohan-13 committed Feb 23, 2024
1 parent 25065d4 commit 74a27f5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions bahmni_sale/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'views/sale_config_settings.xml',
'views/pos_view.xml',
'views/address_views.xml',
'views/custom_filters.xml',
'report/report_discount_heads.xml',
'report/sale_report.xml',
'views/account_invoice_view.xml'],
Expand Down
42 changes: 42 additions & 0 deletions bahmni_sale/views/custom_filters.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_move_view_search_filters" model="ir.ui.view">
<field name="name">account.move.search</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='myinvoices']" position="after">
<separator/>
<filter string="Today Invoices" name="today_invoices" domain="[('create_date','>=',time.strftime('%%Y-%%m-%%d'))]"/>
<filter string="Yesterday Invoices" name="yesterday_invoices"
domain="[('create_date','>=',time.strftime('%%Y-%%m-%%d') - 1)]"/>
<separator/>
</xpath>
</field>
</record>

<record id="sale_order_view_search_filters" model="ir.ui.view">
<field name="name">sale.order.search</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.sale_order_view_search_inherit_quotation"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='my_quotation']" position="after">
<separator/>
<filter string="Today Sales" name="today_sales" domain="[('create_date','>=',time.strftime('%%Y-%%m-%%d'))]"/>
<filter string="Yesterday Sales" name="yesterday_sales"
domain="[('create_date','>=',time.strftime('%%Y-%%m-%%d') - 1)]"/>
<separator/>
</xpath>
</field>
</record>

<record id="sale.action_quotations_with_onboarding" model="ir.actions.act_window">
<field name="context">{'search_default_today_sales':1}</field>
</record>

<record id="account.action_move_out_invoice_type" model="ir.actions.act_window">
<field name="context">{'move_type':'out_invoice', 'journal_type': 'sale', 'readonly_by_pass': True, 'search_default_today_invoices':1}</field>
</record>


</odoo>

0 comments on commit 74a27f5

Please sign in to comment.