diff --git a/project_sla/__openerp__.py b/project_sla/__openerp__.py index df8afb89..95664164 100644 --- a/project_sla/__openerp__.py +++ b/project_sla/__openerp__.py @@ -38,7 +38,7 @@ SLA Controlled Documents ======================== Only Project Issue documents are made SLA controllable. -However, a framework is made available to easilly build extensions to make +However, a framework is made available to easily build extensions to make other documents models SLA controlled. SLA controlled documents have attached information on the list of SLA rules diff --git a/project_sla/analytic_account.py b/project_sla/analytic_account.py index eaf64ce2..fcfbb13f 100644 --- a/project_sla/analytic_account.py +++ b/project_sla/analytic_account.py @@ -19,8 +19,6 @@ ############################################################################## from openerp.osv import fields, orm -import logging -_logger = logging.getLogger(__name__) class AnalyticAccount(orm.Model): diff --git a/project_sla/m2m.py b/project_sla/m2m.py index c3914c79..39fe1e2c 100644 --- a/project_sla/m2m.py +++ b/project_sla/m2m.py @@ -55,7 +55,7 @@ def link(id): def clear(): """ Unlink all referenced records (doesn't delete them) """ - return [(5)] + return [(5, 0)] def replace(ids): @@ -70,6 +70,6 @@ if __name__ == "__main__": assert write(99, {'name': 'Monty'}) == [(1, 99, {'name': 'Monty'})] assert remove(99) == [(2, 99)] assert unlink(99) == [(3, 99)] - assert clear() == [(5)] + assert clear() == [(5, 0)] assert replace([97, 98, 99]) == [(6, 0, [97, 98, 99])] print("Done!") diff --git a/project_sla/project_issue_view.xml b/project_sla/project_issue_view.xml index f4019548..eba74066 100644 --- a/project_sla/project_issue_view.xml +++ b/project_sla/project_issue_view.xml @@ -29,7 +29,7 @@ - project_issue_tree_view_slak + project_issue_tree_view_sla project.issue @@ -56,30 +56,5 @@ - - diff --git a/project_sla/project_sla.py b/project_sla/project_sla.py index 56696873..78978bb3 100644 --- a/project_sla/project_sla.py +++ b/project_sla/project_sla.py @@ -26,6 +26,7 @@ class SLADefinition(orm.Model): SLA Definition """ _name = 'project.sla' + _description = 'SLA Definition' _columns = { 'name': fields.char('Title', size=64, required=True, translate=True), 'active': fields.boolean('Active'), @@ -38,7 +39,7 @@ class SLADefinition(orm.Model): 'sla_line_ids': fields.one2many( 'project.sla.line', 'sla_id', 'Definitions'), 'analytic_ids': fields.many2many( - 'account.analytic.account', string='Contracts'), + 'account.analytic.account', string='Contracts'), } _defaults = { 'active': True, @@ -67,6 +68,7 @@ class SLARules(orm.Model): SLA Definition Rule Lines """ _name = 'project.sla.line' + _definition = 'SLA Definition Rule Lines' _order = 'sla_id,sequence' _columns = { 'sla_id': fields.many2one('project.sla', 'SLA Definition'), diff --git a/project_sla/project_sla_control.py b/project_sla/project_sla_control.py index f924bd09..d807a36b 100644 --- a/project_sla/project_sla_control.py +++ b/project_sla/project_sla_control.py @@ -109,7 +109,7 @@ class SLAControl(orm.Model): - exceeded warning dates are set to "warning" To be used by a scheduled job. """ - now = dt.strftime(dt.now(), DT_FMT) + now = dt.now().strftime(DT_FMT) # SLAs to mark as "will fail" control_ids = self.search( cr, uid, @@ -146,7 +146,7 @@ class SLAControl(orm.Model): assert isinstance(hours, int) and hours >= 0 cal_obj = self.pool.get('resource.calendar') - target, step = hours * 3600, 16 * 3600 + target, step = hours * 3600, 16 * 3600 lo, hi = start_date, start_date while target > 0 and step > 60: hi = lo + timedelta(seconds=step) @@ -237,7 +237,7 @@ class SLAControl(orm.Model): break if sla_ids and not res: - _logger.warning("No valid SLA rule foun for %d, SLA Ids %s" + _logger.warning("No valid SLA rule found for %d, SLA Ids %s" % (doc.id, repr([x.id for x in sla_ids]))) return res diff --git a/project_sla/project_view.xml b/project_sla/project_view.xml index 5aee47a7..bc40c9d4 100644 --- a/project_sla/project_view.xml +++ b/project_sla/project_view.xml @@ -3,7 +3,7 @@ - edit_projec_sla + edit_project_sla project.project