Add CompanyReport to trytond.report

This commit is contained in:
Cédric Krier committed 2008-05-14 11:12:11 +02:00
1 parent ca463f7bfe
commit 65fab4946d
1 file changed
+19
+19
View File
@@ -3,6 +3,7 @@
import copy
from trytond.osv import fields, OSV
from trytond.wizard import Wizard, WizardOSV
from trytond.report import Report
class Company(OSV):
@@ -158,3 +159,21 @@ class CompanyConfig(Wizard):
return {}
CompanyConfig()
class CompanyReport(Report):
def parse(self, cursor, user_id, report, objects, datas, context):
user_obj = self.pool.get('res.user')
user = user_obj.browse(cursor, user_id, user_id, context)
if context is None:
context = {}
context = context.copy()
context['company'] = user.company
return super(CompanyReport, self).parse(cursor, user_id, report,
objects, datas, context)
import trytond.report
trytond.report.CompanyReport = CompanyReport