~openerp-dev/openerp-mobile/openerp-mobile-10

« back to all changes in this revision

Viewing changes to src/com/openerp/addons/note/NoteDB.java

  • Committer: Dharmang Soni (OpenERP)
  • Date: 2014-04-03 07:28:06 UTC
  • Revision ID: dpr@tinyerp.com-20140403072806-qphqroz65ch61pqt
[REMOVE] removed social client module from base framework

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * OpenERP, Open Source Management Solution
3
 
 * Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
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 <http://www.gnu.org/licenses/>
17
 
 * 
18
 
 */
19
 
package com.openerp.addons.note;
20
 
 
21
 
import java.util.ArrayList;
22
 
import java.util.List;
23
 
 
24
 
import android.content.Context;
25
 
 
26
 
import com.openerp.base.res.ResPartnerDB;
27
 
import com.openerp.orm.OEColumn;
28
 
import com.openerp.orm.OEDatabase;
29
 
import com.openerp.orm.OEFields;
30
 
 
31
 
public class NoteDB extends OEDatabase {
32
 
        Context mContext = null;
33
 
 
34
 
        public NoteDB(Context context) {
35
 
                super(context);
36
 
                mContext = context;
37
 
        }
38
 
 
39
 
        @Override
40
 
        public String getModelName() {
41
 
                return "note.note";
42
 
        }
43
 
 
44
 
        @Override
45
 
        public List<OEColumn> getModelColumns() {
46
 
                List<OEColumn> cols = new ArrayList<OEColumn>();
47
 
                cols.add(new OEColumn("name", "Name", OEFields.varchar(64)));
48
 
                cols.add(new OEColumn("memo", "Memo", OEFields.varchar(64)));
49
 
                cols.add(new OEColumn("open", "Open", OEFields.varchar(64)));
50
 
                cols.add(new OEColumn("date_done", "Date_Done", OEFields.varchar(64)));
51
 
                cols.add(new OEColumn("stage_id", "NoteStages", OEFields
52
 
                                .manyToOne(new NoteStages(mContext))));
53
 
                cols.add(new OEColumn("tag_ids", "NoteTags", OEFields
54
 
                                .manyToMany(new NoteTags(mContext))));
55
 
                cols.add(new OEColumn("current_partner_id", "Res_Partner", OEFields
56
 
                                .manyToOne(new ResPartnerDB(mContext))));
57
 
                cols.add(new OEColumn("note_pad_url", "URL", OEFields.text()));
58
 
                cols.add(new OEColumn("message_follower_ids", "Followers", OEFields
59
 
                                .manyToMany(new ResPartnerDB(mContext))));
60
 
                return cols;
61
 
        }
62
 
 
63
 
        public class NoteStages extends OEDatabase {
64
 
 
65
 
                public NoteStages(Context context) {
66
 
                        super(context);
67
 
                }
68
 
 
69
 
                @Override
70
 
                public String getModelName() {
71
 
                        return "note.stage";
72
 
                }
73
 
 
74
 
                @Override
75
 
                public List<OEColumn> getModelColumns() {
76
 
                        List<OEColumn> cols = new ArrayList<OEColumn>();
77
 
                        cols.add(new OEColumn("name", "Name", OEFields.text()));
78
 
                        return cols;
79
 
                }
80
 
 
81
 
        }
82
 
 
83
 
        public class NoteTags extends OEDatabase {
84
 
 
85
 
                public NoteTags(Context context) {
86
 
                        super(context);
87
 
                }
88
 
 
89
 
                @Override
90
 
                public String getModelName() {
91
 
                        return "note.tag";
92
 
                }
93
 
 
94
 
                @Override
95
 
                public List<OEColumn> getModelColumns() {
96
 
                        List<OEColumn> cols = new ArrayList<OEColumn>();
97
 
                        cols.add(new OEColumn("name", "Name", OEFields.text()));
98
 
                        return cols;
99
 
                }
100
 
        }
101
 
 
102
 
}