bzr revid: olt@tinyerp.com-20090707071413-6hp0dcgsh1tqbdnc
This commit is contained in:
Olivier Laurent
2009-07-07 09:14:13 +02:00
4 changed files with 15 additions and 12 deletions
+1 -1
View File
@@ -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)]}),
+9 -6
View File
@@ -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
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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),