[MERGE] merged branch with new field category on ir.actions.todo + removal of unused config wizard 'create new users'
bzr revid: qdp-launchpad@openerp.com-20110525085605-9l8ddlaa2wr28o53
This commit is contained in:
@@ -247,78 +247,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_users_configuration_form" model="ir.ui.view">
|
||||
<field name="name">res.config.users.confirm.form</field>
|
||||
<field name="model">res.config.users</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">Create User</attribute>
|
||||
</form>
|
||||
<xpath expr='//separator[@string="title"]' position='attributes'>
|
||||
<attribute name='string'>New User</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//label[@string='description']"
|
||||
position="attributes">
|
||||
<attribute name="string">Create additional users and assign them groups that will allow them to have access to selected functionalities within the system. Click on 'Done' if you do not wish to add more users at this stage, you can always do this later.</attribute>
|
||||
</xpath>
|
||||
<xpath expr='//separator[@string="vsep"]' position='attributes'>
|
||||
<attribute name='string'></attribute>
|
||||
</xpath>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<field name="name"/>
|
||||
<field name="email"/>
|
||||
<field name="login"/>
|
||||
<field name="password" password="True"/>
|
||||
<field name="context_lang"/>
|
||||
<field name="context_tz"/>
|
||||
|
||||
<separator string="Group" colspan="4"/>
|
||||
<label align="0.0" colspan="4" string="Groups are used to define access rights on objects and the visibility of screens and menus"/>
|
||||
<field colspan="4" nolabel="1" name="groups_id"/>
|
||||
</group>
|
||||
|
||||
<xpath expr='//button[@name="action_next"]'
|
||||
position='attributes'>
|
||||
<attribute name="name">action_add</attribute>
|
||||
<attribute name='string'>Add User</attribute>
|
||||
<attribute name='icon'>gtk-add</attribute>
|
||||
</xpath>
|
||||
|
||||
<xpath expr='//button[@name="action_skip"]'
|
||||
position='attributes'>
|
||||
<!-- if this one is performed first, it transforms
|
||||
the action_skip into action_next, and the
|
||||
transformation of action_next to action_add,
|
||||
since it uses first-match, transforms the same
|
||||
button. And we end up with [add] [next] instead
|
||||
of [next] [add]
|
||||
|
||||
Would probably be simpler to just replace both
|
||||
by nothing and create a pair of brand new
|
||||
buttons... but we'd have to handle the groups
|
||||
around the buttons... oh well...
|
||||
-->
|
||||
<attribute name="name">action_next</attribute>
|
||||
<attribute name='string'>Done</attribute>
|
||||
<attribute name='icon'>gtk-go-forward</attribute>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_config_user_form" model="ir.actions.act_window">
|
||||
<field name="name">Create Users</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.config.users</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_users_configuration_form"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record id="view_confirm_simple_view_form" model="ir.ui.view">
|
||||
<field name="name">Configure Your Interface</field>
|
||||
<field name="model">res.config.view</field>
|
||||
@@ -360,12 +288,6 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record id="config_wizard_step_user" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_config_user_form"/>
|
||||
<field name="sequence">10</field>
|
||||
<field name="type">normal</field>
|
||||
<field name="state">done</field>
|
||||
</record>
|
||||
<record id="config_wizard_simple_view" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_config_simple_view_form"/>
|
||||
<field name="type">special</field>
|
||||
|
||||
@@ -1899,6 +1899,7 @@
|
||||
<field name="action_id"/>
|
||||
<field name="type"/>
|
||||
<field name="sequence"/>
|
||||
<field name="category_id"/>
|
||||
</group>
|
||||
<separator string="Groups" colspan="4"/>
|
||||
<field name="groups_id" nolabel="1" colspan="4"/>
|
||||
@@ -1953,6 +1954,30 @@
|
||||
<field name="function">power_on</field>
|
||||
<field name="args">()</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_todo_category_form" model="ir.ui.view">
|
||||
<field name="name">ir.actions.todo.category.form</field>
|
||||
<field name="model">ir.actions.todo.category</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Wizard Category">
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_todo_category_tree" model="ir.ui.view">
|
||||
<field name="name">ir.actions.todo.category.tree</field>
|
||||
<field name="model">ir.actions.todo.category</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Wizard Category">
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -800,6 +800,14 @@ class act_window_close(osv.osv):
|
||||
}
|
||||
act_window_close()
|
||||
|
||||
class ir_actions_todo_category(osv.osv):
|
||||
_name = 'ir.actions.todo.category'
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=64, required=True),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
}
|
||||
ir_actions_todo_category()
|
||||
|
||||
# This model use to register action services.
|
||||
TODO_STATES = [('open', 'To Do'),
|
||||
('done', 'Done'),
|
||||
@@ -818,6 +826,7 @@ class ir_actions_todo(osv.osv):
|
||||
'type': fields.selection([('special','Special'),('normal','Normal'),('normal_recurring','Normal Recurring')],'Type',required=True),
|
||||
'groups_id':fields.many2many('res.groups', 'res_groups_action_rel', 'uid', 'gid', 'Groups'),
|
||||
'note':fields.text('Text', translate=True),
|
||||
'category_id': fields.many2one('ir.actions.todo.category','Category'),
|
||||
}
|
||||
_defaults={
|
||||
'state': 'open',
|
||||
|
||||
@@ -508,58 +508,6 @@ class users(osv.osv):
|
||||
|
||||
users()
|
||||
|
||||
class config_users(osv.osv_memory):
|
||||
_name = 'res.config.users'
|
||||
_inherit = ['res.users', 'res.config']
|
||||
|
||||
def _generate_signature(self, cr, name, email, context=None):
|
||||
return _('--\n%(name)s %(email)s\n') % {
|
||||
'name': name or '',
|
||||
'email': email and ' <'+email+'>' or '',
|
||||
}
|
||||
|
||||
def create_user(self, cr, uid, new_id, context=None):
|
||||
""" create a new res.user instance from the data stored
|
||||
in the current res.config.users.
|
||||
|
||||
If an email address was filled in for the user, sends a mail
|
||||
composed of the return values of ``get_welcome_mail_subject``
|
||||
and ``get_welcome_mail_body`` (which should be unicode values),
|
||||
with the user's data %-formatted into the mail body
|
||||
"""
|
||||
base_data = self.read(cr, uid, new_id, context=context)
|
||||
partner_id = self.pool.get('res.partner').main_partner(cr, uid)
|
||||
address = self.pool.get('res.partner.address').create(
|
||||
cr, uid, {'name': base_data['name'],
|
||||
'email': base_data['email'],
|
||||
'partner_id': partner_id,},
|
||||
context)
|
||||
user_data = dict(
|
||||
base_data,
|
||||
signature=self._generate_signature(
|
||||
cr, base_data['name'], base_data['email'], context=context),
|
||||
address_id=address,
|
||||
)
|
||||
new_user = self.pool.get('res.users').create(
|
||||
cr, uid, user_data, context)
|
||||
self.send_welcome_email(cr, uid, new_user, context=context)
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
'Do nothing on execution, just launch the next action/todo'
|
||||
pass
|
||||
def action_add(self, cr, uid, ids, context=None):
|
||||
'Create a user, and re-display the view'
|
||||
self.create_user(cr, uid, ids[0], context=context)
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'res.config.users',
|
||||
'view_id':self.pool.get('ir.ui.view')\
|
||||
.search(cr,uid,[('name','=','res.config.users.confirm.form')]),
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
config_users()
|
||||
|
||||
class groups2(osv.osv): ##FIXME: Is there a reason to inherit this object ?
|
||||
_inherit = 'res.groups'
|
||||
_columns = {
|
||||
|
||||
Reference in New Issue
Block a user