[IMP] base_setup: adapt fonts to many2one instead of list

bzr revid: mat@openerp.com-20131014094025-05989gbpdghu2rwt
This commit is contained in:
Martin Trigaux 2013-10-14 11:40:25 +02:00
parent 8ad8fa59be
commit 81e03814e8
2 changed files with 3 additions and 5 deletions

View File

@ -26,9 +26,6 @@ from openerp.report.render.rml2pdf import customfonts
class base_config_settings(osv.osv_memory):
_name = 'base.config.settings'
_inherit = 'res.config.settings'
def _get_font(self, cr, uid, context=None):
return sorted(customfonts.RegisterCustomFonts())
_columns = {
'module_multi_company': fields.boolean('Manage multiple companies',
@ -44,11 +41,11 @@ class base_config_settings(osv.osv_memory):
'module_base_import': fields.boolean("Allow users to import data from CSV files"),
'module_google_drive': fields.boolean('Attach Google documents to any record',
help="""This installs the module google_docs."""),
'font': fields.selection(_get_font, "Select Font", help="Set your favorite font into company header"),
'font': fields.many2one('res.font', string="Report Font", help="Set the font into the report header, it will be used for every RML report of the user company"),
}
_defaults= {
'font': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.font or 'Helvetica',
'font': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.font.id,
}
def open_company(self, cr, uid, ids, context=None):

View File

@ -95,6 +95,7 @@
<div>
<div>
<field name="font" class="oe_inline"/>
<button string="(scan fonts)" name="base.act_discover_fonts" type="object" class="oe_link"/>
</div>
</div>
</group>