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,352
  • 5
  • 51
  • 114
Naitik
  • 796
  • 11
  • 32

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
  • 1
  • 19
  • 155
  • 216