diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 34b72c56630..99ee036f2e7 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1632,7 +1632,7 @@ class stock_move(osv.osv): 'location_dest_id': fields.many2one('stock.location', 'Destination Location', required=True,states={'done': [('readonly', True)]}, select=True, help="Location where the system will stock the finished products."), 'partner_id': fields.many2one('res.partner', 'Destination Address ', states={'done': [('readonly', True)]}, help="Optional address where goods are to be delivered, specifically used for allotment"), - 'prodlot_id': fields.many2one('stock.production.lot', 'Serial Number', states={'done': [('readonly', True)]}, help="Serial number is used to put a serial number on the production", select=True), + 'prodlot_id': fields.many2one('stock.production.lot', 'Serial Number', help="Serial number is used to put a serial number on the production", select=True, ondelete='restrict'), 'tracking_id': fields.many2one('stock.tracking', 'Pack', select=True, states={'done': [('readonly', True)]}, help="Logistical shipping unit: pallet, box, pack ..."), 'auto_validate': fields.boolean('Auto Validate'), diff --git a/addons/stock/wizard/stock_invoice_onshipping.py b/addons/stock/wizard/stock_invoice_onshipping.py index a385b86cae6..004fa9ec03e 100644 --- a/addons/stock/wizard/stock_invoice_onshipping.py +++ b/addons/stock/wizard/stock_invoice_onshipping.py @@ -46,23 +46,24 @@ class stock_invoice_onshipping(osv.osv_memory): browse_picking = model_pool.browse(cr, uid, res_ids, context=context) for pick in browse_picking: - if not pick.move_lines: - continue - src_usage = pick.move_lines[0].location_id.usage - dest_usage = pick.move_lines[0].location_dest_id.usage - type = pick.type - if type == 'out' and dest_usage == 'supplier': - journal_type = 'purchase_refund' - elif type == 'out' and dest_usage == 'customer': - journal_type = 'sale' - elif type == 'in' and src_usage == 'supplier': - journal_type = 'purchase' - elif type == 'in' and src_usage == 'customer': - journal_type = 'sale_refund' - else: - journal_type = 'sale' + domain = [('type', 'in', ['sale', 'sale_refund', 'purchase', 'purchase_refund'])] + if pick.move_lines: + src_usage = pick.move_lines[0].location_id.usage + dest_usage = pick.move_lines[0].location_dest_id.usage + type = pick.type + if type == 'out' and dest_usage == 'supplier': + journal_type = 'purchase_refund' + elif type == 'out' and dest_usage == 'customer': + journal_type = 'sale' + elif type == 'in' and src_usage == 'supplier': + journal_type = 'purchase' + elif type == 'in' and src_usage == 'customer': + journal_type = 'sale_refund' + else: + journal_type = 'sale' + domain = [('type', '=', journal_type)] - value = journal_obj.search(cr, uid, [('type', '=',journal_type )]) + value = journal_obj.search(cr, uid, domain) for jr_type in journal_obj.browse(cr, uid, value, context=context): t1 = jr_type.id,jr_type.name if t1 not in vals: diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 20b56d62e80..5929be79136 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -545,8 +545,9 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi self.records.remove(record); return; } - _(_.keys(values)).each(function(key){ - record.set(key, values[key], {silent: true}); + _.each(values, function (value, key) { + record.set(key + '__display', false, {silent: true}); + record.set(key, value, {silent: true}); }); record.trigger('change', record); }); diff --git a/openerp/addons/base/res/res_bank.py b/openerp/addons/base/res/res_bank.py index 00d18d08078..aa9fa861548 100644 --- a/openerp/addons/base/res/res_bank.py +++ b/openerp/addons/base/res/res_bank.py @@ -190,6 +190,7 @@ class res_partner_bank(osv.osv): try: if not data.get('bank_name'): data['bank_name'] = _('BANK') + data = dict((k, v or '') for (k, v) in data.iteritems()) name = bank_code_format[data['state']] % data except Exception: raise osv.except_osv(_("Formating Error"), _("Invalid Bank Account Type Name format."))