Code review comment for lp:~camptocamp/sale-reports/7.0-conditional_discount_print-rde

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

Thanks for the patch

3 + return group_id in [x.id for x in res_users_obj.browse(
54 + cr,
55 + uid,
56 + uid,
57 + context=context).groups_id]

Just a matter of taste but it is quite ugly and probably a copy paste from original report.
Something like:

groups = res_users_obj.browse(cr, uid, uid, context=context).group_id
return any(x for x in groups if x.id == group_id)

Should be more readable

regards

Nicolas

review: Needs Fixing (code review, no test)

« Back to merge proposal