← Back to team overview

openerp-connector-community team mailing list archive

Re: Openerp-connector and Multi-company

 

Reply to myself...
At least two things are wrong in the way I propose to fill the company_id
field:

   1. We need a way to keep the company_id blank (by default?)
   2. The company_id should be taken on the job.user_id and not on the uid

if 'company_id' in self.session.context:
    company_id = self.session.context['company_id']
else:
    company_id
= self.sesion.pool.get('res.company')._company_default_get(cr, job.user_id,
object='queue.job', field='company_id', context=context)


The 'OpenERPJobStorage.store' function should also be modified to store the
new field.

lmi


>
>    - add a new field company_id on the queue_job model (optional)
>    - modify the method OpenERPJobStorage.enqueue to fill the company_id
>    with the following logic:
>
>   company_id = self.session.context.get('company_id')
>
>   if not company_id:
>
>       company_id
>> = self.sesion.pool.get('res.company')._company_default_get(cr, uid,
>> object='queue.job', field='company_id', context=context)
>
>   job.company_id = company_id
>
>
>
>    - add a record rule on queue.job to restrict the visibility by company
>    - modify the method QueueJob.subscribe_users to add the company_id as
>    parameter to the search method.
>
> What do you think?
>
> Regards,
>
> lmi
>



-- 
*Laurent Mignon*
*Senior Software Engineer*

*Tel : +352 20 21 10 20 32*
*Fax : +352 20 21 10 21*
*Gsm : +352 691 506 009*
*Email: laurent.mignon@xxxxxxxxx <laurent.mignon@xxxxxxxxx>*

*Acsone SA, Succursale de Luxembourg*
*22, Zone industrielle*
*L-8287 Kehlen, Luxembourg*
*www.acsone.eu <http://www.acsone.eu>*

*Participez à notre séminaire OpenERP et découvrez :*

-          Un *processus intégré de gestion de projets
<http://acsone.eu/seminaire-projets>*

-          Un *processus order-to-cash intégré
<http://acsone.eu/seminaire-produit>*

Follow ups

References