[IMP]Base: LOGO Done confg wiz

bzr revid: aag@tinyerp.co.in-20110406140443-wpprnhkwrhh7k3oh
This commit is contained in:
aag (OpenERP) 2011-04-06 19:34:43 +05:30
parent 509513f11b
commit d2afc310d2
2 changed files with 2 additions and 9 deletions

View File

@ -239,8 +239,6 @@
<button name="createReport" string="Preview Reports" type="object" icon="gtk-print"/>
<button name="%(action_res_company_logo)d"
string="Upload your logo" type="action" icon="gtk-ok"/>
<separator colspan="4" string="Your Logo - Use a size of about 450x150 pixels."/>
<field colspan="4" name="logo" widget="image"/>
</page>
<page string="Header/Footer" groups="base.group_extended">
<field colspan="4" name="rml_header" nolabel="1"/>

View File

@ -73,19 +73,14 @@ class res_company_logo(osv.osv_memory):
_columns = {
'logo' : fields.binary('Logo'),
}
_defaults={
}
def execute(self, cr, uid, ids, context=None):
if context is None:
context = {}
record_id = context.get('active_id', False) or False
comp_obj = self.pool.get("res.company")
get_val = self.browse(cr, uid, ids)[0]
comp_val = comp_obj.browse(cr, uid, ids)[0]
if comp_val.logo:
comp_obj.write(cr, uid, context['active_id'], {'logo': False})
if get_val.logo:
comp_obj.write(cr, uid, context['active_id'], {'logo': get_val.logo})
comp_obj.write(cr, uid, record_id, {'logo': get_val.logo}, context=context)
return {'type': 'ir.actions.act_window_close'}
res_company_logo()