0
votes

I have two type of sale 1)Direct sale and 2) Indirect sale, while printing in delivery slip I need to get Direct and indirect sale separately, I achieve this by using two section in RML report, one for direct sale and another for indirect sale, the problem is when I select two record i.e indirect and direct, it print last selected record in single pdf, So how to restrict this and print both the selected record in separate pdf,

Here is my RML code,

<story>
<pto>
<section>
<para style="terp_default_8">[[(sale_name() == 'INDIRECT SALE' and removeParentNode('para')) or removeParentNode('section')]] </para>
 ...............
 ...............
 </section>
<para style="terp_default_8">[[(sale_name() == 'DIRECT SALE' and removeParentNode('para')) or removeParentNode('section')]] </para>
 ...............
 ...............
 </section> 
 </pto>
 <story>
1

1 Answers

0
votes

sale_name() is a method so you need to code in report.py file. And use global variable like self.name_type1 For example

self.name_type1 = so1_type1.order_type

Now method code like

def _sale_name(self):
    #here is can put your code like whatever condition
    if self.name_type1 == 'indirectsale':
        return 'INDIRECT SALE'
    else:
        return 'DIRECT SALE'

You can also pass argument in sale_name() method.

Hope this will help you.