Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2480 Переглядів

            
        
    

    
        



        

        


    
    
                

How can I pass value to qweb and add to binary field. Everything is fine but I don't know how to add value to qweb. Here is my code.

def button_plan(self): super(MrpProduction, self).button_plan() for report in self.bom_id.multiple_report: report_name = "action_report_template" template = report pdf = self.env.ref('bks_mo.action_report_template')._render_qweb_pdf(self.ids) report.operation_id.worksheet_type = 'pdf' report.operation_id.worksheet = base64.b64encode(pdf[0])

How can I add template value to qweb.

Аватар
Відмінити
Найкраща відповідь

Hello GGWP,
As per your code.
you can pass by with_context like this.

report = report.with_context(value_pass = test)._render_qweb_pdf(self.res_id)

or
by data pass in argument.
data = [{key1:val1},{key2:val2}]
pdf = report.with_context(context)._render_qweb_pdf(docids, data=data)[0]

Thanks & Regards,

Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
лип. 23
6512
1
черв. 23
4415
1
квіт. 23
5143
1
лист. 22
3864
1
жовт. 21
12204