[MERGE] forward port of branch 7.0 up to eaaca65

This commit is contained in:
Christophe Simonis 2015-05-21 14:11:39 +02:00
commit b62ee0734c
5 changed files with 9 additions and 5 deletions

View File

@ -1124,7 +1124,7 @@ class account_move_line(osv.osv):
period = period_obj.browse(cr, uid, period_id, context=context)
for (state,) in result:
if state == 'done':
raise osv.except_osv(_('Error!'), _('You can not add/modify entries in a closed period %s of journal %s.' % (period.name,journal.name)))
raise osv.except_osv(_('Error!'), _('You can not add/modify entries in a closed period %s of journal %s.') % (period.name, journal.name))
if not result:
jour_period_obj.create(cr, uid, {
'name': (journal.code or journal.name)+':'+(period.name or ''),

View File

@ -299,7 +299,7 @@ class mail_compose_message(osv.TransientModel):
# static wizard (mail.message) values
mail_values = {
'subject': wizard.subject,
'body': wizard.body,
'body': wizard.body or '',
'parent_id': wizard.parent_id and wizard.parent_id.id,
'partner_ids': [partner.id for partner in wizard.partner_ids],
'attachment_ids': [attach.id for attach in wizard.attachment_ids],

View File

@ -349,7 +349,7 @@ class mrp_production(osv.osv):
for po in self.browse(cr, uid, ids, context=context):
direction[po.id] = cmp(po.date_start, vals.get('date_start', False))
result = super(mrp_production, self).write(cr, uid, ids, vals, context=context)
if (vals.get('workcenter_lines', False) or vals.get('date_start', False)) and update:
if (vals.get('workcenter_lines', False) or vals.get('date_start', False) or vals.get('date_planned', False)) and update:
self._compute_planned_workcenter(cr, uid, ids, context=context, mini=mini)
for d in direction:
if direction[d] == 1:

View File

@ -2339,7 +2339,11 @@ class stock_move(osv.osv):
new_std_price = new_price
else:
# Get the standard price
amount_unit = product.price_get('standard_price', context=context)[product.id]
pricetype_obj = self.pool.get('product.price.type')
price_type_id = pricetype_obj.search(cr, uid, [('field','=','standard_price')])[0]
price_type_currency_id = pricetype_obj.browse(cr, uid, price_type_id).currency_id.id
amount_unit = self.pool.get('res.currency').compute(cr, uid, price_type_currency_id,
context['currency_id'], product.standard_price, round=False, context=context)
new_std_price = ((amount_unit * product_avail[product.id])\
+ (new_price * qty))/(product_avail[product.id] + qty)

View File

@ -400,7 +400,7 @@ def is_leaf(element, internal=False):
and len(element) == 3 \
and element[1] in INTERNAL_OPS \
and ((isinstance(element[0], basestring) and element[0])
or element in (TRUE_LEAF, FALSE_LEAF))
or tuple(element) in (TRUE_LEAF, FALSE_LEAF))
# --------------------------------------------------