Browse Source

pep8 & co

pull/189/head
Stéphane Bidoul 9 years ago
parent
commit
1b11a87655
  1. 2
      mis_builder/__init__.py
  2. 2
      mis_builder/__openerp__.py
  3. 2
      mis_builder/migrations/8.0.0.2/pre-migration.py
  4. 2
      mis_builder/models/__init__.py
  5. 2
      mis_builder/models/aep.py
  6. 2
      mis_builder/models/aggregate.py
  7. 10
      mis_builder/models/mis_builder.py
  8. 2
      mis_builder/report/__init__.py
  9. 10
      mis_builder/report/mis_builder_xlsx.py
  10. 2
      mis_builder/report/report_mis_report_instance.py
  11. 2
      mis_builder/tests/__init__.py
  12. 6
      mis_builder/tests/test_mis_builder.py
  13. 2
      mis_builder/wizard/__init__.py
  14. 6
      mis_builder/wizard/mis_builder_dashboard.py

2
mis_builder/__init__.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

2
mis_builder/__openerp__.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

2
mis_builder/migrations/8.0.0.2/pre-migration.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

2
mis_builder/models/__init__.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

2
mis_builder/models/aep.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

2
mis_builder/models/aggregate.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

10
mis_builder/models/mis_builder.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder
@ -31,7 +31,7 @@ import traceback
import pytz
from openerp import api, fields, models, _, exceptions
from openerp import api, exceptions, fields, models, _
from openerp.tools.safe_eval import safe_eval
from .aep import AccountingExpressionProcessor as AEP
@ -124,7 +124,8 @@ class MisReportKpi(models.Model):
@api.constrains('name')
def _check_name(self):
if not _is_valid_python_var(self.name):
raise exception.Warning(_('The name must be a valid python identifier'))
raise exceptions.Warning(_('The name must be a valid '
'python identifier'))
@api.onchange('name')
def _onchange_name(self):
@ -260,7 +261,8 @@ class MisReportQuery(models.Model):
@api.constrains('name')
def _check_name(self):
if not _is_valid_python_var(self.name):
raise exception.Warning(_('The name must be a valid python identifier'))
raise exceptions.Warning(_('The name must be a valid '
'python identifier'))
class MisReport(models.Model):

2
mis_builder/report/__init__.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

10
mis_builder/report/mis_builder_xlsx.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder
@ -27,11 +27,11 @@ import logging
_logger = logging.getLogger(__name__)
class mis_builder_xlsx(ReportXlsx):
class MisBuilderXslx(ReportXlsx):
def __init__(self, name, table, rml=False, parser=False, header=True,
store=False):
super(mis_builder_xlsx, self).__init__(
super(MisBuilderXslx, self).__init__(
name, table, rml, parser, header, store)
def generate_xlsx_report(self, workbook, data, objects):
@ -88,5 +88,5 @@ class mis_builder_xlsx(ReportXlsx):
row_pos += 1
mis_builder_xlsx('report.mis.report.instance.xlsx',
'mis.report.instance')
MisBuilderXslx('report.mis.report.instance.xlsx',
'mis.report.instance')

2
mis_builder/report/report_mis_report_instance.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

2
mis_builder/tests/__init__.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

6
mis_builder/tests/test_mis_builder.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder
@ -27,10 +27,10 @@ import openerp.tests.common as common
from ..models import mis_builder
class test_mis_builder(common.TransactionCase):
class TestMisBuilder(common.TransactionCase):
def setUp(self):
super(test_mis_builder, self).setUp()
super(TestMisBuilder, self).setUp()
def test_datetime_conversion(self):
date_to_convert = '2014-07-05'

2
mis_builder/wizard/__init__.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder

6
mis_builder/wizard/mis_builder_dashboard.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder
@ -26,7 +26,7 @@ from openerp.osv import orm, fields
from lxml import etree
class add_mis_report_instance_dashboard(orm.TransientModel):
class AddMisReportInstanceDashboard(orm.TransientModel):
_name = "add.mis.report.instance.dashboard.wizard"
_columns = {'name': fields.char('Name', size=32, required=True),
@ -40,7 +40,7 @@ class add_mis_report_instance_dashboard(orm.TransientModel):
if context is None:
context = {}
if context.get('active_id'):
res = super(add_mis_report_instance_dashboard, self).default_get(
res = super(AddMisReportInstanceDashboard, self).default_get(
cr, uid, fields, context=context)
# get report instance name
res['name'] = self.pool['mis.report.instance'].read(

Loading…
Cancel
Save