Merge lp://qastaging/~jb.eficent/department-mgmt/department-mgmt-bugfixes_analytic into lp://qastaging/~department-core-editors/department-mgmt/7.0

Proposed by JB (eficent.com)
Status: Rejected
Rejected by: Joël Grand-Guillaume @ camptocamp
Proposed branch: lp://qastaging/~jb.eficent/department-mgmt/department-mgmt-bugfixes_analytic
Merge into: lp://qastaging/~department-core-editors/department-mgmt/7.0
Diff against target: 65 lines (+32/-1)
3 files modified
analytic_department/__openerp__.py (+1/-1)
analytic_department/analytic.py (+20/-0)
analytic_department/analytic_view.xml (+11/-0)
To merge this branch: bzr merge lp://qastaging/~jb.eficent/department-mgmt/department-mgmt-bugfixes_analytic
Reviewer Review Type Date Requested Status
Joël Grand-Guillaume @ camptocamp code review + test Disapprove
Daniel Reis Needs Fixing
Pedro Manuel Baeza code review Needs Information
Review via email: mp+212299@code.qastaging.launchpad.net

Description of the change

Fixes bugs 1296119, 1296109

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Jordi,

Thanks for the contribution. Some questions about your MP:

- Why do you need _get_department method? If you put a related field, this method is not needed.
- Is it possible that you link a different department for the same account_id? If it's so, related field is not the best approach.

Regards.

review: Needs Information (code review)
Revision history for this message
Daniel Reis (dreis-pt) wrote :

I agree with Pedro. It would be best to keep department_id as a plain many2one, and instead have a default value for it.

Revision history for this message
Daniel Reis (dreis-pt) :
review: Needs Fixing
Revision history for this message
JB (eficent.com) (jb.eficent) wrote :

I first tried to use a default and call the _get_department (and left it there inconsciously), but found that I was not able to retrieve the analytic account's department from there. Not passed in the context. Any idea how can it be fetched?
I think it's not good idea to fetch it again from the employee.
I I would not like to change the logic of the programs that create the analytic line either.

Thanks for your feedback! Very valuable...

Jordi

Revision history for this message
Daniel Reis (dreis-pt) wrote :

Maybe extending the create() method - if department_id is empty, it could be found and filled after the super() call.

19. By JB (eficent.com)

Defaults department in analytic line during create, based on the department of the analytic account.

Revision history for this message
JB (eficent.com) (jb.eficent) wrote :

Now corrected as per your suggestions. Thanks!

Regards,
Jordi.

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

As suggested in the MP related to task's department (https://code.launchpad.net/~camptocamp/department-mgmt/add-dep-on-project-task-jge/+merge/217068) I think we have 2 important informations in analytic line,.

 * The first one is the user's employee related department
 * The second is the analytic account's related department

Both information are valuable, depending on what you want to know. In my use case, the department_id of the line is fulfill by the employee's department through timesheet lines mostely.

I suggest here a way of dealing with this, basically:

 * department_id is the user's related department, given by a default value calling _get_department
 * A new field called account_department_id is a field.related on the analytic account department_id
 * Adapt all search, group and tree view

Here is my proposal:

https://code.launchpad.net/~camptocamp/department-mgmt/add-account-department-fix-default-anyltic-jge/+merge/218807

So, I mark "needs infos".

Regards,

Joël

review: Needs Information (code review + test)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

As this MP :https://code.launchpad.net/~camptocamp/department-mgmt/add-account-department-fix-default-anyltic-jge/+merge/218807

Has been merged, I mark this one as disapproved. Reply in there if anything wrong with that.

Regards,

Joël

review: Disapprove (code review + test)

Unmerged revisions

19. By JB (eficent.com)

Defaults department in analytic line during create, based on the department of the analytic account.

18. By JB (eficent.com)

Fixes bugs #1296119, #1296109 on analytic_department

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches