Skip to content
Snippets Groups Projects
Commit d5b456a1 authored by Antoine Prieels's avatar Antoine Prieels
Browse files

[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: default avatarpimodoo <pimodoo@users.noreply.github.com>
parent ced500e9
Branches
Tags
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment