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)]}),
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
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)
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
('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),