Title: Eric CAUDAL
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
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
[email protected]
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: [email protected]

Acsone SA, Succursale de Luxembourg
22, Zone industrielle
L-8287 Kehlen, Luxembourg

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

-          Un processus intégré de gestion de projets

-          Un processus order-to-cash intégré




-- 
Mailing list: https://launchpad.net/~openerp-connector-community
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-connector-community
More help   : https://help.launchpad.net/ListHelp

Reply via email to