[MERGE] forward port of branch 7.0 up to 2080ea0

This commit is contained in:
Denis Ledoux 2014-11-27 13:27:37 +01:00
commit e347011f24
4 changed files with 22 additions and 19 deletions

View File

@ -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'),

View File

@ -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:

View File

@ -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);
});

View File

@ -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."))