I use odoo mobile framework. How can I enable the sync option on app startup? (The option is disabled by default.)
            Asked
            
        
        
            Active
            
        
            Viewed 506 times
        
    23
            
            
        - 
                    https://stackoverflow.com/a/8838939/2700586 – Mani Jul 20 '17 at 09:12
- 
                    @Mani Thanks for your reply, But I already tried it, Not works for me! – Naitik Jul 21 '17 at 12:49
- 
                    Consider looking at [OdooJsonRpcClient](https://github.com/kasim1011/OdooJsonRpcClient) for Android. – Kasim Rangwala Aug 21 '18 at 08:49
1 Answers
1
            
            
        odoo has a customer_sync_adapter.xml and a CustomersSyncProvider.java; when looking at the referenced ResPartner.java, it says that, String AUTHORITY = BuildConfig.APPLICATION_ID + ".core.provider.content.sync.res_partner";. An Account of type com.odoo.auth is expected, while assigning the proper content authority is important, else it will resolve nothing.
ContentResolver.setSyncAutomatically(account, ResPartner.AUTHORITY, true);
for the other one sync-adapter, the respective contentAuthority & accountType are required.
would only enable it on first run, or just ask the user. when always enabling it, it is difficult to disable it.
 
    
    
        Martin Zeitler
        
- 1
- 19
- 155
- 216

 
    