[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#59868 X-original-commit: d5b456a1f75320c8fdf1e989afad91fc74ec9ef3 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user