23

I use odoo mobile framework. How can I enable the sync option on app startup? (The option is disabled by default.)

enter image description here

ChesuCR
  • 9,020
  • 4
  • 45
  • 104
Naitik
  • 990
  • 11
  • 31

1 Answers1

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
  • 59,798
  • 15
  • 122
  • 186