return result
+ #================================================================================
+ # def copy(self, cr, uid, id, default, context=None):
+ # container = self.browse(cr, uid, id, context=context)
+ # new_name = "Copy of %s" % container.name
+ # # =like is the original LIKE operator from SQL
+ # others_count = self.search(cr, uid, [('name', '=like', new_name+'%')],
+ # count=True, context=context)
+ # if others_count > 0:
+ # new_name = "%s (%s)" % (new_name, others_count+1)
+ # default['name'] = new_name
+ # return osv.Model.copy(self, cr, uid, id, default, context=context)
+ #================================================================================
+
+
def copy(self, cr, uid, id, default, context=None):
- container = self.browse(cr, uid, id, context=context)
- new_name = "Copy of %s" % container.name
- # =like is the original LIKE operator from SQL
- others_count = self.search(cr, uid, [('name', '=like', new_name+'%')],
- count=True, context=context)
- if others_count > 0:
- new_name = "%s (%s)" % (new_name, others_count+1)
- default['name'] = new_name
- return osv.Model.copy(self, cr, uid, id, default, context=context)
+ cr.execute("SELECT copierContainer (%s);", (id,))
+ return cr.fetchone()[0]
+
def _get_manday(self, cr, uid, ids, field, arg, context=None):
result={}
_name = "todolist.container"
+ _inherit = "mail.thread"
+
_status = [("draft", "Draft"), ("pending", "Pending"), ("done", "Done")]
_columns = {
_name = "todolist.task"
+ _inherit = "mail.thread"
+
_priorities = [("Useful", "Useful"), ("Necessary", "Necessary"), ("Essential", "Essential")]
_states = [("draft", "Draft"), ("proposal", "Proposal"), ("approved", "Approved"), ("started", "Started"), ("done", "Done")]
),
(
"manday_sup_0_constraint",
- "CHECK(manday > 0)",
+ "CHECK(manday >= 0)",
"The manday should be positive",
),
]
_name = "todolist.topic"
+ _inherit = "mail.thread"
+
_states = [("Active", "Active"), ("Inactive", "Inactive")]
_columns = {