Hello all of you,
I would need to understand a new concept...
See example first class :
class report_saleslines_pt(models.AbstractModel):
_name = 'report.point_of_sale.report_saleslines'
_template = 'point_of_sale.report_saleslines'
@api.multi
def render_html(self, data=None):
report.choosen_paper = a_number_or_object
We have a second class.
class Report(osv.Model):
_inherit = "report"
_name = "report"
_description = "Report"
@api.v7
def get_pdf(self, cr, uid, ids, report_name, html=None, data=None, context=None):
paper = report.choosen_paper
Our two classes work well and are well declared (I didn't paste all the code).
How could I give a value to report.choosen_paper in the class report_saleslines_pt and after recup this value in get_pdf() from the class report?
How to exchange temp value beetqween classes?
Do you understand what I mean?
Thanks for words or idea.
FIRST UPDATE ::::
See example first class :
class report_saleslines_pt(models.AbstractModel):
_name = 'report.point_of_sale.report_saleslines'
_template = 'point_of_sale.report_saleslines'
@api.multi
def render_html(self, data=None):
self.env['report'].with_context(exchangeVAR='KILLINGDESTROY')
We have a second class.
class Report(osv.Model):
_inherit = "report"
_name = "report"
_description = "Report"
@api.v7
def get_pdf(self, cr, uid, ids, report_name, html=None, data=None, context=None):
_logger.error("REPORT_LAPAGEPT :: %s %s", 'CONTEXT :: ', context)
I can now see the context in my log. But still NO trace of exchangeVAR in the context.
Thanks
I don't want to change any value in the database. I just want a kind of global value.
pass with context?
I have printed this : https://www.odoo.com/fr_FR/forum/help-1/question/whats-the-context-2236 Trying it. Thanks
Not able to modify context in render_html. ANd make this context the same than in get_pdf