Odoo have automatic schedule setting (ir.cron). i need to configure schedule from my own module. use one2many in my module can create new schedule actions and when i check in settings->automation->schedule actions. that was exist and success to create.
i have issue, just one data display in my module but all data show in schedule actions menu which sucess created.
Please correct my code ,i stuck now :( this my code :
class sync_batch_schedule(osv.osv):
_name = "ir.cron"
_inherit = "ir.cron"
i use _inherit so can save recods in same table and can CRUD In my own module. because when i only read without make new inherit class. the data readonly, so i create one2many, this :
class sync_batch_update(osv.osv):
_name = 'sync.batch.update'
_columns = {
'name' : fields.char('Name', required=True),
'sync_batch_update_ids' : fields.one2many('eth.sync.update','batch_update_id', 'Batch to Update'),
'sync_batch_update_stat_ids' : fields.one2many('sync.update.stat.batch','sync_update_stat_batch_id','Update Statistic'),
#'batch_id' : fields.function(_get_filtering_schedule,type='one2many',relation='ir.cron',string='Schedule'),
'batch_id' : fields.one2many('ir.cron','id',string='Schedule')
}
_defaults = {
'batch_id': lambda self, cr, uid, context : self._get_filtering_schedule(cr, uid, [0], '', '', context)[0],
}
Can you help me find my wrong code, i just newbie in odoo ;)