[REF] base_external_referentials: refactored some code in external_osv :
[REF] base_external_referentials: refactored some code in external_osv :

New method _existing_oeid_for_extid_import :
Called from ext_import to find the OpenERP resource id (and its ir.model.data id) on which the external resource will be imported.
It searches the OpenERP resource by external id in ir.model.data, when no res_id is found, a new resource will be created. 
This method also replaces the hook _search_existing_id_by_vals (recently introduced and already deprecated) as it can be inherited to search a resource by another means.

New method _extid_to_expected_oeid :
Introduced to remove some not DRY code, called from both extid_to_existing_oeid and _existing_oeid_for_extid_import.
It returns the ir.model.data id and the expected id of the resource for an external id. 
We consider the id as expected because OpenERP cleans up ir.model.data only at server update, so the returned resource id could not exist.



BT-jmichaud/connector,gurneyalex/connector,MindAndGo/connector,dvitme/connector,js-landoo/connector,fevxie/connector,acsone/connector,gurneyalex/connector,acsone/connector,maljac/connector,brain-tec/connector,mohamedhagag/connector,open-synergy/connector,esousy/connector,sylvain-garancher/connector,anybox/connector,dvitme/connector,guewen/connector,BT-ojossen/connector,Antiun/connector,hugosantosred/connector,brain-tec/connector,hugosantosred/connector,BT-fgarbely/connector,guewen/connector,brain-tec/connector,BT-ojossen/connector,js-landoo/connector,Endika/connector,BT-jmichaud/connector,sylvain-garancher/connector,acsone/connector,mohamedhagag/connector,MindAndGo/connector,maljac/connector,BT-fgarbely/connector,zhaohuaw/connector,esousy/connector,Endika/connector,Antiun/connector,zhaohuaw/connector,fevxie/connector,anybox/connector,open-synergy/connector