29
29
super(contract, self).__init__(cr, uid, name, context=context)
30
30
self.localcontext.update({
32
'process': self.process,
33
'get_totals': self.get_totals,
38
def get_totals(self, reporting_lines):
40
# Parse each budget line
42
for line in reporting_lines:
43
if line.line_type != 'view':
44
result[0] += line.allocated_budget
45
result[1] += line.project_budget
48
def process(self, reporting_lines):
49
register_states = dict(self.pool.get('financing.contract.format.line')._columns['line_type'].selection)
51
# Parse each contract line
52
for line in reporting_lines:
54
for account in line.account_ids:
55
account_list += str(account.code)
57
if len(account_list) > 2:
58
account_list = account_list[:-2]
59
values = {'code': line.code,
61
'allocated_budget': line.allocated_budget,
62
'project_budget': line.project_budget,
63
'line_type': register_states[line.line_type],
64
'account_list': account_list}
37
69
report_sxw.report_sxw('report.financing.contract', 'financing.contract.contract', 'addons/financing_contract/report/financing_contract.rml', parser=contract)