[MERGE] forward port of branch 7.0 up to f8b56e4

This commit is contained in:
Christophe Simonis 2015-10-10 14:25:35 +02:00
commit a6b11a151e
7 changed files with 21 additions and 9 deletions

View File

@ -299,3 +299,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

@ -962,7 +962,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 '\
@ -971,7 +971,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
_columns = {

View File

@ -545,7 +545,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();
});

View File

@ -308,7 +308,7 @@ class mrp_production(osv.osv):
if l.state in ('done','cancel','draft'):
continue
todo += l.move_dest_id_lines
if l.production_id and (l.production_id.date_finished > dt):
if l.production_id and (l.production_id.date_finished > dt.strftime('%Y-%m-%d %H:%M:%S')):
if l.production_id.state not in ('done','cancel'):
for wc in l.production_id.workcenter_lines:
i = self.pool.get('resource.calendar').interval_min_get(

View File

@ -39,7 +39,10 @@
<action name="%(my_open_tasks_action)d" string="My Tasks"/>
</column>
<column>
<action name="%(action_view_task_history_cumulative)d" string="Open Tasks"/>
<action
groups="project.group_project_user"
name="%(action_view_task_history_cumulative)d"
string="Open Tasks"/>
</column>
</board>
</form>

View File

@ -2313,7 +2313,7 @@ class stock_move(osv.osv):
if move.location_dest_id.usage != 'internal' and move.product_id.cost_method == 'average':
reference_amount = qty * move.product_id.standard_price
elif move.product_id.cost_method == 'average' and move.price_unit:
reference_amount = qty * move.price_unit
reference_amount = move.product_qty * move.price_unit
reference_currency_id = move.price_currency_id.id or reference_currency_id
# Otherwise we default to the company's valuation price type, considering that the values of the

View File

@ -939,10 +939,13 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True,
# Normally the path looks like /path/to/xxx/i18n/lang.po
# and we try to find the corresponding
# /path/to/xxx/i18n/xxx.pot file.
# (Sometimes we have 'i18n_extra' instead of just 'i18n')
head, _ = os.path.split(fileobj.name)
head2, _ = os.path.split(head)
head3, tail3 = os.path.split(head2)
pot_handle = misc.file_open(os.path.join(head3, tail3, 'i18n', tail3 + '.pot'))
head2, i18n_dir = os.path.split(head)
head3, module_dir = os.path.split(head2)
pot_path = os.path.join(
head3, module_dir, i18n_dir, module_dir + '.pot')
pot_handle = misc.file_open(pot_path)
pot_reader = TinyPoFile(pot_handle)
except:
pass