Skip to content

Commit

Permalink
Merge 1688458 into 610e71c
Browse files Browse the repository at this point in the history
  • Loading branch information
guewen committed Jul 17, 2015
2 parents 610e71c + 1688458 commit 8d2066c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions magentoerpconnect/doc/guides/tutorial_development.rst
Expand Up @@ -258,8 +258,7 @@ and add a method (and add in the view as well, I won't write the view's xml here

@api.multi
def import_customer_groups(self):
session = connector.ConnectorSession(self.env.cr, self.env.uid,
context=self.env.context)
session = ConnectorSession.from_env(self.env)
for backend_id in self.ids:
job.import_batch.delay(session, 'magento.res.partner.category',
backend_id)
Expand All @@ -268,7 +267,7 @@ and add a method (and add in the view as well, I won't write the view's xml here

Observations:

* Declare a :py:class:`connector.connector.ConnectorSession`.
* Encapsulate Odoo environment in a :py:class:`openerp.addons.connector.session.ConnectorSession`.
* Delay the job ``import_batch`` when we click on the button.
* if the arguments were given to ``import_batch`` directly (without the
``.delay()``, the import would be done synchronously.
Expand Down

0 comments on commit 8d2066c

Please sign in to comment.