[MERGE] forward port of branch saas-2 up to revid 9029 chs@openerp.com-20131204125051-dexejzwigpu0z1yy
bzr revid: chs@openerp.com-20131204130023-lgravuoxwlt39pek
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
<field name="active" eval="False"/>
|
||||
<!-- Avoid auto-including this user in any default group, just like a typical portal member -->
|
||||
<field name="groups_id" eval="[(5,)]"/>
|
||||
<!-- no alias for portal users -->
|
||||
<field name="alias_name" eval="False"/>
|
||||
<!-- allow signuped users to have a alias -->
|
||||
<field name="alias_name">_usertemplate</field>
|
||||
</record>
|
||||
|
||||
<record id="default_template_user_config" model="ir.config_parameter">
|
||||
|
||||
@@ -234,8 +234,6 @@ class res_users(osv.Model):
|
||||
|
||||
# create a copy of the template user (attached to a specific partner_id if given)
|
||||
values['active'] = True
|
||||
if 'alias_name' not in values: # allow behavior change via inheritance (like using the name)
|
||||
values['alias_name'] = False
|
||||
context = dict(context or {}, no_reset_password=True)
|
||||
return self.copy(cr, uid, template_user_id, values, context=context)
|
||||
|
||||
|
||||
@@ -211,5 +211,5 @@ class im_session(osv.osv):
|
||||
_inherit = 'im.session'
|
||||
|
||||
_columns = {
|
||||
'channel_id': fields.many2one("im.user", "Channel"),
|
||||
'channel_id': fields.many2one("im_livechat.channel", "Channel"),
|
||||
}
|
||||
|
||||
@@ -81,6 +81,12 @@ class res_users(osv.Model):
|
||||
self._create_welcome_message(cr, uid, user, context=context)
|
||||
return user_id
|
||||
|
||||
def copy_data(self, *args, **kwargs):
|
||||
data = super(res_users, self).copy_data(*args, **kwargs)
|
||||
if data.get('alias_name'):
|
||||
data['alias_name'] = data['login']
|
||||
return data
|
||||
|
||||
def _create_welcome_message(self, cr, uid, user, context=None):
|
||||
if not self.has_group(cr, uid, 'base.group_user'):
|
||||
return False
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="report_template" ref="sale.report_sale_order"/>
|
||||
<field name="report_name">${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
||||
<field name="lang">${object.partner_id.lang}</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
|
||||
|
||||
@@ -102,6 +103,7 @@
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="report_template" ref="account.account_invoices"/>
|
||||
<field name="report_name">Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
||||
<field name="lang">${object.partner_id.lang}</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class sale_order(osv.osv):
|
||||
company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
|
||||
warehouse_ids = self.pool.get('stock.warehouse').search(cr, uid, [('company_id', '=', company_id)], context=context)
|
||||
if not warehouse_ids:
|
||||
raise osv.except_osv(_('Error!'), _('There is no warehouse defined for current company.'))
|
||||
return False
|
||||
return warehouse_ids[0]
|
||||
|
||||
# This is False
|
||||
|
||||
Reference in New Issue
Block a user