← Back to team overview

openerp-connector-community team mailing list archive

Re: Openerp-connector and Multi-company

 

Is it really necessary? I mean, jobs are technical, that's a jobs queue. It is not meant to be accessible to everyone but rather technical users. If the queue was implemented using RabbitMQ or Redis would you also bother with that?

I'm not strongly against than, but I'm not convinced neither. What is impact on the performance when using record rules on the jobs? This is the decisive point IMO.

That's different for the models that expose Magento or the backend like stores, ...



On 03/20/2014 03:14 PM, Eric Caudal wrote:
About the functional need there is indeed necessity.
I think it should be extended to the all connectors objects (backend,
stores, shops, checkpoints etc.)

Eric CAUDAL

Eric Caudal
/CEO/
--
*Elico Corporation, Shanghai branch
/OpenERP Premium Certified Training Partner/  *
Cell: + 86 186 2136 1670
Office: + 86 21 6211 8017/27/37
Skype: elico.corp
eric.caudal@xxxxxxxxxxxxxx  <mailto:eric.caudal@xxxxxxxxxxxxxx>
http://www.elico-corp.com

Elico Corp
On 03/20/2014 09:37 PM, Mignon, Laurent wrote:
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 <mailto: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>*_








--
Guewen Baconnier
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 39
Office: +41 21 619 10 10
http://www.camptocamp.com/


References