← Back to team overview

openerp-community team mailing list archive

Re: lp:~openerp-community/openobject-addons/lpistone_6.0_lp784499 into lp:openobject-addons/6.0

 

Review: Needs Fixing
Hi Leonardo,

Thanks for the bug report and the merge proposal!

There is one thing that could be improved in your patch: instead of using a direct SQL query and having to manually filter on the company, it would be much better to rely on the use of ORM methods, which do perform the appropriate filtering (due to the record rules defined in ir.rules).
This way you don't hardcode the filtering, and you also avoid bypassing the ORM, which is not recommended.

If the initial code had done the same, there would have been no bug, so let's use this opportunity to improve it :-)

E.g:
  account_ids = self.pool.get('account.account').search(cr, uid,[('parent_id', '=', False)], context=context, limit=1)
  return account_ids[0] if account_ids else False
-- 
https://code.launchpad.net/~openerp-community/openobject-addons/lpistone_6.0_lp784499/+merge/61377
Your team OpenERP Community is subscribed to branch lp:~openerp-community/openobject-addons/lpistone_6.0_lp784499.


Follow ups

References