execute_kw($db, $uid, $password, 'res.partner.category', 'search', array(array(array('active', '=', true))) ); $tags = $models->execute_kw($db, $uid, $password, 'res.partner.category', 'read', array($ids) ); foreach ($tags as $key => $tag) { $tag['display_name'] = trim($tag['display_name']); $sql = 'SELECT * FROM '._DB_PREFIX_.'group_lang WHERE id_lang = 1 AND name = "'.$tag['display_name'].'"'; $exist = (bool)Db::getInstance()->getRow($sql); $a = date("Y-m-d H:i:s"); if (!$exist && !empty($tag['display_name'])) { $id = Db::getInstance()->autoExecute(_DB_PREFIX_.'group', array( 'reduction' => 0, 'price_display_method' => 1, 'show_prices' => 1, 'date_add' => $a, 'date_upd' => $a ), 'INSERT'); $id = Db::getInstance()->Insert_ID(); $done = Db::getInstance()->autoExecute(_DB_PREFIX_.'group_lang', array( 'id_group' => (int)$id, 'id_lang' => 1, 'name' => pSQL($tag['display_name']) ), 'INSERT'); } } ?>