diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index ece5caefc7d..154014368c3 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -913,7 +913,10 @@ class account_invoice(models.Model): i[2]['period_id'] = period.id ctx['invoice'] = inv - move = account_move.with_context(ctx).create(move_vals) + ctx_nolang = ctx.copy() + ctx_nolang.pop('lang', None) + move = account_move.with_context(ctx_nolang).create(move_vals) + # make the invoice point to that move vals = { 'move_id': move.id, diff --git a/addons/account_budget/account_budget.py b/addons/account_budget/account_budget.py index 19852344da3..1996eb7b506 100644 --- a/addons/account_budget/account_budget.py +++ b/addons/account_budget/account_budget.py @@ -118,10 +118,12 @@ class crossovered_budget_lines(osv.osv): result = 0.0 if context is None: context = {} + account_obj = self.pool.get('account.account') for line in self.browse(cr, uid, ids, context=context): acc_ids = [x.id for x in line.general_budget_id.account_ids] if not acc_ids: raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % ustr(line.general_budget_id.name)) + acc_ids = account_obj._get_children_and_consol(cr, uid, acc_ids, context=context) date_to = line.date_to date_from = line.date_from if line.analytic_account_id.id: diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index 4ba98c4c4c7..e8e2fe79ee8 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -126,12 +126,11 @@ class delivery_carrier(osv.osv): # not using advanced pricing per destination: override grid grid_id = grid_pool.search(cr, uid, [('carrier_id', '=', record.id)], context=context) - if grid_id and not (record.normal_price or record.free_if_more_than): + if grid_id and not (record.normal_price is not False or record.free_if_more_than): grid_pool.unlink(cr, uid, grid_id, context=context) grid_id = None - # Check that float, else 0.0 is False - if not (isinstance(record.normal_price,float) or record.free_if_more_than): + if not (record.normal_price is not False or record.free_if_more_than): continue if not grid_id: @@ -158,7 +157,7 @@ class delivery_carrier(osv.osv): 'list_price': 0.0, } grid_line_pool.create(cr, uid, line_data, context=context) - if isinstance(record.normal_price,float): + if record.normal_price is not False: line_data = { 'grid_id': grid_id and grid_id[0], 'name': _('Default price'), diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml index 54b8b4f4025..1e562e729e7 100644 --- a/addons/l10n_be/account_pcmn_belgium.xml +++ b/addons/l10n_be/account_pcmn_belgium.xml @@ -3589,6 +3589,7 @@ other + Acomptes reçus @@ -3596,6 +3597,7 @@ other + Compensations fournisseurs @@ -3603,6 +3605,7 @@ other + DETTES FISCALES, SALARIALES ET SOCIALES diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index a2c5ae39772..8270cb986cf 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -445,6 +445,9 @@ class mail_thread(osv.AbstractModel): cascaded, because link is done through (res_model, res_id). """ msg_obj = self.pool.get('mail.message') fol_obj = self.pool.get('mail.followers') + + if isinstance(ids, (int, long)): + ids = [ids] # delete messages and notifications msg_ids = msg_obj.search(cr, uid, [('model', '=', self._name), ('res_id', 'in', ids)], context=context) msg_obj.unlink(cr, uid, msg_ids, context=context) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index bb21b7915a2..1ca44c91072 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1584,7 +1584,8 @@ class account_invoice(osv.Model): not all(picking.invoice_state in ['invoiced'] for picking in order.picking_ids)): shipped = False for po_line in order.order_line: - if all(line.invoice_id.state not in ['draft', 'cancel'] for line in po_line.invoice_lines): + if (po_line.invoice_lines and + all(line.invoice_id.state not in ['draft', 'cancel'] for line in po_line.invoice_lines)): invoiced.append(po_line.id) if invoiced and shipped: self.pool['purchase.order.line'].write(cr, user_id, invoiced, {'invoiced': True}) diff --git a/addons/sale_stock/test/sale_order_onchange.yml b/addons/sale_stock/test/sale_order_onchange.yml index 7cb4da5c338..c667632c15b 100644 --- a/addons/sale_stock/test/sale_order_onchange.yml +++ b/addons/sale_stock/test/sale_order_onchange.yml @@ -9,6 +9,7 @@ !record {model: product.product, id: product_onchange1}: name: 'Devil Worship Book' list_price: 66.6 + default_code: 'DWB00001' - In sale order to test process of onchange of Sale Order with access rights of saleman. - @@ -26,5 +27,5 @@ I verify that the onchange of product on sale order line was correctly triggered - !assert {model: sale.order, id: sale_order_onchange1, string: The onchange function of product was not correctly triggered}: - - order_line[0].name == u'Devil Worship Book' + - order_line[0].name == u'[DWB00001] Devil Worship Book' - order_line[0].price_unit == 66.6 diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index d9ee87901fb..b2f71142638 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -1591,6 +1591,8 @@ class sparse(function): """ if self._type == 'many2many': + if not value: + return [] assert value[0][0] == 6, 'Unsupported m2m value for sparse field: %s' % value return value[0][2]