chart_config.py 439 B

123456789101112131415161718
  1. # -*- encoding: utf-8 -*-
  2. from openerp import models, fields, api
  3. class ChartList(models.Model):
  4. _name = 'chart.list'
  5. name = fields.Char('Chart Name', required=True)
  6. description = fields.Char('Description')
  7. class ResUsers(models.Model):
  8. _inherit = 'res.users'
  9. chart_ids = fields.Many2many('chart.list', 'chart_list_users_rel', 'user_id', 'chart_id', 'Charts')
  10. @api.model
  11. def get_user(self):
  12. return self.env.user.id