[IMP] base_setup: adapt fonts to many2one instead of list
bzr revid: mat@openerp.com-20131014094025-05989gbpdghu2rwt
This commit is contained in:
parent
8ad8fa59be
commit
81e03814e8
|
@ -26,9 +26,6 @@ from openerp.report.render.rml2pdf import customfonts
|
||||||
class base_config_settings(osv.osv_memory):
|
class base_config_settings(osv.osv_memory):
|
||||||
_name = 'base.config.settings'
|
_name = 'base.config.settings'
|
||||||
_inherit = 'res.config.settings'
|
_inherit = 'res.config.settings'
|
||||||
|
|
||||||
def _get_font(self, cr, uid, context=None):
|
|
||||||
return sorted(customfonts.RegisterCustomFonts())
|
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'module_multi_company': fields.boolean('Manage multiple companies',
|
'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_base_import': fields.boolean("Allow users to import data from CSV files"),
|
||||||
'module_google_drive': fields.boolean('Attach Google documents to any record',
|
'module_google_drive': fields.boolean('Attach Google documents to any record',
|
||||||
help="""This installs the module google_docs."""),
|
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= {
|
_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):
|
def open_company(self, cr, uid, ids, context=None):
|
||||||
|
|
|
@ -95,6 +95,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<field name="font" class="oe_inline"/>
|
<field name="font" class="oe_inline"/>
|
||||||
|
<button string="(scan fonts)" name="base.act_discover_fonts" type="object" class="oe_link"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</group>
|
</group>
|
||||||
|
|
Loading…
Reference in New Issue