I want to edit the method def name_search in order to get specific account depending to invoice type.
But I could not call the invoice object in order to get type.
Any help please and thanks
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
invoice_obj = self.pool.get('account_invoice')
invoice_ids = invoice_obj.search(cr, user, name,, context=context)
for inv in invoice_obj.browse(cr, user, invoice_ids,context=None):
codes=[610001, 610002, 610003, 610004, 610005]
args += [('code','in' , codes)]
ids = self.search(cr, user, args, context=context, limit=limit)
return self.name_get(cr, user, ids, context=context)
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 8/30/16, 9:06 AM|
|Seen: 93 times|
|Last updated: 8/30/16, 10:21 AM|