mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] connector_walmart: authentication API changes
This commit is contained in:
@@ -20,21 +20,8 @@ class WalmartBackend(models.Model):
|
||||
_inherit = 'connector.backend'
|
||||
|
||||
name = fields.Char(string='Name')
|
||||
consumer_id = fields.Char(
|
||||
string='Consumer ID',
|
||||
required=True,
|
||||
help='Walmart Consumer ID',
|
||||
)
|
||||
channel_type = fields.Char(
|
||||
string='Channel Type',
|
||||
required=True,
|
||||
help='Walmart Channel Type',
|
||||
)
|
||||
private_key = fields.Char(
|
||||
string='Private Key',
|
||||
required=True,
|
||||
help='Walmart Private Key'
|
||||
)
|
||||
client_id = fields.Char(string='Client ID')
|
||||
client_secret = fields.Char(string='Client Secret')
|
||||
warehouse_id = fields.Many2one(
|
||||
comodel_name='stock.warehouse',
|
||||
string='Warehouse',
|
||||
@@ -89,7 +76,7 @@ class WalmartBackend(models.Model):
|
||||
@api.multi
|
||||
def work_on(self, model_name, **kwargs):
|
||||
self.ensure_one()
|
||||
walmart_api = Walmart(self.consumer_id, self.channel_type, self.private_key)
|
||||
walmart_api = Walmart(self.client_id, self.client_secret)
|
||||
_super = super(WalmartBackend, self)
|
||||
with _super.work_on(model_name, walmart_api=walmart_api, **kwargs) as work:
|
||||
yield work
|
||||
@@ -98,9 +85,8 @@ class WalmartBackend(models.Model):
|
||||
def _scheduler_import_sale_orders(self):
|
||||
# potential hook for customization (e.g. pad from date or provide its own)
|
||||
backends = self.search([
|
||||
('consumer_id', '!=', False),
|
||||
('channel_type', '!=', False),
|
||||
('private_key', '!=', False),
|
||||
('client_id', '!=', False),
|
||||
('client_secret', '!=', False),
|
||||
('import_orders_from_date', '!=', False),
|
||||
])
|
||||
return backends.import_sale_orders()
|
||||
|
||||
Reference in New Issue
Block a user