[IMP] REWORK-SERVERSIDE :Improvement Config wiz , ON SERVER SIDE
bzr revid: aag@tinyerp.co.in-20110301072241-a8s1iialq6xeot23
This commit is contained in:
parent
957f2418d4
commit
43690eb21f
|
@ -1908,7 +1908,7 @@
|
||||||
<field name="type">search</field>
|
<field name="type">search</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Search Actions">
|
<search string="Search Actions">
|
||||||
<filter string="To Do" name="todo" icon="terp-camera_test" domain=" ['|',('state','=','open'),'&',('state','=','skip'),('restart','=','onskip')]" help="Todo State Or (Skip State And Onskip Restart)"/>
|
<filter string="To Do" name="todo" icon="terp-camera_test" domain=" ['|',('state','=','open'),'&',('state','=','skip'),('restart','=','on_trigger')]" help="Todo State Or (Skip State And ontrigger Restart)"/>
|
||||||
<separator orientation="vertical"/>
|
<separator orientation="vertical"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<field name="restart"/>
|
<field name="restart"/>
|
||||||
|
|
|
@ -794,14 +794,14 @@ class ir_actions_todo(osv.osv):
|
||||||
'sequence': fields.integer('Sequence'),
|
'sequence': fields.integer('Sequence'),
|
||||||
'state': fields.selection(TODO_STATES, string='State', required=True),
|
'state': fields.selection(TODO_STATES, string='State', required=True),
|
||||||
'name':fields.char('Name', size=64),
|
'name':fields.char('Name', size=64),
|
||||||
'restart': fields.selection([('onskip','On Skip'),('always','Always'),('never','Never')],'Restart',required=True),
|
'restart': fields.selection([('on_trigger','On Trigger'),('always','Always'),('never','Never')],'Restart',required=True),
|
||||||
'groups_id':fields.many2many('res.groups', 'res_groups_action_rel', 'uid', 'gid', 'Groups'),
|
'groups_id':fields.many2many('res.groups', 'res_groups_action_rel', 'uid', 'gid', 'Groups'),
|
||||||
'note':fields.text('Text', translate=True),
|
'note':fields.text('Text', translate=True),
|
||||||
}
|
}
|
||||||
_defaults={
|
_defaults={
|
||||||
'state': 'open',
|
'state': 'open',
|
||||||
'sequence': 10,
|
'sequence': 10,
|
||||||
'restart': 'onskip',
|
'restart': 'on_trigger',
|
||||||
}
|
}
|
||||||
_order="sequence,name,id"
|
_order="sequence,name,id"
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<field name="code">action = obj.start()</field>
|
<field name="code">action = obj.start()</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem name="Reconfigure"
|
<menuitem name="Add More Features"
|
||||||
action="action_start_configurator"
|
action="action_start_configurator"
|
||||||
id="menu_view_base_module_configuration" parent="base.menu_config"
|
id="menu_view_base_module_configuration" parent="base.menu_config"
|
||||||
type="server" icon="STOCK_EXECUTE" sequence="100" />
|
type="server" icon="STOCK_EXECUTE" sequence="100" />
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
<data>
|
<data>
|
||||||
<menuitem icon="terp-partner" id="menu_base_partner" name="Sales" sequence="0"
|
<menuitem icon="terp-partner" id="menu_base_partner" name="Sales" sequence="0"
|
||||||
web_icon="data/sales.png"
|
web_icon="data/sales.png"
|
||||||
web_icon_hover="data/sales-hover.png"/>
|
web_icon_hover="data/sales-hover.png"
|
||||||
|
groups="base.group_sale_salesman,base.group_sale_salesman"/>
|
||||||
|
|
||||||
|
|
||||||
<menuitem id="menu_address_book" name="Address Book" parent="menu_base_partner" sequence="2"/>
|
<menuitem id="menu_address_book" name="Address Book" parent="menu_base_partner" sequence="2"/>
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ class res_config_configurable(osv.osv_memory):
|
||||||
def start(self, cr, uid, ids, context=None):
|
def start(self, cr, uid, ids, context=None):
|
||||||
ids2 = self.pool.get('ir.actions.todo').search(cr, uid, [], context=context)
|
ids2 = self.pool.get('ir.actions.todo').search(cr, uid, [], context=context)
|
||||||
for todo in self.pool.get('ir.actions.todo').browse(cr, uid, ids2, context=context):
|
for todo in self.pool.get('ir.actions.todo').browse(cr, uid, ids2, context=context):
|
||||||
if (todo.restart=='always') or (todo.restart=='onskip' and (todo.state in ('skip','cancel'))):
|
if (todo.restart=='always') or (todo.restart=='on_trigger' and (todo.state in ('skip','cancel'))):
|
||||||
todo.write({'state':'open'})
|
todo.write({'state':'open'})
|
||||||
return self.next(cr, uid, ids, context)
|
return self.next(cr, uid, ids, context)
|
||||||
|
|
||||||
|
@ -355,35 +355,6 @@ class res_config_installer(osv.osv_memory):
|
||||||
return (base | hooks_results | additionals) - set(
|
return (base | hooks_results | additionals) - set(
|
||||||
map(attrgetter('name'), self._already_installed(cr, uid, context)))
|
map(attrgetter('name'), self._already_installed(cr, uid, context)))
|
||||||
|
|
||||||
def default_get(self, cr, uid, fields_list, context=None):
|
|
||||||
''' If an addon is already installed, check it by default
|
|
||||||
'''
|
|
||||||
defaults = super(res_config_installer, self).default_get(
|
|
||||||
cr, uid, fields_list, context=context)
|
|
||||||
|
|
||||||
return dict(defaults,
|
|
||||||
**dict.fromkeys(
|
|
||||||
map(attrgetter('name'),
|
|
||||||
self._already_installed(cr, uid, context=context)),
|
|
||||||
True))
|
|
||||||
|
|
||||||
def fields_get(self, cr, uid, fields=None, context=None, write_access=True):
|
|
||||||
""" If an addon is already installed, set it to readonly as
|
|
||||||
res.config.installer doesn't handle uninstallations of already
|
|
||||||
installed addons
|
|
||||||
"""
|
|
||||||
fields = super(res_config_installer, self).fields_get(
|
|
||||||
cr, uid, fields, context, write_access)
|
|
||||||
|
|
||||||
for module in self._already_installed(cr, uid, context=context):
|
|
||||||
if module.name not in fields:
|
|
||||||
continue
|
|
||||||
fields[module.name].update(
|
|
||||||
readonly=True,
|
|
||||||
help= ustr(fields[module.name].get('help', '')) +
|
|
||||||
_('\n\nThis addon is already installed on your system'))
|
|
||||||
return fields
|
|
||||||
|
|
||||||
def execute(self, cr, uid, ids, context=None):
|
def execute(self, cr, uid, ids, context=None):
|
||||||
modules = self.pool.get('ir.module.module')
|
modules = self.pool.get('ir.module.module')
|
||||||
to_install = list(self.modules_to_install(
|
to_install = list(self.modules_to_install(
|
||||||
|
|
Loading…
Reference in New Issue