Code review comment for lp:~savoirfairelinux-openerp/openerp-connector-magento/7.0_feature_choose_import_company

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi,

thanks for your proposal!

This is a good start but incomplete. When a record is imported for a company, it should be imported with a user that belongs to this company, so the property fields (accounts, ...) are set correctly according to the user's company.

Here is an example: https://gist.github.com/guewen/3528fe4be6bf527ed9d9
1. each company has a "connector user" that will be used for the imports for this company
2. before the import (the part that maps and store the data), we search the company for the record to import
3. we switch the current user to the user configured on the company (1.) to run the import, so the properties are defined correctly

« Back to merge proposal