To sort invoice, you need a srto method in your rml parser...
best way is to make a custom report parser...
Here is an example parser :
def __init__(self, cr, uid, name, context):
super(account_invoice, self).__init__(cr, uid, name, context=context)
def _sort(self, theList):
#sorting by name ... change to apropriate: sequence, code price...
theList.sort(key=lambda x: x.name, reverse=False)
Now, in your rml you can instead of: [[ repeatIn(o.sort_print,'l') ]]
use : [[ repeatIn(sort(o.invoice_line),'l') ]]
for reveserse sort order : [[ repeatIn(sort(o.invoice_line, reverse=True),'l') ]]
modifiy sort conditions to your needs...
hope it helps...
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: 1/20/15, 5:49 AM|
|Seen: 1455 times|
|Last updated: 3/16/15, 8:10 AM|