disable synchro button in adm order
This commit is contained in:
parent
fac0185cd9
commit
f6d0d7a1c2
@ -170,6 +170,7 @@
|
||||
{l s='Partial refund'}
|
||||
</a>
|
||||
{/if}
|
||||
{if $erp_enabled}
|
||||
{if !$order->isSynchIntoErp()}
|
||||
<a class="btn btn-default" href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$order->id|intval}&syncherp=1">
|
||||
<i class="icon-upload"></i>
|
||||
@ -181,6 +182,11 @@
|
||||
{l s='Synchronisée'}
|
||||
</span>
|
||||
{/if}
|
||||
{else}
|
||||
<span class="span label label-inactive">
|
||||
{l s='Synchronisation désactivée'}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<!-- Tab nav -->
|
||||
<ul class="nav nav-tabs" id="tabOrder">
|
||||
|
@ -1522,6 +1522,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
} elseif (Tools::getValue('syncherp') == 1) {
|
||||
|
||||
if (!defined('ERP_ENABLED') || !ERP_ENABLED) {
|
||||
$this->errors[] = Tools::displayError('La synchro avec Odoo est actuellement désactivée.');
|
||||
}
|
||||
else {
|
||||
|
||||
$id_order = Tools::getValue('id_order', false);
|
||||
if ($id_order) {
|
||||
$order = new Order((int)$id_order);
|
||||
@ -1557,6 +1562,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parent::postProcess();
|
||||
}
|
||||
@ -1759,6 +1765,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
// Smarty assign
|
||||
$this->tpl_view_vars = array(
|
||||
'erp_enabled' => (defined('ERP_ENABLED') && ERP_ENABLED)?true:false,
|
||||
'order' => $order,
|
||||
'cart' => new Cart($order->id_cart),
|
||||
'customer' => $customer,
|
||||
|
Loading…
Reference in New Issue
Block a user