Project : Progressbar of project should be updated based on task changes.

Bug #655034 reported by Laurent Urbain (Realdolmen)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 1

Bug Description

There is a regression in the last trunk version,

The progressbar of the project no longer progress when the tasks advance

There is too a problem with the link between analytic and task work.

I link a user with a product with timesheet module but when I fill in the task work, the amount of the analytic entries is 0

Laurent

Revision history for this message
Laurent Urbain (Realdolmen) (laurent-urbain) wrote :

I made an error.
It's a bug for the Openobject-addons

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello, I confirm the bug BTW, it's due to the recent store=True change for computed fields without using invalisation trigger functions with store={hash of triggers} such as what is done in sale.order or account.invoice.
I've been really surprised such a thing as been committed without double check here.

affects: openobject-server → openobject-addons
Changed in openobject-addons:
assignee: nobody → DHS(OpenERP) (dhs-openerp)
Changed in openobject-addons:
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Hello Laurent,

I completely agree with your information that progress bar does not work when task is updated.
But I could not find an error related to analytic entry.

I would like to request you to apply this patch and please notify us.

Thanks.

Revision history for this message
Laurent Urbain (Realdolmen) (laurent-urbain) wrote :

Hi,

Thanks for your work.

But I have an error with the patch :

File "/home/laurent/workspace/OpenERP/bin/addons/project/project.py", line 49, in <module>
    class project(osv.osv):
  File "/home/laurent/workspace/OpenERP/bin/addons/project/project.py", line 179, in project
    'project.task': (_get_task_ids, None, 50),
NameError: name '_get_task_ids' is not defined

Changed in openobject-addons:
milestone: none → 6.0
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi Laurent,

Here is an updated patch.

Thanks DHS for the inspiring patch.

Would you please apply the patch,update the module and check?

Thanks again.

Revision history for this message
Laurent Urbain (Realdolmen) (laurent-urbain) wrote :

Hi,

Thanks a lot.

The progressbar works again.

There is yet a problem with the analytic account.
I think it's a problem with timesheets module

My english is not perfect so some screenshots can maybe help to understand :

I have a Employee who is link with a Product.
The product Cost price = 100 €
http://www.imagup.com/pics/1286450504.html

I create a task and I fill in the line Task work
http://www.imagup.com/pics/1286450659.html

The in the analytic account of the project
The quantity = 8 but Credit is = 0 instead of 800.
http://www.imagup.com/pics/1286450930.html

Revision history for this message
Richard (John) Nopkins@Servosoft (richard-nopkins) wrote :

WTF Jay(OpenERP),you almost overflew my inbox with 90 emails by more than usual fixes today.
btw,patch is satisfactory.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

@Laurent,
I will take a look at this very soon. Thanks.

@John,
Thanks for the compliments.

summary: - [Trunk][Project] Progressbar of project don't work anymore
+ Project : Progressbar of project should be updated based on task
+ changes.
Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Hello Laurent,

Yes, I confirm the problem of analytic account set as 0.

The reason is, the create() of timesheet line based on task work does not pass journal_id.
I have made the appropriate changes in the code.

Would you please apply the patch and notify us?

Many thanks for your interest.

Revision history for this message
Laurent Urbain (Realdolmen) (laurent-urbain) wrote :

Hi

From my point of view it work's without problem

Thanks a lot for the work and the fastness!

Laurent

Revision history for this message
Laurent Urbain (Realdolmen) (laurent-urbain) wrote :

In the last trunk version, the patch don't works anymore.

I have the error :

File "/home/laurent/workspace/OpenERP/bin/addons/project_timesheet/project_timesheet.py", line 101, in create
    prod_id, amount, False, unit, result['journal_id'], context=context)
  File "/home/laurent/workspace/OpenERP/bin/addons/hr_timesheet/hr_timesheet.py", line 67, in on_change_unit_amount
    res.update(self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount, company_id, unit, journal_id, context=context))
TypeError: 'NoneType' object is not iterable

And without patch there is always the same bug.

Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

Hello,

It's resolved in trunk-dev-addons2

Thanks

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :
Revision history for this message
Laurent Urbain (Realdolmen) (laurent-urbain) wrote :

Hi.

In the trunk-dev-addons2, the progressbar works but there is always the second problem of this bug.

The problem of analytic account set as 0.
The patch (Comments 9) corrected the problem in project_timesheet.py but in the last trunk version and trunk-dev-addons2, it don't works anymore.

When I apply the patch on project_timesheet.py and I click on done in task view :

File "/home/laurent/workspace/OpenERP/bin/addons/project_timesheet/project_timesheet.py", line 101, in create
    prod_id, amount, False, unit, result['journal_id'], context=context)
  File "/home/laurent/workspace/OpenERP/bin/addons/hr_timesheet/hr_timesheet.py", line 67, in on_change_unit_amount
    res.update(self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount, company_id, unit, journal_id, context=context))
TypeError: 'NoneType' object is not iterable

I hope my English is understandable :)

Laurent

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

The code has been merged,but the problem still persists.
Moreover, the task is not set 100% if it is set to Done.

Changed in openobject-addons:
status: Fix Committed → Confirmed
assignee: DHS(OpenERP) (dhs-openerp) → nobody
Revision history for this message
Laurent Urbain (Realdolmen) (laurent-urbain) wrote :

I think in the V6-RC1, there is a small error :

The description of the progressbar : Percent of tasks closed according to the total of tasks todo

I think for the moment the calculation is based on time spent/time total
But the task can be done and the time spent not equal to the total time.

The problem of the amount in analytic account still persists
(cfr https://bugs.launchpad.net/openobject-addons/+bug/655034/comments/6)

Changed in openobject-addons:
assignee: nobody → aag(OpenERP) (aag-openerp)
Changed in openobject-addons:
assignee: aag(OpenERP) (aag-openerp) → nobody
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Medium
Revision history for this message
tfr (Openerp) (tfr) wrote :

If the task is 00:00 it won't change the progress bar

Changed in openobject-addons:
status: Confirmed → Invalid
status: Invalid → New
Changed in openobject-addons:
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Bhumika Shrimali (sbh-openerp) wrote :

Hello

It has been fixed in branch lp:~openerp-dev/openobject-addons/trunk-dev-addons1

Thanks.

Changed in openobject-addons:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.