diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 9d8d849c5b9..32141e9f554 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -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 ''), diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index e5ff2b51fcd..acde22399b2 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -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], diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 06e5aa40030..c127f414422 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -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: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9aa48422727..9b5851141cd 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -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) diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py index 58999e751fd..8c245edf09e 100644 --- a/openerp/osv/expression.py +++ b/openerp/osv/expression.py @@ -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)) # --------------------------------------------------