[UPD] Use update_plan_name instead of rename_plan

This commit is contained in:
Pablo
2018-12-07 20:30:10 +01:00
committed by QS5ELkMu
parent e498a114db
commit 6d93e850cb
3 changed files with 5 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ class ChannelProductPricelist(models.Model):
if self.external_id:
with self.backend_id.work_on(self._name) as work:
exporter = work.component(usage='product.pricelist.exporter')
exporter.rename_plan(self)
exporter.update_plan_name(self)
@job(default_channel='root.channel')
@api.multi

View File

@@ -18,5 +18,5 @@ class ProductPricelistAdapter(Component):
def delete_plan(self, external_id):
return super(ProductPricelistAdapter, self).delete_plan(external_id)
def rename_plan(self, external_id, new_name):
return super(ProductPricelistAdapter, self).rename_plan(external_id, new_name)
def update_plan_name(self, external_id, new_name):
return super(ProductPricelistAdapter, self).update_plan_name(external_id, new_name)

View File

@@ -10,12 +10,12 @@ class ProductPricelistExporter(Component):
_inherit = 'channel.product.pricelist.exporter'
@api.model
def rename_plan(self, binding):
def update_plan_name(self, binding):
try:
binding.with_context({
'connector_no_export': True,
}).write({'sync_date': fields.Datetime.now()})
return self.backend_adapter.rename_plan(
return self.backend_adapter.update_plan_name(
binding.external_id,
binding.name)
except ChannelConnectorError as err: