28 | *
29 | * @author Inderjeet Singh
30 | * @author Joel Leitch
31 | */
32 | public final class $Gson$Preconditions {
33 | public static T checkNotNull(T obj) {
34 | if (obj == null) {
35 | throw new NullPointerException();
36 | }
37 | return obj;
38 | }
39 |
40 | public static void checkArgument(boolean condition) {
41 | if (!condition) {
42 | throw new IllegalArgumentException();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/google/gson/internal/JsonReaderInternalAccess.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 Google Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.google.gson.internal;
18 |
19 | import com.google.gson.stream.JsonReader;
20 | import java.io.IOException;
21 |
22 | /**
23 | * Internal-only APIs of JsonReader available only to other classes in Gson.
24 | */
25 | public abstract class JsonReaderInternalAccess {
26 | public static JsonReaderInternalAccess INSTANCE;
27 |
28 | /**
29 | * Changes the type of the current property name token to a string value.
30 | */
31 | public abstract void promoteNameToValue(JsonReader reader) throws IOException;
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/google/gson/internal/ObjectConstructor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 Google Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.google.gson.internal;
18 |
19 | /**
20 | * Defines a generic object construction factory. The purpose of this class
21 | * is to construct a default instance of a class that can be used for object
22 | * navigation while deserialization from its JSON representation.
23 | *
24 | * @author Inderjeet Singh
25 | * @author Joel Leitch
26 | */
27 | public interface ObjectConstructor {
28 |
29 | /**
30 | * Returns a new instance.
31 | */
32 | public T construct();
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/google/gson/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Do NOT use any class in this package as they are meant for internal use in Gson.
3 | * These classes will very likely change incompatibly in future versions. You have been warned.
4 | *
5 | * @author Inderjeet Singh, Joel Leitch, Jesse Wilson
6 | */
7 | package com.google.gson.internal;
--------------------------------------------------------------------------------
/app/src/main/java/com/google/gson/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This package provides the {@link com.google.gson.Gson} class to convert Json to Java and
3 | * vice-versa.
4 | *
5 | *
The primary class to use is {@link com.google.gson.Gson} which can be constructed with
6 | * {@code new Gson()} (using default settings) or by using {@link com.google.gson.GsonBuilder}
7 | * (to configure various options such as using versioning and so on).
8 | *
9 | * @author Inderjeet Singh, Joel Leitch
10 | */
11 | package com.google.gson;
--------------------------------------------------------------------------------
/app/src/main/java/com/google/gson/reflect/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This package provides utility classes for finding type information for generic types.
3 | *
4 | * @author Inderjeet Singh, Joel Leitch
5 | */
6 | package com.google.gson.reflect;
--------------------------------------------------------------------------------
/app/src/main/java/com/google/gson/stream/MalformedJsonException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 Google Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.google.gson.stream;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * Thrown when a reader encounters malformed JSON. Some syntax errors can be
23 | * ignored by calling {@link JsonReader#setLenient(boolean)}.
24 | */
25 | public final class MalformedJsonException extends IOException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public MalformedJsonException(String msg) {
29 | super(msg);
30 | }
31 |
32 | public MalformedJsonException(String msg, Throwable throwable) {
33 | super(msg);
34 | // Using initCause() instead of calling super() because Java 1.5 didn't retrofit IOException
35 | // with a constructor with Throwable. This was done in Java 1.6
36 | initCause(throwable);
37 | }
38 |
39 | public MalformedJsonException(Throwable throwable) {
40 | // Using initCause() instead of calling super() because Java 1.5 didn't retrofit IOException
41 | // with a constructor with Throwable. This was done in Java 1.6
42 | initCause(throwable);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/addons/customers/providers/CustomersSyncProvider.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 2/1/15 2:25 PM
19 | */
20 | package com.odoo.addons.customers.providers;
21 |
22 | import com.odoo.base.addons.res.ResPartner;
23 | import com.odoo.core.orm.provider.BaseModelProvider;
24 |
25 | public class CustomersSyncProvider extends BaseModelProvider {
26 | public static final String TAG = CustomersSyncProvider.class.getSimpleName();
27 |
28 | @Override
29 | public String authority() {
30 | return ResPartner.AUTHORITY;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/addons/customers/services/CustomerSyncService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 2/1/15 11:07 AM
19 | */
20 | package com.odoo.addons.customers.services;
21 |
22 | import android.content.Context;
23 | import android.os.Bundle;
24 |
25 | import com.odoo.base.addons.res.ResPartner;
26 | import com.odoo.core.service.OSyncAdapter;
27 | import com.odoo.core.service.OSyncService;
28 | import com.odoo.core.support.OUser;
29 |
30 | public class CustomerSyncService extends OSyncService {
31 | public static final String TAG = CustomerSyncService.class.getSimpleName();
32 |
33 | @Override
34 | public OSyncAdapter getSyncAdapter(OSyncService service, Context context) {
35 | return new OSyncAdapter(context, ResPartner.class, service, true);
36 | }
37 |
38 | @Override
39 | public void performDataSync(OSyncAdapter adapter, Bundle extras, OUser user) {
40 | adapter.syncDataLimit(80);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/base/addons/mail/MailMessageSubType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 27/3/15 12:33 PM
19 | */
20 | package com.odoo.base.addons.mail;
21 |
22 | import android.content.Context;
23 |
24 | import com.odoo.core.orm.OModel;
25 | import com.odoo.core.orm.fields.OColumn;
26 | import com.odoo.core.orm.fields.types.OVarchar;
27 | import com.odoo.core.support.OUser;
28 |
29 | public class MailMessageSubType extends OModel {
30 | public static final String TAG = MailMessageSubType.class.getSimpleName();
31 |
32 | OColumn name = new OColumn("Name", OVarchar.class);
33 |
34 | public MailMessageSubType(Context context, OUser user) {
35 | super(context, "mail.message.subtype", user);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/base/addons/res/ResCountry.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 6:43 PM
19 | */
20 | package com.odoo.base.addons.res;
21 |
22 | import android.content.Context;
23 |
24 | import com.odoo.core.orm.OModel;
25 | import com.odoo.core.orm.fields.OColumn;
26 | import com.odoo.core.orm.fields.types.OVarchar;
27 | import com.odoo.core.support.OUser;
28 |
29 | public class ResCountry extends OModel {
30 |
31 | OColumn name = new OColumn("Name", OVarchar.class).setSize(100);
32 |
33 | public ResCountry(Context context, OUser user) {
34 | super(context, "res.country", user);
35 | }
36 |
37 | @Override
38 | public boolean allowCreateRecordOnServer() {
39 | return false;
40 | }
41 |
42 | @Override
43 | public boolean allowUpdateRecordOnServer() {
44 | return false;
45 | }
46 |
47 | @Override
48 | public boolean allowDeleteRecordInLocal() {
49 | return false;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/base/addons/res/ResCountryState.java:
--------------------------------------------------------------------------------
1 | package com.odoo.base.addons.res;
2 |
3 | import android.content.Context;
4 |
5 | import com.odoo.core.orm.OModel;
6 | import com.odoo.core.orm.fields.OColumn;
7 | import com.odoo.core.orm.fields.types.OVarchar;
8 | import com.odoo.core.support.OUser;
9 |
10 | public class ResCountryState extends OModel {
11 |
12 | OColumn name = new OColumn("Name", OVarchar.class);
13 | OColumn code = new OColumn("Code", OVarchar.class);
14 | OColumn country_id = new OColumn("Country", ResCountry.class, OColumn.RelationType.ManyToOne);
15 |
16 | public ResCountryState(Context context, OUser user) {
17 | super(context, "res.country.state", user);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/base/addons/res/ResPartnerCategory.java:
--------------------------------------------------------------------------------
1 | package com.odoo.base.addons.res;
2 |
3 | import android.content.Context;
4 |
5 | import com.odoo.core.orm.OModel;
6 | import com.odoo.core.orm.fields.OColumn;
7 | import com.odoo.core.orm.fields.types.OVarchar;
8 | import com.odoo.core.support.OUser;
9 |
10 | public class ResPartnerCategory extends OModel {
11 |
12 | OColumn name = new OColumn("Name", OVarchar.class);
13 |
14 | public ResPartnerCategory(Context context, OUser user) {
15 | super(context, "res.partner.category", user);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/base/addons/res/ResUsers.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 13/1/15 10:16 AM
19 | */
20 | package com.odoo.base.addons.res;
21 |
22 | import android.content.Context;
23 |
24 | import com.odoo.core.orm.OModel;
25 | import com.odoo.core.orm.fields.OColumn;
26 | import com.odoo.core.orm.fields.types.OVarchar;
27 | import com.odoo.core.support.OUser;
28 |
29 | public class ResUsers extends OModel {
30 | public static final String TAG = ResUsers.class.getSimpleName();
31 |
32 | OColumn name = new OColumn("Name", OVarchar.class);
33 | OColumn login = new OColumn("User Login name", OVarchar.class);
34 |
35 | @Override
36 | public boolean allowCreateRecordOnServer() {
37 | return false;
38 | }
39 |
40 | @Override
41 | public boolean allowUpdateRecordOnServer() {
42 | return false;
43 | }
44 |
45 | @Override
46 | public boolean allowDeleteRecordInLocal() {
47 | return false;
48 | }
49 |
50 | public ResUsers(Context context, OUser user) {
51 | super(context, "res.users", user);
52 | }
53 |
54 | public static int myId(Context context) {
55 | ResUsers users = new ResUsers(context, null);
56 | return users.selectRowId(users.getUser().getUserId());
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/config/Addons.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 30/12/14 3:11 PM
19 | */
20 | package com.odoo.config;
21 |
22 | import com.odoo.addons.customers.Customers;
23 | import com.odoo.core.support.addons.AddonsHelper;
24 | import com.odoo.core.support.addons.OAddon;
25 |
26 | public class Addons extends AddonsHelper {
27 |
28 | /**
29 | * Declare your required module here
30 | * NOTE: For maintain sequence use object name in asc order.
31 | * Ex.:
32 | * OAddon partners = new OAddon(Partners.class).setDefault();
33 | * for maintain sequence call withSequence(int sequence)
34 | * OAddon partners = new OAddon(Partners.class).withSequence(2);
35 | */
36 | OAddon customers = new OAddon(Customers.class).setDefault();
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/config/BaseConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 5/1/15 5:55 PM
19 | */
20 | package com.odoo.config;
21 |
22 | public class BaseConfig {
23 | /**
24 | * Do not remove following constants.
25 | */
26 |
27 | public static final boolean DEVELOPER_MODE = true;
28 | }
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/config/FirstLaunchConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 28/4/15 4:32 PM
19 | */
20 | package com.odoo.config;
21 |
22 | import android.content.Context;
23 |
24 | import com.odoo.core.support.OUser;
25 |
26 | public class FirstLaunchConfig {
27 |
28 | public static void onFirstLaunch(Context context, OUser user) {
29 |
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/config/PreRequiredPermissions.java:
--------------------------------------------------------------------------------
1 | package com.odoo.config;
2 |
3 | import android.Manifest;
4 |
5 | import com.odoo.core.tools.permissions.DevicePermissionHelper;
6 |
7 | /**
8 | * Odoo, Open Source Management Solution
9 | * Copyright (C) 2012-today Odoo SA ()
10 | *
11 | * This program is free software: you can redistribute it and/or modify
12 | * it under the terms of the GNU Affero General Public License as
13 | * published by the Free Software Foundation, either version 3 of the
14 | * License, or (at your option) any later version
15 | *
16 | * This program is distributed in the hope that it will be useful,
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 | * GNU Affero General Public License for more details
20 | *
21 | * You should have received a copy of the GNU Affero General Public License
22 | * along with this program. If not, see
23 | *
24 | * Created on 30/11/15
25 | */
26 | public class PreRequiredPermissions implements DevicePermissionHelper.DevicePermissionImpl {
27 | public static final String TAG = PreRequiredPermissions.class.getSimpleName();
28 |
29 |
30 | /**
31 | * Provide permission list used by device, This method invoked only in API23+ devices.
32 | * Used by runtime permission model of Odoo Mobile to identify default required permissions
33 | * before start using application.
34 | *
35 | * If, user not grant any of this permission; application will not start.
36 | * @return String[] array of required permissions.
37 | */
38 | @Override
39 | public String[] permissions() {
40 | return new String[]{
41 | Manifest.permission.WRITE_EXTERNAL_STORAGE
42 | };
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/account/AppIntro.java:
--------------------------------------------------------------------------------
1 | package com.odoo.core.account;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 |
6 | import com.odoo.R;
7 | import com.odoo.config.IntroSliderItems;
8 | import com.odoo.widgets.slider.SliderView;
9 |
10 | public class AppIntro extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_app_intro);
16 | SliderView sliderView = (SliderView) findViewById(R.id.sliderView);
17 | IntroSliderItems sliderItems = new IntroSliderItems();
18 | if (!sliderItems.getItems().isEmpty()) {
19 | sliderView.setItems(getSupportFragmentManager(), sliderItems.getItems());
20 | } else {
21 | finish();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/account/BaseSettings.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 9/1/15 11:35 AM
19 | */
20 | package com.odoo.core.account;
21 |
22 | import android.content.Context;
23 | import android.net.Uri;
24 | import android.os.Bundle;
25 | import android.preference.PreferenceFragment;
26 |
27 | import com.odoo.R;
28 | import com.odoo.core.utils.OPreferenceManager;
29 | import com.odoo.core.utils.OResource;
30 |
31 | public class BaseSettings extends PreferenceFragment {
32 | public static final String TAG = BaseSettings.class.getSimpleName();
33 | // Keys
34 | public static final String KEY_NOTIFICATION_RING_TONE = "notification_ringtone";
35 |
36 | @Override
37 | public void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 | addPreferencesFromResource(R.xml.base_preference);
40 | }
41 |
42 | public static Uri getNotificationRingTone(Context context) {
43 | OPreferenceManager mPref = new OPreferenceManager(context);
44 | String defaultUri = OResource.string(context, R.string.notification_default_ring_tone);
45 | return Uri.parse(mPref.getString(KEY_NOTIFICATION_RING_TONE, defaultUri));
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/auth/OdooAuthService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 17/12/14 6:20 PM
19 | */
20 | package com.odoo.core.auth;
21 |
22 | import android.accounts.AccountManager;
23 | import android.app.Service;
24 | import android.content.Intent;
25 | import android.os.IBinder;
26 |
27 | public class OdooAuthService extends Service {
28 | private OdooAuthenticator mAuthenticator;
29 |
30 | @Override
31 | public IBinder onBind(Intent intent) {
32 | IBinder binder = null;
33 | if (intent.getAction().equals(AccountManager.ACTION_AUTHENTICATOR_INTENT)) {
34 | mAuthenticator = new OdooAuthenticator(this);
35 | binder = mAuthenticator.getIBinder();
36 | }
37 | return binder;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/OM2MRecord.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 6:51 PM
19 | */
20 | package com.odoo.core.orm;
21 |
22 | import com.odoo.core.orm.fields.OColumn;
23 |
24 | import java.util.ArrayList;
25 | import java.util.List;
26 |
27 | public class OM2MRecord {
28 | public static final String TAG = OM2MRecord.class.getSimpleName();
29 | private OColumn mCol = null;
30 | private int mId = 0;
31 | private OModel mDatabase = null;
32 |
33 | public OM2MRecord(OModel model, OColumn col, int id) {
34 | mDatabase = model;
35 | mCol = col;
36 | mId = id;
37 | }
38 |
39 | public List getRelIds() {
40 | List ids = new ArrayList<>();
41 | for (ODataRow row : mDatabase.selectManyToManyRecords(new String[]{OColumn.ROW_ID},
42 | mCol.getName(), mId)) {
43 | ids.add(row.getInt(OColumn.ROW_ID));
44 | }
45 | return ids;
46 | }
47 |
48 | public List browseEach() {
49 | return mDatabase.selectManyToManyRecords(null, mCol.getName(), mId);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/RelCommands.java:
--------------------------------------------------------------------------------
1 | package com.odoo.core.orm;
2 |
3 | /**
4 | * Created by dpr on 5/4/16.
5 | */
6 | public enum RelCommands {
7 | Replace, Append, Delete, Unlink
8 | }
9 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OBlob.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:29 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public class OBlob extends OTypeHelper {
23 | public static final String TAG = OBlob.class.getSimpleName();
24 |
25 | @Override
26 | public String getFieldType() {
27 | return "BLOB";
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OBoolean.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:29 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public class OBoolean extends OTypeHelper {
23 | public static final String TAG = OBoolean.class.getSimpleName();
24 |
25 | @Override
26 | public String getFieldType() {
27 | return "VARCHAR";
28 | }
29 |
30 | @Override
31 | public Integer getFieldSize() {
32 | return 10;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/ODate.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:29 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | import com.odoo.core.utils.ODateUtils;
23 |
24 | public class ODate extends OTypeHelper {
25 | public static final String TAG = ODate.class.getSimpleName();
26 |
27 | @Override
28 | public String getFieldType() {
29 | return "VARCHAR";
30 | }
31 |
32 | @Override
33 | public String getDataFormat() {
34 | return ODateUtils.DEFAULT_DATE_FORMAT;
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/ODateTime.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:29 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | import com.odoo.core.utils.ODateUtils;
23 |
24 | public class ODateTime extends OTypeHelper {
25 | public static final String TAG = ODateTime.class.getSimpleName();
26 |
27 | @Override
28 | public String getFieldType() {
29 | return "VARCHAR";
30 | }
31 |
32 | @Override
33 | public String getDataFormat() {
34 | return ODateUtils.DEFAULT_FORMAT;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OFloat.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:29 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public class OFloat extends OTypeHelper {
23 | public static final String TAG = OFloat.class.getSimpleName();
24 |
25 | @Override
26 | public String getFieldType() {
27 | return "REAL";
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OHtml.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:29 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public class OHtml extends OTypeHelper {
23 | public static final String TAG = OHtml.class.getSimpleName();
24 |
25 | @Override
26 | public String getFieldType() {
27 | return "TEXT";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OInteger.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:29 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public class OInteger extends OTypeHelper {
23 | public static final String TAG = OInteger.class.getSimpleName();
24 |
25 | @Override
26 | public String getFieldType() {
27 | return "INTEGER";
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OSelection.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:30 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public class OSelection extends OTypeHelper {
23 | public static final String TAG = OSelection.class.getSimpleName();
24 |
25 | @Override
26 | public String getFieldType() {
27 | return "VARCHAR";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OText.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:29 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public class OText extends OTypeHelper {
23 | public static final String TAG = OText.class.getSimpleName();
24 |
25 | @Override
26 | public String getFieldType() {
27 | return "TEXT";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OTimestamp.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:30 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public class OTimestamp extends ODateTime {
23 | public static final String TAG = OTimestamp.class.getSimpleName();
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OTypeHelper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:30 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public abstract class OTypeHelper {
23 | public Integer field_size = 0;
24 |
25 | public final boolean equals(String type) {
26 | return getFieldType().equals(type);
27 | }
28 |
29 | public final String getType() {
30 | String type = getFieldType();
31 | if (field_size > 0) {
32 | type += "(" + field_size + ")";
33 | }
34 | return type;
35 | }
36 |
37 | public void setSize(Integer size) {
38 | if (size != null)
39 | field_size = size;
40 | }
41 |
42 | public abstract String getFieldType();
43 |
44 | public Integer getFieldSize() {
45 | return field_size;
46 | }
47 |
48 | public String getDataFormat() {
49 | return null;
50 | }
51 |
52 | @Override
53 | public String toString() {
54 | return "OTypeHelper{" +
55 | "field_type='" + getFieldType() + '\'' +
56 | ", field_size=" + field_size +
57 | '}';
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/orm/fields/types/OVarchar.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 31/12/14 11:30 AM
19 | */
20 | package com.odoo.core.orm.fields.types;
21 |
22 | public class OVarchar extends OTypeHelper {
23 | public static final String TAG = OVarchar.class.getSimpleName();
24 |
25 | @Override
26 | public String getFieldType() {
27 | return "VARCHAR";
28 | }
29 |
30 | @Override
31 | public Integer getFieldSize() {
32 | return 64;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/rpc/handler/OdooVersionException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 21/4/15 4:06 PM
19 | */
20 | package com.odoo.core.rpc.handler;
21 |
22 | public class OdooVersionException extends Exception {
23 | public static final String TAG = OdooVersionException.class.getSimpleName();
24 |
25 | public OdooVersionException(String message) {
26 | super(message);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/odoo/core/rpc/helper/OArguments.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Odoo, Open Source Management Solution
3 | * Copyright (C) 2012-today Odoo SA ()
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see
17 | *
18 | * Created on 21/4/15 4:05 PM
19 | */
20 | package com.odoo.core.rpc.helper;
21 |
22 | import org.json.JSONArray;
23 | import org.json.JSONException;
24 | import org.json.JSONObject;
25 |
26 | import java.util.List;
27 |
28 | public class OArguments extends ODomainArgsHelper {
29 | public static final String TAG = OArguments.class.getSimpleName();
30 |
31 | public OArguments add(List