~arthru/prestashoperpconnect/import-refunds

« back to all changes in this revision

Viewing changes to prestashoperpconnect/unit/mapper.py

  • Committer: Arthur Vuillard
  • Date: 2013-10-25 10:41:30 UTC
  • Revision ID: arthur.vuillard@akretion.com-20131025104130-q0ovyd7zgk3h77b7
Use the company id when searching for a payment method

Show diffs side-by-side

added added

removed removed

Lines of Context:
363
363
 
364
364
    @mapping
365
365
    def payment(self, record):
366
 
        method_ids = self.session.search('payment.method',
367
 
                                         [['name', '=', record['payment']]])
 
366
        method_ids = self.session.search(
 
367
            'payment.method',
 
368
            [
 
369
                ('name', '=', record['payment']),
 
370
                ('company_id', '=', self.backend_record.company_id.id),
 
371
            ]
 
372
        )
368
373
        assert method_ids, ("Payment method '%s' has not been found ; "
369
374
                            "you should create it manually (in Sales->"
370
375
                            "Configuration->Sales->Payment Methods" %