[IMP] mis_builder: code cosmetics

pull/86/head
Stéphane Bidoul 2015-04-27 19:11:44 +02:00
parent 36292b757f
commit 44499e620d
7 changed files with 7 additions and 13 deletions

View File

@ -101,7 +101,7 @@ class AccountingExpressionProcessor(object):
else:
self._account_ids_by_code[like_code].add(account.id)
def _parse_mo(self, mo):
def _parse_match_object(self, mo):
"""Split a match object corresponding to an accounting variable
Returns field, mode, [account codes], [domain expression].
@ -130,7 +130,7 @@ class AccountingExpressionProcessor(object):
so when all expressions have been parsed, we know what to query.
"""
for mo in self.ACC_RE.finditer(expr):
_, mode, account_codes, domain = self._parse_mo(mo)
_, mode, account_codes, domain = self._parse_match_object(mo)
key = (domain, mode)
if account_codes:
self._map_account_ids[key].update(account_codes)
@ -157,7 +157,7 @@ class AccountingExpressionProcessor(object):
"""
aml_domains = []
for mo in self.ACC_RE.finditer(expr):
field, mode, account_codes, domain = self._parse_mo(mo)
field, mode, account_codes, domain = self._parse_match_object(mo)
if mode == MODE_INITIAL:
continue
aml_domain = list(domain)
@ -269,7 +269,7 @@ class AccountingExpressionProcessor(object):
This method must be executed after do_queries().
"""
def f(mo):
field, mode, account_codes, domain = self._parse_mo(mo)
field, mode, account_codes, domain = self._parse_match_object(mo)
key = (domain, mode)
account_ids_data = self._data[key]
v = 0.0

View File

@ -137,5 +137,3 @@ class mis_builder_xls(report_xls):
mis_builder_xls('report.mis.report.instance.xls',
'mis.report.instance',
parser=mis_builder_xls_parser)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -10,4 +10,4 @@
.openerp .mis_builder a:hover {
/* underline links on hover to give a visual cue */
text-decoration: underline;
}
}

View File

@ -45,4 +45,4 @@ openerp.mis_builder = function(instance) {
});
instance.web.form.custom_widgets.add('mis_report', 'instance.mis_builder.MisReport');
}
}

View File

@ -55,4 +55,4 @@
</tfoot>
</table>
</t>
</template>
</template>

View File

@ -30,5 +30,3 @@ fast_suite = [
checks = [
test_mis_builder,
]
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -85,5 +85,3 @@ class add_mis_report_instance_dashboard(orm.TransientModel):
'arch': etree.tostring(new_arch, pretty_print=True)})
return {'type': 'ir.actions.act_window_close', }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: