Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In OpenERP, you may need to create custom filters for frequently used filters like Today's sales, Today's collections etc.

...

Below are couple of examples:

Today's sales

  • Model = Sales Order
  • Domain = 

    [
    ['date_order', '>=', context_today().strftime('%Y-%m-%d')],
    ['date_order', '<', (context_today() + datetime.timedelta(1)).strftime('%Y-%m-%d')],
    ]

  • Context = {}

Today's collections

  • Model = Accounting Voucher
  • Domain = [['date', '=', context_today().strftime('%Y-%m-%d')], ['journal_id', 'ilike', 'CASH']]
  • Context = {}

Products Not Sold in Past 30 days

  • Model = Products report by last moved
  • Domain =[['last_moved_date', '<', (context_today() - datetime.timedelta(30)).strftime('%Y-%m-%d')]]
  • Context = {}

The above filter can be modified for any 'n' number of days