chart_config.py 558 B

123456789101112131415161718192021222324
  1. # -*- encoding: utf-8 -*-
  2. from openerp import models, fields, api
  3. from datetime import datetime
  4. from pytz import timezone
  5. DATE_FORMAT = '%Y-%m-01 00:00:00'
  6. # import web_pdb; web_pdb.set_trace()
  7. class ChartList(models.Model):
  8. _name = 'chart.list'
  9. name = fields.Char('Chart Name', required=True)
  10. description = fields.Text('Description')
  11. class ResUsers(models.Model):
  12. _inherit = 'res.users'
  13. chart_ids = fields.Many2many('chart.list', 'chart_list_users_rel', 'id', 'cid', 'Charts')
  14. @api.model
  15. def get_user(self):
  16. return self.env.user.id