[7.0] project - duplicating res_partner duplicates task_ids

Bug #1189524 reported by Yannick Vaucher @ Camptocamp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 1

Bug Description

On database with some datas, this fail the duplication of the res_partner.

I don't think it is a good idea to duplicate task_ids, it should be set in copy's default argument.

    Une erreur est apparue lors de la validation du/des champ(s) task_id,account_id: Error! Task must belong to the project.
    Traceback (most recent call last):
      File ".../server/openerp/netsvc.py", line 293, in dispatch_rpc
        result = ExportService.getService(service_name).dispatch(method, params)
       File ".../server/openerp/service/web_services.py", line 626, in dispatch
        res = fn(db, uid, *params)
      File ".../server/openerp/osv/osv.py", line 188, in execute_kw
        return self.execute(db, uid, obj, method, *args, **kw or {})
      File ".../server/openerp/osv/osv.py", line 144, in wrapper
        raise except_osv(inst.name, inst.value)
    except_osv: ('ValidateError', u'Une erreur est apparue lors de la validation du/des champ(s) task_id,account_id: Error! Task must belong to the project.')

Related branches

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

A patch is attached as a Merge proposal

description: updated
description: updated
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello Yannick,

I have checked this issue and also tried to reproduce it, But I am not able to reproduce this problem. So, Would you please provide precise steps for reproducing this issue? So, According to that I can able to generate this issue.

Hope you understand.

Thanks & waiting for your answer.

Changed in openobject-addons:
status: New → Incomplete
description: updated
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

I wasn't able to reproduce it on runbot.

However, I think there are still issues regarding what is copied or not.

For example a user having only Purchase/User right, won't be able to duplicate a supplier because events, sale orders and so on are copied.

I can only reproduce an issue about task but (I'm not getting the same message) if I set a user with the following rights:

Purchase / User (to have access to supplier list and pass access error on purchase.order)
Events / User (to pass access error on events)
Warehouse / User (to pass access error on sale.order)

And with admin I create a task at the name of my new user on Axelor Supplier

Now with the new user I go on Axelor to duplicate it (As this user should be able to create he should also be able to duplicate)
But then I will have the following access right error:

Access Denied

Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:
- Project/User
- Portal
- Anonymous

(Document model: project.task.work)

You might think this is an issue of access right only, but I'm more concerned about why would we by default copy things such as task_ids?

There is already enough data in an ERP no need to duplicate a bunch of it without reasons.

I haven't checked about the previous Access Error on purchase.order, events and sale.order as I didn't faced those issues but on runbot

Nevertheless, this seems to me there are some little other things that should make a sibling on copy.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Just few more information there.

The error was raised by a community module: hr-timesheet/timesheet_task

This occurs because at some stage in the duplication of account.analytic.line process the analytic line task's account_id differs from the analytic line account_id

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

I agree, duplicating a partner should not duplicate tasks, nor any o2m field on res.partner, for that matter.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Thanks for the patch and the bug report, it was merged in 7.0 at rev.9226 rev-id: <email address hidden>

Changed in openobject-addons:
milestone: none → 7.0
status: Confirmed → Fix Released
no longer affects: ocb-addons
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.