Hello, I have Odoo 8 and I am developing a module.
I want to add a new filter button in Accounting->Invoices, with this domain:
domain="[('date_invoice','<=',((context_today()-datetime.timedelta(days=10)).strftime('%Y-%m-%d'))), ('state', '=', 'open')]"
How must I define the .xml view to add the filter with this domain? I was searching and trying but I don't found the way. Thanks!
You try like this:
<record id="view_account_invoice_filter_inherited" model="ir.ui.view">
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<xpath expr="/search/filter" position="after">
<filter name="open" string="Open" domain="[('date_invoice','<=',((context_today()-datetime.timedelta(days=10)).strftime('%Y-%m-%d'))), ('state', '=', 'open')]" help="Invoices Open"/>
Add this record to the xml file of your custom module. If your domain condition is correct, then I think this should work for you. Hope this helps you.
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
|Asked: 2/2/15, 9:10 AM|
|Seen: 2112 times|
|Last updated: 3/16/15, 8:10 AM|