[MERGE] Fwd-port saas-3 up to a9d2b65
This commit is contained in:
commit
e31fd6a1e1
|
@ -79,7 +79,11 @@ class sale_order_line(osv.osv):
|
||||||
if product:
|
if product:
|
||||||
product_res = self.pool.get('product.product').browse(cr, uid, product, context=context)
|
product_res = self.pool.get('product.product').browse(cr, uid, product, context=context)
|
||||||
if product_res.event_ok:
|
if product_res.event_ok:
|
||||||
res['value'].update({'event_type_id': product_res.event_type_id.id, 'event_ok':product_res.event_ok})
|
res['value'].update(event_type_id=product_res.event_type_id.id,
|
||||||
|
event_ok=product_res.event_ok)
|
||||||
|
else:
|
||||||
|
res['value'].update(event_type_id=False,
|
||||||
|
event_ok=False)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def button_confirm(self, cr, uid, ids, context=None):
|
def button_confirm(self, cr, uid, ids, context=None):
|
||||||
|
|
|
@ -301,6 +301,7 @@ class hr_employee(osv.osv):
|
||||||
resource_ids = []
|
resource_ids = []
|
||||||
for employee in self.browse(cr, uid, ids, context=context):
|
for employee in self.browse(cr, uid, ids, context=context):
|
||||||
resource_ids.append(employee.resource_id.id)
|
resource_ids.append(employee.resource_id.id)
|
||||||
|
super(hr_employee, self).unlink(cr, uid, ids, context=context)
|
||||||
return self.pool.get('resource.resource').unlink(cr, uid, resource_ids, context=context)
|
return self.pool.get('resource.resource').unlink(cr, uid, resource_ids, context=context)
|
||||||
|
|
||||||
def onchange_address_id(self, cr, uid, ids, address, context=None):
|
def onchange_address_id(self, cr, uid, ids, address, context=None):
|
||||||
|
|
|
@ -24,7 +24,7 @@ import openerp.tools as tools
|
||||||
from openerp.osv import osv
|
from openerp.osv import osv
|
||||||
from openerp.osv import fields
|
from openerp.osv import fields
|
||||||
from openerp import SUPERUSER_ID
|
from openerp import SUPERUSER_ID
|
||||||
|
from openerp.tools.translate import _
|
||||||
|
|
||||||
class mail_group(osv.Model):
|
class mail_group(osv.Model):
|
||||||
""" A mail_group is a collection of users sharing messages in a discussion
|
""" A mail_group is a collection of users sharing messages in a discussion
|
||||||
|
@ -166,6 +166,12 @@ class mail_group(osv.Model):
|
||||||
mail_alias = self.pool.get('mail.alias')
|
mail_alias = self.pool.get('mail.alias')
|
||||||
alias_ids = [group.alias_id.id for group in groups if group.alias_id]
|
alias_ids = [group.alias_id.id for group in groups if group.alias_id]
|
||||||
# Delete mail_group
|
# Delete mail_group
|
||||||
|
try:
|
||||||
|
all_emp_group = self.pool['ir.model.data'].get_object_reference(cr, uid, 'mail', 'group_all_employees')[1]
|
||||||
|
except ValueError:
|
||||||
|
all_emp_group = None
|
||||||
|
if all_emp_group and all_emp_group in ids:
|
||||||
|
raise osv.except_osv(_('Warning!'), _('You cannot delete those groups, as the Whole Company group is required by other modules.'))
|
||||||
res = super(mail_group, self).unlink(cr, uid, ids, context=context)
|
res = super(mail_group, self).unlink(cr, uid, ids, context=context)
|
||||||
# Delete alias
|
# Delete alias
|
||||||
mail_alias.unlink(cr, SUPERUSER_ID, alias_ids, context=context)
|
mail_alias.unlink(cr, SUPERUSER_ID, alias_ids, context=context)
|
||||||
|
|
|
@ -1342,7 +1342,7 @@ class mail_thread(osv.AbstractModel):
|
||||||
return result
|
return result
|
||||||
if partner and partner in obj.message_follower_ids: # recipient already in the followers -> skip
|
if partner and partner in obj.message_follower_ids: # recipient already in the followers -> skip
|
||||||
return result
|
return result
|
||||||
if partner and partner in [val[0] for val in result[obj.id]]: # already existing partner ID -> skip
|
if partner and partner.id in [val[0] for val in result[obj.id]]: # already existing partner ID -> skip
|
||||||
return result
|
return result
|
||||||
if partner and partner.email: # complete profile: id, name <email>
|
if partner and partner.email: # complete profile: id, name <email>
|
||||||
result[obj.id].append((partner.id, '%s<%s>' % (partner.name, partner.email), reason))
|
result[obj.id].append((partner.id, '%s<%s>' % (partner.name, partner.email), reason))
|
||||||
|
|
|
@ -3084,7 +3084,8 @@ class BaseModel(object):
|
||||||
m2m_tbl, col1, col2 = f._sql_names(self)
|
m2m_tbl, col1, col2 = f._sql_names(self)
|
||||||
# do not create relations for custom fields as they do not belong to a module
|
# do not create relations for custom fields as they do not belong to a module
|
||||||
# they will be automatically removed when dropping the corresponding ir.model.field
|
# they will be automatically removed when dropping the corresponding ir.model.field
|
||||||
if not f.string.startswith('x_'):
|
# table name for custom relation all starts with x_, see __init__
|
||||||
|
if not m2m_tbl.startswith('x_'):
|
||||||
self._save_relation_table(cr, m2m_tbl)
|
self._save_relation_table(cr, m2m_tbl)
|
||||||
cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (m2m_tbl,))
|
cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (m2m_tbl,))
|
||||||
if not cr.dictfetchall():
|
if not cr.dictfetchall():
|
||||||
|
|
|
@ -498,10 +498,11 @@ def html2plaintext(html, body_id=None, encoding='utf-8'):
|
||||||
html = re.sub('<br\s*/?>', '\n', html)
|
html = re.sub('<br\s*/?>', '\n', html)
|
||||||
html = re.sub('<.*?>', ' ', html)
|
html = re.sub('<.*?>', ' ', html)
|
||||||
html = html.replace(' ' * 2, ' ')
|
html = html.replace(' ' * 2, ' ')
|
||||||
|
html = html.replace('>', '>')
|
||||||
|
html = html.replace('<', '<')
|
||||||
|
|
||||||
# strip all lines
|
# strip all lines
|
||||||
html = '\n'.join([x.strip() for x in html.splitlines()])
|
html = ''.join([x.strip() for x in html.splitlines(True)])
|
||||||
html = html.replace('\n' * 2, '\n')
|
|
||||||
|
|
||||||
for i, url in enumerate(url_index):
|
for i, url in enumerate(url_index):
|
||||||
if i == 0:
|
if i == 0:
|
||||||
|
|
Loading…
Reference in New Issue