← Back to team overview

openerp-community team mailing list archive

lp:~openerp-community/openobject-server/trunk-property-fields-using-get into lp:openobject-server

 

The proposal to merge lp:~openerp-community/openobject-server/trunk-property-fields-using-get into lp:openobject-server has been updated.

Description changed to:

Enclosed, an improvement that targets to use the get() function of ir.property object when reading a property field (using a browse). Thanks to that, it will now be possible to force the company to use for property fields when processing flows.

While developing that feature, we had to clean and refactor the code of fnct_read and _get_defaults functions that were doing pretty nasty things to compute name_get on all the needed ids.

We also have added a function in tools (maybe that's not the perfect place?) that will factorize the code later on, on addons side. Check the example of use bellow for further information:
- .. for line in self.browse(cr, uid, ids, context=context):
+ .. set_company = tools.get_and_sort_by_field(cr, uid, obj=self, ids=ids, field='company_id', context=context)
+ .. for company_id, sol_ids in set_company.items():
+        ....ctx = context.copy()
+        ....ctx.update({'force_company': company_id})
+        ....for line in self.browse(cr, uid, sol_ids, context=ctx):

Thanks,

For more details, see:
https://code.launchpad.net/~openerp-community/openobject-server/trunk-property-fields-using-get/+merge/67223
-- 
https://code.launchpad.net/~openerp-community/openobject-server/trunk-property-fields-using-get/+merge/67223
Your team OpenERP Community is subscribed to branch lp:~openerp-community/openobject-server/trunk-property-fields-using-get.


References