- class awb_sss_table(osv.osv):
- _name = 'awb.sss.table'
- _description = 'SSS Contribution Table'
- _columns = {
- 'min_range': fields.float('Minimum Range', help = "minimum range of salary", readonly=True),
- 'max_range': fields.float('Maximum Range', help = "maximum range of salary", readonly=True),
- 'total_contribution': fields.float('Total Contribution', help = "total contribution of employee depending on salary", readonly=True)
- }
- def create_sss(self, cr, uid, vals, context=None):
- vals = []
- sss_model = self.pool.get('awb.sss.table')
- sss_model.create(cr, uid, {'min_range': 1000.0, 'max_range': 1249.99, 'total_contribution': 120.0}, context=context)
- awb_sss_table()
there's no error but the data is not saved in my custom model. please help thanks
"sss_model = self.pool.get('awb.sss.table')" is also unnecessary, since you're already in the awb.sss.table object. Rather than doing sss_model.create(), you can just do self.create(). Why are you adding a static set of defaults? You might as well just set _defaults={'min_range':1000,'max_range':1249.99,'total_contribution':120} and ignore the create_sss() function entirely.