← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 711737] Re: [V6.0.1 & V5.0.15] account_analytic_analysis: last_invoice_date field does not include manual invoices

 

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

** Changed in: openobject-addons
       Status: New => Confirmed

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP R&D Addons Team 3 (openerp-dev-addons3)

-- 
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/711737

Title:
  [V6.0.1 & V5.0.15] account_analytic_analysis: last_invoice_date field
  does not include manual invoices

Status in OpenERP Modules (addons):
  Confirmed

Bug description:
  Hello,

  When installing module account_analytic_analysis, it provides a new
  tab in the analytic account form with many informations about the
  account (mainly used in services companies).

  Amongst all the fields, you find these two fields with the following
  help text:

  1. Date of last invoiced cost (last_worked_invoiced_date): "If invoice
  from the costs, this is the date of the latest work or cost that have
  been invoiced". This means this date is refreshed each time you create
  an invoice from the automatic billing (action button) and it works
  fine.

  2. Last invoice date (last_invoice_date): "Date of the last invoice created for this analytic account". This means you should see the latest invoice date, the invoice coming from the automatic billing or the invoice having been made manually. Here is the issue: you never see manual invoices date in that field ! 
  So this field brings nothing different than the "Date of last invoiced cost"
   
  I had a look on the code and see where is the issue:

  In the cr.execute that feeds last_invoice_date, it mentions "AND
  account_analytic_line.invoice_id IS NOT NULL". As only automatic
  billing feeds the field invoice_id, it can't read the manual invoices
  put on the analytic account...

  I see two ways to fix that issue:
  - Feeding automatically account_analytic_line.invoice_id also when a manual invoice is done.
  - Changing the SQL in the cr.execute to include also a search on account_invoice_line using current analytic account (probably the worst solution in terms of system performance)

  In both cases there should be a check on parent account_invoice
  record, in order to see if the invoice type is "out_invoice" so we are
  sure it is only billing to the client.

  I think this change will be very useful as many service companies are not always using automatic billing, but are using manual invoices: 
  - no pure time & materials contracts, so you can't charge all of the costs automatically 
  - when using several accounts for the different phases on a huge project, they want to be able to provide periodically invoices on all phases in one invoice document (using the automatic billing generates one invoice per analytic account).

  I hope it helps.

  Regards,

  Bernard





References