diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 6ec083ac7cb..2bbd2e92207 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -223,7 +223,7 @@ class account_invoice(osv.osv): help="If you use payment terms, the due date will be computed automatically at the generation "\ "of accounting entries. If you keep the payment term and the due date empty, it means direct payment. "\ "The payment term may compute several due dates, for example 50% now, 50% in one month."), - 'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(invoice) date."), + 'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(invoice) date.", readonly=True, states={'draft':[('readonly',False)]}), 'account_id': fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="The partner account used for this invoice."), 'invoice_line': fields.one2many('account.invoice.line', 'invoice_id', 'Invoice Lines', readonly=True, states={'draft':[('readonly',False)]}), diff --git a/addons/product/product.py b/addons/product/product.py index b7ae4ea566e..1937912a329 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -496,12 +496,15 @@ class product_product(osv.osv): args=[] if not context: context={} - ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context) - if not len(ids): - ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context) - if not len(ids): - ids = self.search(cr, user, [('default_code',operator,name)]+ args, limit=limit, context=context) - ids += self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context) + if name: + ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context) + if not len(ids): + ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context) + if not len(ids): + ids = self.search(cr, user, [('default_code',operator,name)]+ args, limit=limit, context=context) + ids += self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context) + else: + ids = self.search(cr, user, args, limit=limit, context=context) result = self.name_get(cr, user, ids, context) return result diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 58240d2058f..e36d1f15134 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -359,7 +359,7 @@ class sale_order(osv.osv): else: pay_term = False for preinv in order.invoice_ids: - if preinv.state in ('open','paid','proforma'): + if preinv.state not in ('cancel',): for preline in preinv.invoice_line: inv_line_id = self.pool.get('account.invoice.line').copy(cr, uid, preline.id, {'invoice_id':False, 'price_unit':-preline.price_unit}) lines.append(inv_line_id) @@ -893,10 +893,10 @@ class sale_order_line(osv.osv): ean = pack.ean qty_pack = pack.qty type_ul = pack.ul - warn_msg = "You selected a quantity of %d Units.\nBut it's not compatible with the selected packaging.\nHere is a proposition of quantities according to the packaging: " % (qty) - warn_msg = warn_msg + "\n\nEAN: " + str(ean) + " Quantity: " + str(qty_pack) + " Type of ul: " + str(type_ul.name) + warn_msg = _("You selected a quantity of %d Units.\nBut it's not compatible with the selected packaging.\nHere is a proposition of quantities according to the packaging: ") % (qty) + warn_msg = warn_msg + "\n\n"+_("EAN: ") + str(ean) + _(" Quantity: ") + str(qty_pack) + _(" Type of ul: ") + str(type_ul.name) warning={ - 'title':'Packing Information !', + 'title':_('Packing Information !'), 'message': warn_msg } result['product_uom_qty'] = qty diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 199cb38f1ae..2cdb9a22f13 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -428,7 +428,7 @@ class stock_picking(osv.osv): ('confirmed','Confirmed'), ('assigned','Available'), ('done','Done'), - ('cancel','Cancel'), + ('cancel','Canceled'), ], 'Status', readonly=True, select=True), 'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date", method=True,store=True, type='datetime', string='Planned Date', select=1),