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