summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Prieels <anp@odoo.com>2020-10-13 06:39:28 +0000
committerAntoine Prieels <anp@odoo.com>2020-10-13 06:39:28 +0000
commitd5b456a1f75320c8fdf1e989afad91fc74ec9ef3 (patch)
tree2a2f5caa644509bb96ea9d40fceb81a947e1cd45
parentced500e9bcbb5c84033463689d135ad4c7dc4f39 (diff)
[FIX] pos_adyen: Adyen for Platforms fixes
- The Adyen sync cron didn't call the function to sync terminals - Do not specify the merchantAccount when creating a store, the proxy will add it itself. closes odoo/odoo#59819 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
-rw-r--r--addons/pos_adyen/models/adyen_account.py8
1 files changed, 6 insertions, 2 deletions
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,