From 258cda718b2ec8cf277ebdb68e8b68acce34ce1b Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 6 Jul 2009 20:57:16 +0200 Subject: [PATCH 1/3] merge bzr revid: fp@tinyerp.com-20090706185716-e4ofbud2ql3914bx --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index d0f529f7cee..ea1f5372b59 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) From 3217ab6c802215f98bc43ac444b3d2bccf7f735a Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 6 Jul 2009 20:59:08 +0200 Subject: [PATCH 2/3] merge bzr revid: fp@tinyerp.com-20090706185908-48cq70uifggju6sk --- addons/account/invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)]}), From 2719646907fc6a5e2f080bbdfbfb8f8cd0a8b139 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 6 Jul 2009 21:39:59 +0200 Subject: [PATCH 3/3] [FIX] 373203 bzr revid: fp@tinyerp.com-20090706193959-yp0m9rjamx5bt9lt --- addons/product/product.py | 15 +++++++++------ addons/sale/sale.py | 6 +++--- addons/stock/stock.py | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) 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 abccfa4b758..e36d1f15134 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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),