Merge lp:~openerp-dev/openobject-addons/trunk-project-gallery-apa into lp:openobject-addons

Proposed by Ajay Patel (OpenERP)
Status: Merged
Merged at revision: 6780
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-project-gallery-apa
Merge into: lp:openobject-addons
Diff against target: 0 lines
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-project-gallery-apa
Reviewer Review Type Date Requested Status
Antony Lesuisse (OpenERP) Disapprove
Raphael Collet (OpenERP) (community) Approve
Review via email: mp+104092@code.launchpad.net

This proposal supersedes a proposal from 2012-04-25.

Description of the change

Hello,

[ADD]:Added kanban view for project.
more detail in this pad : http://pad.openerp.com/rd-v62-project-task-227-HGIX0GS8

Thanks,
Amit

To post a comment you must log in.
Revision history for this message
Ajay Patel (OpenERP) (ajay-openerp) wrote : Posted in a previous version of this proposal

Hello,

now project gallery is working with latest trunk.
merged chs's branch and remove conflicts.

Thanks,
Amit

Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

Functionally it's fine, but I have some remarks.

0. More than 150 commits without a decent commit message is a shame. You have to find something more informative than "[IMP]"!

1. Choose better field names (the ones you chose aren't helpful):
    task -> use_tasks (indicates whether the project uses tasks)
    open_task -> task_count (counts the number of tasks)
    issues -> use_issues
    total_issues -> issue_count
    phases -> use_phases
    open_phases -> phase_count
    timesheets -> use_timesheets
    total_timesheet -> timesheet_count

2. Make the field 'company_uom_id' a fields.related('company_id', 'project_time_mode_id', type='many2one', relation='product.uom'). The simpler the better. In the kanban view, simply use <field name="company_uom_id"/> to display the unit (in the right language). Also don't bother with plurals (the extra 's'), as it is not portable across translations!

3. The method that counts the number of tasks makes one query per project (search inside a loop). The following version makes a constant number of queries (search + browse), and is therefore more scalable:

    def _task_count(self, cr, uid, ids, field_name, arg, context=None):
        res = dict.fromkeys(ids, 0)
        task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)])
        for task in self.pool.get('project.task').browse(cr, uid, task_ids, context):
            res[task.project_id.id] += 1
        return res

Same remark for counting issues, phases and timesheets.

4. You don't need a method like 'open_tasks' to open a view. Use a relate action like 'project.act_project_project_2_project_task_all' instead (easier to configure and maintain). Please remove the default value for 'project_id' at line 113 of diff. The action sets a correct default value for it.

Same remark for issues, phases and timesheets.

5. In the kanban view, please don't hardcode the date format. Simply use <field name="date"/>, and let the web client format it correctly.

6. Wouldn't it be simpler to reuse existing stuff for editing and changing the colors, like below? Deleting a project from its kanban view is not useful, IMHO. I think that two small icons in a corner wouldn't look bad.

    <a string="Edit" icon="gtk-edit" type="edit"/>
    <a string="Change Color" icon="color-picker" type="color" name="color"/>

Thanks,
Raphael

review: Needs Fixing
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

> point 6: as per new design , this is different things. Can you please approve with apr ?
We discussed it. Don't take into account that point, you have done the right thing!

> points 3 and 4: yes rco i appreciate this changes. and i made it. but there is problem with timesheet in both the points.
You are right, for timesheets your code was fine.

Thanks for the changes,
Raphael

review: Approve
Revision history for this message
Antony Lesuisse (OpenERP) (al-openerp) wrote :

This merge was not reviewed correctly a few points could have been improved before merge:

- useless inclusion of dropdown. It's already present in jquery.ui.bootstrap.
- inclusion of a <script> tag in the kanban template. I think this should be avoided as the code is executed for every kanban rendered and it also clutters the dom. This code should be moved to project/static/src/js/project.js using a delegate.

review: Disapprove

Preview Diff

Empty

Subscribers

People subscribed via source and target branches

to all changes: