← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 627089] Re: [trunk] - filter "this month" returns this month of all available years

 

** Changed in: openobject-addons
   Importance: Medium => Undecided

** Changed in: openobject-addons
       Status: Confirmed => Fix Released

** Changed in: openobject-addons
     Assignee: vir (Open ERP) (vir-tinyerp) => (unassigned)

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/627089

Title:
  [trunk] - filter "this month" returns this month of all available years

Status in OpenObject Addons Modules:
  Fix Released

Bug description:
  in many modules month is defined for reporting as

'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ...

and filter condition like

<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Sale journal in this month"/>

Please confirm that this will only select resources from this years month.

or is it necessary to click the buttons "this year" + "this month" to get only the records of THIS month which I would consider not as user friendly at all and a source of errors.

IMHO instead of using "This month" it would be necessary to use period_id = current_period etc as defined in
./account/report/account_entries_report.py

BTW I am sure that a filter on month in this view will cause performance problems (full table scan) in the long run.
create or replace view account_entries_report as (
            select
                l.id as id,
                am.date as date,
                l.date_maturity as date_maturity,
                l.date_created as date_created,
                am.ref as ref,
                am.state as state,
                l.state as state_2,
                l.reconcile_id as reconcile_id,
                to_char(am.date, 'YYYY') as year,
                to_char(am.date, 'MM') as month,
                to_char(am.date, 'YYYY-MM-DD') as day 

BTW I strongly suggest to store and index period_id in ALL sort of move records.

please see also
https://bugs.launchpad.net/openobject-addons/+bug/626867
for discussion about necessary filters for day to day business