Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
5448 Weergaven

<openerp>
 <data>
     <report
         id="account_invoices"
         model="account.invoice"
         string="Invoices"
         report_type="qweb-pdf"
         name="account.report_invoice"  
         file="account.report_invoice"  
         attachment_use="True"

         attachment="(object.state in ('open','paid')) and ((object.number or '').replace('/','')+'.pdf')"

        />
 </data>
</openerp>

 

I need your HELP.

Thanks for advances

Avatar
Annuleer
Beste antwoord

I use in my module "account__pl":

<report
            id="account_invoices__pl"
            model="account.invoice"
            string="Invoices PL"
            report_type="qweb-pdf"
            name="account__pl.report_invoice_pl"
            file="account__pl.report_invoice_pl"
            attachment_use="True"
            attachment="(object.state in ('open','paid')) and ('IPL'+(object.number or '').replace('/','')+'.pdf')"
            multi="True"
        />

 

and in report_invoice_pl.py:

 

class report_invoice_pl(osv.AbstractModel):
    _name = 'report.account.report_invoice'
    _inherit = 'report.abstract_report'
    _template = 'account__pl.report_invoice_pl'
    _wrapped_report_class = parse_invoice_pl 

 

or, in new style reports:

 

class report_invoice(models.AbstractModel):
    _name = 'report.account.report_invoice'
    _template = 'account__pl.report_invoice_pl'
    
    @api.multi
    def render_html(self, data=None):
                                                                     
        report_obj = self.env['report']
        report = report_obj._get_report_from_name(self._template)        
       
        docargs = {
            'doc_ids': self._ids,
            'doc_model': report.model,
            'docs': self,
        }

        return report_obj.render(self._template, docargs)

class report_invoice_pl(report_invoice):
    _name = 'report.account__pl.report_invoice_pl'

 

 

Avatar
Annuleer
Auteur Beste antwoord

 

and in report_invoice_pl.py:

 

class report_invoice_pl(osv.AbstractModel):
    _name = 'report.account.report_invoice'
    _inherit = 'report.abstract_report'
    _template = 'account__pl.report_invoice_pl'
    _wrapped_report_class = parse_invoice_pl 

This Model used to embed old style reports

Avatar
Annuleer

ok, you're right, improve in yourself

Auteur

did you check if it works?

Auteur

did you check if it works?

Auteur

thanks for your reply!!!