diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py
index 23589fd2d6d..75cbfd20c03 100644
--- a/addons/base_contact/base_contact.py
+++ b/addons/base_contact/base_contact.py
@@ -26,6 +26,7 @@ class res_partner_contact(osv.osv):
_name = "res.partner.contact"
_description = "Contact"
+ _log_create = True
def _title_get(self,cr, user, context={}):
"""
@@ -207,6 +208,7 @@ class res_partner_job(osv.osv):
_name = 'res.partner.job'
_description ='Contact Partner Function'
_order = 'sequence_contact'
+ _log_create = True
_columns = {
'name': fields.related('address_id', 'partner_id', type='many2one',\
diff --git a/addons/base_contact/migrations/1.2/pre-10-res_partner_address_change.py b/addons/base_contact/migrations/1.2/pre-10-res_partner_address_change.py
new file mode 100644
index 00000000000..26deac23e7f
--- /dev/null
+++ b/addons/base_contact/migrations/1.2/pre-10-res_partner_address_change.py
@@ -0,0 +1,32 @@
+# -*- coding: utf8 -*-
+
+__name__ = "res.partner.adress: for each address it should create a contact with the name of the address"
+
+def migrate(cr, version):
+ generate_contact(cr)
+
+def generate_contact(cr):
+ cr.execute("""DROP TRIGGER IF EXISTS contactjob on res_partner_contact;
+ DROP LANGUAGE IF EXISTS plpgsql CASCADE;
+ CREATE LANGUAGE plpgsql ;
+ CREATE OR REPLACE FUNCTION add_to_job() RETURNS TRIGGER AS $contactjob$
+ DECLARE
+ new_name varchar;
+ new_phonenum varchar;
+ BEGIN
+ IF(TG_OP='INSERT') THEN
+ INSERT INTO res_partner_job(contact_id, address_id, function, state) VALUES(NEW.id, NEW.website::integer,NEW.first_name, 'current');
+ UPDATE res_partner_contact set first_name=Null, website=Null, active=True where id=NEW.id;
+ END IF;
+ RETURN NEW;
+ END;
+ $contactjob$ LANGUAGE plpgsql;
+ CREATE TRIGGER contactjob AFTER INSERT ON res_partner_contact FOR EACH ROW EXECUTE PROCEDURE add_to_job();""")
+ cr.commit()
+
+ cr.execute("INSERT into res_partner_contact (name, title, email, first_name, website) (SELECT coalesce(name, 'Noname'), title, email, function , to_char(id, '99999999') from res_partner_address)")
+ cr.commit()
+ cr.execute("DROP TRIGGER IF EXISTS contactjob on res_partner_contact")
+ cr.execute("DROP LANGUAGE IF EXISTS plpgsql CASCADE;")
+ cr.execute("DROP FUNCTION IF EXISTS add_to_job()")
+ cr.commit()
\ No newline at end of file
diff --git a/addons/caldav/wizard/calendar_event_export.py b/addons/caldav/wizard/calendar_event_export.py
index 856d9e9bc91..0be54df9f56 100644
--- a/addons/caldav/wizard/calendar_event_export.py
+++ b/addons/caldav/wizard/calendar_event_export.py
@@ -32,16 +32,6 @@ class calendar_event_export(osv.osv_memory):
"""
Export Calendar Event.
"""
- def process_export_ics(self, cr, uid, ids, context):
- """
- Get Default value for file_path field.
- """
- model = context.get('model', 'basic.calendar')
- model_obj = self.pool.get(model)
-
- calendar = model_obj.export_cal(cr, uid, context['active_ids'], context)
- self.write(cr, uid, ids, {'file_path': base64.encodestring(calendar)})
- return False
def default_get(self, cr, uid, fields, context):
"""
@@ -54,6 +44,9 @@ class calendar_event_export(osv.osv_memory):
name = 'OpenERP %s.ics' % (model_obj._description)
if 'name' in fields:
res.update({'name': name})
+ if 'file_path' in fields:
+ calendar = model_obj.export_cal(cr, uid, context['active_ids'], context)
+ res.update({'file_path': base64.encodestring(calendar)})
return res
_name = "calendar.event.export"
diff --git a/addons/caldav/wizard/calendar_event_export_view.xml b/addons/caldav/wizard/calendar_event_export_view.xml
index 227822966d0..cfadf945bf4 100644
--- a/addons/caldav/wizard/calendar_event_export_view.xml
+++ b/addons/caldav/wizard/calendar_event_export_view.xml
@@ -13,8 +13,8 @@
-
-
+
+
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index c1060f3e658..e92378785d6 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -32,10 +32,11 @@ class crm_lead(osv.osv, crm_case):
""" CRM Lead Case """
_name = "crm.lead"
- _description = "Lead"
+ _description = "Lead/Opportunity"
_order = "priority, id desc"
_inherit = ['res.partner.address']
_inherits = {'mailgate.thread': 'thread_id'}
+ _log_create=True
def _compute_day(self, cr, uid, ids, fields, args, context={}):
"""
diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py
index 133cb98f9dc..e3116ba39ca 100644
--- a/addons/crm/crm_meeting.py
+++ b/addons/crm/crm_meeting.py
@@ -45,6 +45,7 @@ class crm_meeting(osv.osv, crm_case):
_order = "id desc"
_inherit = ["calendar.event"]
_inherits = {'mailgate.thread': 'thread_id'}
+ _log_create=True
_columns = {
# From crm.case
diff --git a/addons/crm/crm_opportunity.py b/addons/crm/crm_opportunity.py
index 98e4c6f3ded..ce9b661fa1a 100644
--- a/addons/crm/crm_opportunity.py
+++ b/addons/crm/crm_opportunity.py
@@ -37,7 +37,6 @@ AVAILABLE_STATES = [
class crm_opportunity(osv.osv):
""" Opportunity Cases """
_name = "crm.lead"
- _description = "Opportunity"
_order = "priority,date_action,id desc"
_inherit = 'crm.lead'
_columns = {
diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py
index 657360a4206..4ed59e2a5c3 100644
--- a/addons/crm/crm_phonecall.py
+++ b/addons/crm/crm_phonecall.py
@@ -32,6 +32,7 @@ class crm_phonecall(osv.osv, crm_case):
_description = "Phonecall"
_order = "id desc"
_inherits = {'mailgate.thread': 'thread_id'}
+ _log_create=True
_columns = {
# From crm.case
diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py
index d9a7a2b34c0..d45b9aa6482 100644
--- a/addons/crm_claim/crm_claim.py
+++ b/addons/crm_claim/crm_claim.py
@@ -30,6 +30,7 @@ class crm_claim(osv.osv, crm.crm_case):
_description = "Claim Cases"
_order = "id desc"
_inherits = {'mailgate.thread': 'thread_id'}
+ _log_create=True
_columns = {
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
diff --git a/addons/crm_fundraising/crm_fundraising.py b/addons/crm_fundraising/crm_fundraising.py
index 356c3baec73..4ff7832e64f 100644
--- a/addons/crm_fundraising/crm_fundraising.py
+++ b/addons/crm_fundraising/crm_fundraising.py
@@ -29,6 +29,7 @@ class crm_fundraising(osv.osv, crm.crm_case):
_description = "Fund Raising Cases"
_order = "id desc"
_inherits = {'mailgate.thread': 'thread_id'}
+ _log_create=True
_columns = {
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py
index d07d2261013..0b14994d2b6 100644
--- a/addons/crm_helpdesk/crm_helpdesk.py
+++ b/addons/crm_helpdesk/crm_helpdesk.py
@@ -29,6 +29,7 @@ class crm_helpdesk(osv.osv, crm.crm_case):
_description = "Helpdesk Cases"
_order = "id desc"
_inherits = {'mailgate.thread': 'thread_id'}
+ _log_create=True
_columns = {
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
diff --git a/addons/crm_profiling/crm_profiling.py b/addons/crm_profiling/crm_profiling.py
index 760c9b20bba..77675ff513d 100644
--- a/addons/crm_profiling/crm_profiling.py
+++ b/addons/crm_profiling/crm_profiling.py
@@ -158,6 +158,7 @@ class questionnaire(osv.osv):
_name="crm_profiling.questionnaire"
_description= "Questionnaire"
+ _log_create = True
def build_form(self, cr, uid, data, context):
"""
diff --git a/addons/document/directory_content.py b/addons/document/directory_content.py
index 2d434712f56..dff02e8cb61 100644
--- a/addons/document/directory_content.py
+++ b/addons/document/directory_content.py
@@ -47,6 +47,8 @@ class document_directory_content(osv.osv):
_name = 'document.directory.content'
_description = 'Directory Content'
_order = "sequence"
+ _log_create = True
+
def _extension_get(self, cr, uid, context={}):
cr.execute('select code,name from document_directory_content_type where active')
res = cr.fetchall()
diff --git a/addons/document/document.py b/addons/document/document.py
index 5d3075f7a4a..1a811600eed 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -41,6 +41,8 @@ DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['roo
class document_file(osv.osv):
_inherit = 'ir.attachment'
_rec_name = 'datas_fname'
+ _log_create=True
+
def _get_filestore(self, cr):
return os.path.join(DMS_ROOT_PATH, cr.dbname)
diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py
index e395f96833d..8c50164701b 100644
--- a/addons/document/document_directory.py
+++ b/addons/document/document_directory.py
@@ -33,6 +33,8 @@ class document_directory(osv.osv):
_name = 'document.directory'
_description = 'Directory'
_order = 'name desc'
+ _log_create=True
+
_columns = {
'name': fields.char('Name', size=64, required=True, select=1),
'write_date': fields.datetime('Date Modified', readonly=True),
@@ -112,7 +114,7 @@ class document_directory(osv.osv):
while d2 and d2.parent_id:
s = d2.name + (s and ('/' + s) or '')
d2 = d2.parent_id
- res.append((d.id, s))
+ res.append((d.id, s or d.name))
return res
def get_full_path(self, cr, uid, dir_id, context=None):
diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py
index d20870ff825..ac9925c1635 100644
--- a/addons/document/document_storage.py
+++ b/addons/document/document_storage.py
@@ -96,6 +96,8 @@ class document_storage(osv.osv):
"""
_name = 'document.storage'
_description = 'Storage Media'
+ _log_create=True
+
_columns = {
'name': fields.char('Name', size=64, required=True, select=1),
'write_date': fields.datetime('Date Modified', readonly=True),
diff --git a/addons/fetchmail/__openerp__.py b/addons/fetchmail/__openerp__.py
index a1276c11643..31037cca63f 100644
--- a/addons/fetchmail/__openerp__.py
+++ b/addons/fetchmail/__openerp__.py
@@ -24,7 +24,7 @@
{
"name" : "Fetchmail Server",
"version" : "1.0",
- "depends" : ["base"],
+ "depends" : ["base", 'mail_gateway'],
"author" : "Tiny",
"description": """Fetchmail:
* Fetch email from Pop / IMAP server
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index 6419cc8a18d..a96f1bf9af9 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -181,7 +181,7 @@ class email_server(osv.osv):
context.update({
'server_id':server.id
})
- history_pool = self.pool.get('mail.server.history')
+ history_pool = self.pool.get('mailgate.message')
msg_txt = email.message_from_string(message)
message_id = msg_txt.get('Message-ID', False)
@@ -282,7 +282,6 @@ class email_server(osv.osv):
ref = msg.get('references').split('\r\n')
else:
ref = msg.get('references').split(' ')
-
if ref:
hids = history_pool.search(cr, uid, [('name','=',ref[0].strip())])
if hids:
@@ -306,9 +305,18 @@ class email_server(osv.osv):
if hasattr(model_pool, 'message_new'):
res_id = model_pool.message_new(cr, uid, msg, context)
else:
- logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_new is not define in model %s' % (model_pool._name))
- return False
-
+ data = {
+ 'name': msg.get('subject'),
+ 'email_from': msg.get('from'),
+ 'email_cc': msg.get('cc'),
+ 'user_id': False,
+ 'description': msg.get('body'),
+ 'state' : 'draft',
+ }
+ res_id = model_pool.create(cr, uid, data, context=context)
+ logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_new is not define in model %s. Using default method' % (model_pool._name))
+
+ att_ids = []
if server.attach:
for attactment in attachents or []:
data_attach = {
@@ -319,19 +327,25 @@ class email_server(osv.osv):
'res_model': server.object_id.model,
'res_id': res_id,
}
- self.pool.get('ir.attachment').create(cr, uid, data_attach)
+ att_ids.append(self.pool.get('ir.attachment').create(cr, uid, data_attach))
if server.action_id:
action_pool = self.pool.get('ir.actions.server')
action_pool.run(cr, uid, [server.action_id.id], {'active_id':res_id, 'active_ids':[res_id]})
-
res = {
- 'name': message_id,
+ 'name': msg.get('subject', 'No subject'),
+ 'message_id': message_id,
+ 'date': msg.get('date'),
'res_id': res_id,
+ 'email_from': msg.get('from'),
+ 'email_to': msg.get('to'),
+ 'email_cc': msg.get('cc'),
+ 'model': server.object_id.model,
'server_id': server.id,
- 'note': msg.get('body', msg.get('from')),
+ 'description': msg.get('body', msg.get('from')),
'ref_id':msg.get('references', msg.get('id')),
- 'type':server.type
+ 'type':server.type,
+ 'attachment_ids': [(6, 0, att_ids)]
}
his_id = history_pool.create(cr, uid, res)
@@ -412,17 +426,10 @@ email_server()
class mail_server_history(osv.osv):
- _name = "mail.server.history"
- _description = "Mail Server History"
+ _inherit = "mailgate.message"
_columns = {
- 'name': fields.char('Message Id', size=256, readonly=True, help="Message Id in Email Server.", select=True),
- 'ref_id': fields.char('Referance Id', size=256, readonly=True, help="Message Id in Email Server.", select=True),
- 'res_id': fields.integer("Resource ID", readonly=True, select=True),
'server_id': fields.many2one('email.server',"Mail Server", readonly=True, select=True),
- 'model_id':fields.related('server_id', 'object_id', type='many2one', relation='ir.model', string='Model', readonly=True, select=True),
- 'note': fields.text('Notes', readonly=True),
- 'create_date': fields.datetime('Created Date', readonly=True),
'type':fields.selection([
('pop','POP Server'),
('imap','IMAP Server'),
diff --git a/addons/fetchmail/fetchmail_view.xml b/addons/fetchmail/fetchmail_view.xml
index 510b31b6131..330f9fec349 100644
--- a/addons/fetchmail/fetchmail_view.xml
+++ b/addons/fetchmail/fetchmail_view.xml
@@ -103,82 +103,54 @@
action="action_email_server_tree_imap"
/>
-
- mail.server.history.tree
- mail.server.history
- tree
-
-
-
-
-
-
-
-
-
-
-
- mail.server.history.form
- mail.server.history
- form
-
-
-
-
-
+
+
+
+
+ res_model="mailgate.message" src_model="email.server"/>
-
+
Received Email History
- mail.server.history
+ mailgate.message
form
tree,form
-
+
{'type':'imap'}
[('type','=','imap')]
+ id="menu_action_mailgate_message_tree"
+ action="action_mailgate_message_tree"/>
-
+
Received Email History
- mail.server.history
+ mailgate.message
form
tree,form
-
+
{'type':'pop'}
[('type','=','pop')]
+ id="menu_action_mailgate_message_tree_pop"
+ action="action_mailgate_message_tree_pop"/>
diff --git a/addons/fetchmail/security/ir.model.access.csv b/addons/fetchmail/security/ir.model.access.csv
index 907aa187913..d31fd067485 100644
--- a/addons/fetchmail/security/ir.model.access.csv
+++ b/addons/fetchmail/security/ir.model.access.csv
@@ -1,4 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_email_server","email.server","model_email_server",,1,1,1,1
-"access_mail_server_history","mail.server.history","model_mail_server_history",,1,1,1,1
"access_email_server_tools","email.server.tools","model_email_server_tools",,1,1,1,1
diff --git a/addons/idea/idea.py b/addons/idea/idea.py
index 14fb24ee607..20a2904c4e6 100644
--- a/addons/idea/idea.py
+++ b/addons/idea/idea.py
@@ -33,6 +33,7 @@ class idea_category(osv.osv):
_name = "idea.category"
_description = "Idea Category"
+ _log_create=True
_columns = {
'name': fields.char('Category', size=64, required=True),
@@ -52,6 +53,7 @@ class idea_idea(osv.osv):
""" Idea """
_name = 'idea.idea'
_rec_name = 'title'
+ _log_create=True
def _vote_avg_compute(self, cr, uid, ids, name, arg, context = None):
@@ -302,6 +304,7 @@ class idea_vote(osv.osv):
_name = 'idea.vote'
_description = 'Idea Vote'
_rec_name = 'score'
+ _log_create = True
_columns = {
'user_id': fields.many2one('res.users', 'By user', readonly="True"),
diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py
index 88d080c11bd..1a06c35c65e 100644
--- a/addons/lunch/lunch.py
+++ b/addons/lunch/lunch.py
@@ -115,6 +115,7 @@ class lunch_order(osv.osv):
_name = 'lunch.order'
_description = "Lunch Order"
_rec_name = "user_id"
+ _log_create=True
def _price_get(self, cr, uid, ids, name, args, context=None):
diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py
index 5a4ab95c935..03c40b9cefb 100644
--- a/addons/mail_gateway/mail_gateway.py
+++ b/addons/mail_gateway/mail_gateway.py
@@ -75,7 +75,6 @@ class mailgate_thread(osv.osv):
if all(isinstance(case_id, (int, long)) for case_id in cases) and context.get('model'):
cases = self.pool.get(context['model']).browse(cr, uid, cases, context=context)
- model_obj = self.pool.get('ir.model')
att_obj = self.pool.get('ir.attachment')
obj = self.pool.get('mailgate.message')
@@ -114,6 +113,7 @@ class mailgate_thread(osv.osv):
'attachment_ids': [(6, 0, attachments)]
}
res = obj.create(cr, uid, data, context)
+ case._table.log(cr, uid, case.id, case._description + " '" + case.name + "': " + keyword, context=context)
return True
_history = __history
@@ -129,10 +129,12 @@ class mailgate_message(osv.osv):
_name = 'mailgate.message'
_description = 'Mailgateway Message'
_order = 'date desc'
+ _log_create=True
_columns = {
'name':fields.char('Message', size=64),
'thread_id':fields.many2one('mailgate.thread', 'Thread'),
+ 'ref_id': fields.char('Reference Id', size=256, readonly=True, help="Message Id in Email Server.", select=True),
'date': fields.datetime('Date'),
'history': fields.boolean('Is History?', required=False),
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
diff --git a/addons/mail_gateway/mail_gateway_view.xml b/addons/mail_gateway/mail_gateway_view.xml
index 0395d9ea643..fbec97e6a17 100644
--- a/addons/mail_gateway/mail_gateway_view.xml
+++ b/addons/mail_gateway/mail_gateway_view.xml
@@ -26,7 +26,8 @@
-
+
+
diff --git a/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py b/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py
index 4a18d8cb251..de49ddfaccb 100755
--- a/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py
+++ b/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py
@@ -177,13 +177,19 @@ class email_parser(object):
s = decode_header(s.replace('\r', ''))
return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or []))
- def history(self, model, new_id, msg_id, subject, msg_to, msg_from, body, attach):
+ def history(self, model, new_id, msg_id, ref_id, subject, msg_to, msg_from, body, attach):
+ try:
+ thread_id = self.rpc(model, 'read', new_id, ['thread_id'])['thread_id'][0]
+ except Exception, e:
+ thread_id = None
msg_data = {
'name': subject,
'history': True,
'model': model,
'res_id': new_id,
+ 'thread_id': thread_id,
'message_id': msg_id,
+ 'ref_id': ref_id or '',
'user_id': self.rpc.user_id,
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'email_from': msg_from,
@@ -228,7 +234,7 @@ class email_parser(object):
try:
self.rpc(self.model, 'history', [new_id], 'Receive', True, msg_to, message['body'], msg_from, False, {'model' : self.model})
except Exception, e:
- self.history(self.model, new_id, msg['Message-Id'], msg_subject, msg_to, msg_from, message['body'], att_ids)
+ self.history(self.model, new_id, msg['Message-Id'], msg['References'], msg_subject, msg_to, msg_from, message['body'], att_ids)
except Exception, e:
if getattr(e, 'faultCode', '') and 'AccessError' in e.faultCode:
e = '\n\nThe Specified user does not have an access to the Model.'
@@ -294,22 +300,23 @@ class email_parser(object):
return False
del msg['To']
msg['To'] = emails[0]
+ msg['Subject'] = 'OpenERP Record-id:' + msg['Subject']
if len(emails)>1:
if 'Cc' in msg:
del msg['Cc']
msg['Cc'] = ','.join(emails[1:])
del msg['Reply-To']
msg['Reply-To'] = self.email
- s = smtplib.SMTP(self.smtp_server, self.smtp_port)
- s.ehlo()
- s.starttls()
- s.ehlo()
-
if self.smtp_user and self.smtp_password:
+ s = smtplib.SMTP(self.smtp_server, self.smtp_port)
+ s.ehlo()
+ s.starttls()
+ s.ehlo()
s.login(self.smtp_user, self.smtp_password)
s.sendmail(self.email, emails, msg.as_string())
- s.close()
- return True
+ s.close()
+ return True
+ return False
def parse(self, msg):
@@ -319,7 +326,7 @@ class email_parser(object):
if msg.get('Subject', ''):
del msg['Subject']
msg['Subject'] = '['+str(res_id)+'] '+subject
- msg['Message-Id'] = '<'+str(time.time())+'-openerpcrm-'+str(res_id)+'@'+socket.gethostname()+'>'
+# msg['Message-Id'] = '<'+str(time.time())+'-openerpcrm-'+str(res_id)+'@'+socket.gethostname()+'>'
mm = [self._decode_header(msg['From']), self._decode_header(msg['To'])]+self._decode_header(msg.get('Cc', '')).split(',')
msg_mails = map(self.email_get, filter(None, mm))
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index c86f13b262f..f1260b08f12 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -45,6 +45,7 @@ class survey(osv.osv):
_name = 'survey'
_description = 'Survey'
_rec_name = 'title'
+ _log_create = True
def default_get(self, cr, uid, fields, context={}):
data = super(survey, self).default_get(cr, uid, fields, context)
@@ -588,6 +589,8 @@ survey_answer()
class survey_response(osv.osv):
_name = "survey.response"
_rec_name = 'date_create'
+ _log_create = True
+
_columns = {
'survey_id' : fields.many2one('survey', 'Survey', required=1, ondelete='cascade'),
'date_create' : fields.datetime('Create Date', required=1),