[MERGE]: Merge with lp:~openerp-dev/openobject-server/trunk-rework-server-23-mar-aag
bzr revid: rpa@tinyerp.com-20110413133504-if14vpusbuj0wfh5
This commit is contained in:
commit
57c5ad81e7
|
@ -181,39 +181,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
======================
|
||||
Logo wiz
|
||||
======================
|
||||
-->
|
||||
|
||||
<record id="view_res_company_logo" model="ir.ui.view">
|
||||
<field name="name">res.company.logo.form</field>
|
||||
<field name="model">res.company.logo</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Upload Logo">
|
||||
<separator string="Upload your company logo in JPG or PNG with a format similar to 450*150 pixels" colspan="4"/>
|
||||
<field colspan="4" height="150" name="logo" widget="image" nolabel="1"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-ok" string="Upload" name="execute" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_res_company_logo" model="ir.actions.act_window">
|
||||
<field name="name">Set Logo</field>
|
||||
<field name="res_model">res.company.logo</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_res_company_logo"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
======================
|
||||
Company
|
||||
|
@ -232,16 +199,10 @@
|
|||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="General Information">
|
||||
<group colspan="4">
|
||||
<field name="rml_header1" colspan="4"/>
|
||||
<field name="rml_footer1" colspan="4"/>
|
||||
<field name="rml_footer2" colspan="4"/>
|
||||
<field name="currency_id" colspan="2"/>
|
||||
</group>
|
||||
<separator string="" colspan="4"/>
|
||||
<button name="createReport" string="Preview Reports" type="object" icon="gtk-print"/>
|
||||
<button name="%(action_res_company_logo)d"
|
||||
string="Upload/Change Logo" type="action" icon="gtk-open"/>
|
||||
</page>
|
||||
<page string="Header/Footer" groups="base.group_extended">
|
||||
<field colspan="4" name="rml_header" nolabel="1"/>
|
||||
|
@ -342,27 +303,6 @@
|
|||
<field name="view_id" ref="view_users_configuration_form"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- Config Wiz Give access to others users-->
|
||||
|
||||
<record id="action_config_access_other_user" model="ir.actions.act_window">
|
||||
<field name="name">Give access to others users</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.users</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_users_form"/>
|
||||
</record>
|
||||
|
||||
<!-- register configuration wizard -->
|
||||
|
||||
<record id="config_wizard_action_config_user_form" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_config_access_other_user"/>
|
||||
<field name="type">normal</field>
|
||||
<field name="target">current</field>
|
||||
<field name="sequence">1000</field>
|
||||
<field name="state">skip</field>
|
||||
</record>
|
||||
|
||||
<record id="view_confirm_simple_view_form" model="ir.ui.view">
|
||||
<field name="name">Configure Your Interface</field>
|
||||
|
@ -418,57 +358,5 @@
|
|||
<field name="state">skip</field>
|
||||
</record>
|
||||
|
||||
<!-- Define default users preferences-->
|
||||
|
||||
<record id="view_user_preferences_config_form" model="ir.ui.view">
|
||||
<field name="name">Define default users preferences</field>
|
||||
<field name="model">user.preferences.config</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<form position="attributes">
|
||||
<attribute name="string">Define default users preferences</attribute>
|
||||
</form>
|
||||
<xpath expr='//separator[@string="title"]' position='attributes'>
|
||||
<attribute name='string'>Define default users preferences</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//label[@string='description']"
|
||||
position="attributes">
|
||||
<attribute name="string">Specify default values. These data are just default values, each user is free to change his own preferences.</attribute>
|
||||
</xpath>
|
||||
<xpath expr='//separator[@string="vsep"]' position='attributes'>
|
||||
<attribute name='string'></attribute>
|
||||
<attribute name='rowspan'>12</attribute>
|
||||
</xpath>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<group colspan="4">
|
||||
<field colspan="4" name="context_tz" />
|
||||
<field colspan="4" name="context_lang" />
|
||||
<field colspan="4" name="view" />
|
||||
<field colspan="4" name="menu_tips" />
|
||||
</group>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_user_preferences_config_form" model="ir.actions.act_window">
|
||||
<field name="name">Define default users preferences</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">user.preferences.config</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_user_preferences_config_form"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- Register configuration wizard -->
|
||||
|
||||
<record id="config_action_user_preferences_config_form" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_user_preferences_config_form"/>
|
||||
<field name="type">special</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -68,26 +68,6 @@ class multi_company_default(osv.osv):
|
|||
|
||||
multi_company_default()
|
||||
|
||||
class res_company_logo(osv.osv_memory):
|
||||
_name = 'res.company.logo'
|
||||
_columns = {
|
||||
'logo' : fields.binary('Logo'),
|
||||
}
|
||||
_defaults={
|
||||
'logo':lambda self,cr,uid,c: self.pool.get('res.company').browse(cr, uid, uid,c).logo,
|
||||
}
|
||||
|
||||
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_obj.write(cr, uid, record_id, {'logo': get_val.logo}, context=context)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
res_company_logo()
|
||||
|
||||
class res_company(osv.osv):
|
||||
_name = "res.company"
|
||||
_description = 'Companies'
|
||||
|
|
|
@ -604,39 +604,4 @@ class res_config_view(osv.osv_memory):
|
|||
|
||||
res_config_view()
|
||||
|
||||
# Define default users preferences config wiz
|
||||
|
||||
class user_preferences_config(osv.osv_memory):
|
||||
_name = 'user.preferences.config'
|
||||
_inherit = 'res.config'
|
||||
_columns = {
|
||||
'context_tz': fields.selection(_tz_get, 'Timezone', size=64,
|
||||
help="Set default for new user's timezone, used to perform timezone conversions "
|
||||
"between the server and the client."),
|
||||
'context_lang': fields.selection(_lang_get, 'Language', required=True,
|
||||
help="Sets default language for the new user's user interface, when UI "
|
||||
"translations are available"),
|
||||
'view': fields.selection([('simple','Simplified'),
|
||||
('extended','Extended')],
|
||||
'Interface', required=True ),
|
||||
'menu_tips': fields.boolean('Menu Tips', help="Check out this box if you want to always display tips on each menu action"),
|
||||
|
||||
}
|
||||
_defaults={
|
||||
'view' : lambda self,cr,uid,*args: self.pool.get('res.users').browse(cr, uid, uid).view or 'simple',
|
||||
'context_lang' : 'en_US',
|
||||
'menu_tips' : True
|
||||
}
|
||||
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
for o in self.browse(cr, uid, ids, context=context):
|
||||
ir_values_obj = self.pool.get('ir.values')
|
||||
ir_values_obj.set(cr, uid, 'default', False, 'context_tz', ['res.users'], o.context_tz)
|
||||
ir_values_obj.set(cr, uid, 'default', False, 'context_lang', ['res.users'], o.context_lang)
|
||||
ir_values_obj.set(cr, uid, 'default', False, 'view', ['res.users'], o.view)
|
||||
ir_values_obj.set(cr, uid, 'default', False, 'menu_tips', ['res.users'], o.menu_tips)
|
||||
return {}
|
||||
|
||||
user_preferences_config()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
Loading…
Reference in New Issue