[MERGE] forward port of branch saas-3 up to a6b11a1

This commit is contained in:
Christophe Simonis 2015-10-10 14:35:44 +02:00
commit c4844675b8
3 changed files with 9 additions and 3 deletions

View File

@ -307,3 +307,9 @@ class res_users(osv.Model):
except MailDeliveryException:
self.pool.get('res.partner').signup_cancel(cr, uid, [user.partner_id.id], context=context)
return user_id
def copy(self, cr, uid, id, default=None, context=None):
if not default or not default.get('email'):
# avoid sending email to the user we are duplicating
context = dict(context or {}, reset_password=False)
return super(res_users, self).copy(cr, uid, id, default=default, context=context)

View File

@ -949,7 +949,7 @@ class hr_employee(osv.osv):
current_date = datetime.now().strftime('%Y-%m-%d')
for employee in self.browse(cr, uid, ids, context=context):
if not employee.contract_ids:
res[employee.id] = {'basic': 0.0}
res[employee.id] = 0.0
continue
cr.execute( 'SELECT SUM(wage) '\
'FROM hr_contract '\
@ -958,7 +958,7 @@ class hr_employee(osv.osv):
'AND (date_end > %s OR date_end is NULL)',
(employee.id, current_date, current_date))
result = dict(cr.dictfetchone())
res[employee.id] = {'basic': result['sum']}
res[employee.id] = result['sum']
return res
def _payslip_count(self, cr, uid, ids, field_name, arg, context=None):

View File

@ -542,7 +542,7 @@ openerp.mail = function (session) {
};
self.do_action(action, {
'on_close': function(){ self.is_log && self.parent_thread.message_fetch() }
'on_close': function(){ !self.parent_thread.options.view_inbox && self.parent_thread.message_fetch() }
});
self.on_cancel();
});