~openerp-chinese-team/openerp-china/openerp-china

« back to all changes in this revision

Viewing changes to oecn_base_fonts/oecn_base_fonts_config.py

  • Committer: Tony Gu
  • Date: 2012-02-01 07:45:22 UTC
  • Revision ID: tony@openerp.cn-20120201074522-dxh0k07t5vs6dglp
get font alias from onchange event

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
    _columns = {
91
91
        'map_id':fields.many2one('oecn_base_fonts.config','Font Map', required=True),
92
92
        'pdf_font':fields.selection(_pdf_fonts_get, 'Original Fonts', required=True),
93
 
        'name':fields.char('New Font name', size=20, required=True),
94
 
        'new_font':fields.selection(_system_fonts_get, 'Replaced With', required=True),
 
93
        'name':fields.char('Font Alias', size=20, required=True, help='use this font alias \
 
94
                in custom rml report template'),
 
95
        'new_font':fields.selection(__system_fonts_get, 'Replaced With', required=True),
95
96
    }
96
 
    _defaults = {
97
 
        'name':'SimHei',
98
 
   }
 
97
 
 
98
    def onchange_new_font(self, cr, uid, ids, new_font):
 
99
        """get the default 'Font Alias'"""
 
100
 
 
101
        for font_path, font_name in self.system_fonts:
 
102
            if new_font == font_path:
 
103
                return {'value': {'name': font_name}}
99
104
    
100
105
oecn_base_fonts_map()
101
106