Tryton using relatorio so that's hard to say but I think it should be
approached from within tryton. To make the function available you
need to extend the report by overloading the parse method and putting
your function into the context variable.
Here I set a variable called store which is accessible in the report:
class InvoiceReport(CompanyReport):
_name = 'account.invoice'
def parse(self, cursor, user_id, report, objects, datas, context):
employee_obj = self.pool.get('company.employee')
employee = employee_obj.browse(cursor, user_id,
context['employee'], context=context)
context['store'] = employee and employee.store or False
return super(InvoiceReport, self).parse(cursor, user_id,
report, objects, datas, context)
InvoiceReport()
Do you also need to extend the actual invoice.odt itself?
There are some examples here:
http://doc.tryton.org/1.4/trytond/doc/reports.html#replacing-existing-tryton-reports
On Sat, Jan 16, 2010 at 1:36 PM, Mourad <[email protected]> wrote:
> Hi all,
> i have a function num_to_word() that convert a monetary to it's
> literal string, i want to push this function into the context sent to
> genshi template so it become callable inside an invoice, i need some
> hints
> is this relatorio stuff or trytond stuff?
>
> Thanks
>
> --
> [email protected] mailing list
>
--
[email protected] mailing list