2
* OpenERP, Open Source Management Solution
3
* Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
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
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
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/>
19
package com.openerp.addons.note;
21
import java.util.ArrayList;
22
import java.util.List;
24
import android.content.Context;
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;
31
public class NoteDB extends OEDatabase {
32
Context mContext = null;
34
public NoteDB(Context context) {
40
public String getModelName() {
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))));
63
public class NoteStages extends OEDatabase {
65
public NoteStages(Context context) {
70
public String getModelName() {
75
public List<OEColumn> getModelColumns() {
76
List<OEColumn> cols = new ArrayList<OEColumn>();
77
cols.add(new OEColumn("name", "Name", OEFields.text()));
83
public class NoteTags extends OEDatabase {
85
public NoteTags(Context context) {
90
public String getModelName() {
95
public List<OEColumn> getModelColumns() {
96
List<OEColumn> cols = new ArrayList<OEColumn>();
97
cols.add(new OEColumn("name", "Name", OEFields.text()));