diff --git a/addons/pos_adyen/models/adyen_account.py b/addons/pos_adyen/models/adyen_account.py index 2db95110ccb..533725a6933 100644 --- a/addons/pos_adyen/models/adyen_account.py +++ b/addons/pos_adyen/models/adyen_account.py @@ -14,6 +14,11 @@ class AdyenAccount(models.Model): store_ids = fields.One2many('adyen.store', 'adyen_account_id') terminal_ids = fields.One2many('adyen.terminal', 'adyen_account_id') + @api.model + def _sync_adyen_cron(self): + self.env['adyen.terminal']._sync_adyen_terminals() + super(AdyenAccount, self)._sync_adyen_cron() + def action_order_terminal(self): if not self.store_ids: raise ValidationError(_('Please create a store first.')) @@ -42,7 +47,7 @@ class AdyenStore(models.Model): @api.model def create(self, values): adyen_store_id = super(AdyenStore, self).create(values) - response = adyen_store_id.adyen_account_id._adyen_rpc('update_account_holder', adyen_store_id._format_data()) + response = adyen_store_id.adyen_account_id._adyen_rpc('create_store', adyen_store_id._format_data()) stores = response['accountHolderDetails']['storeDetails'] created_store = next(store for store in stores if store['storeReference'] == adyen_store_id.store_reference) adyen_store_id.with_context(update_from_adyen=True).sudo().write({ @@ -65,7 +70,6 @@ class AdyenStore(models.Model): 'storeDetails': [{ 'storeReference': self.store_reference, 'storeName': self.name, - 'merchantAccount': 'OdooMP_POS', 'merchantCategoryCode': '7999', 'address': { 'city': self.city,