[FIX] fix according to code review

This commit is contained in:
Damien Crier
2015-08-07 15:27:27 +02:00
parent 14f52d5173
commit f559a5f410
7 changed files with 19 additions and 28 deletions

View File

@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2012 Camptocamp SA (Guewen Baconnier)
# Copyright 2012, 2015 Camptocamp SA (Guewen Baconnier, Damien Crier)
# Copyright (C) 2010 Sébastien Beau
# Copyright 2015 Camptocamp SA (Damien Crier)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as

View File

@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2012 Camptocamp SA (Guewen Baconnier)
# Copyright 2012, 2015 Camptocamp SA (Guewen Baconnier, Damien Crier)
# Copyright (C) 2010 Sébastien Beau
# Copyright 2015 Camptocamp SA (Damien Crier)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as

View File

@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2012-2013 Camptocamp SA (Guewen Baconnier)
# Copyright 2012-2013, 2015 Camptocamp SA (Guewen Baconnier, Damien Crier)
# Copyright (C) 2010 Sébastien Beau
# Copyright 2015 Camptocamp SA (Damien Crier)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as

View File

@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2012-2013 Camptocamp SA (Guewen Baconnier)
# Copyright 2012-2013, 2015 Camptocamp SA (Guewen Baconnier, Damien Crier)
# Copyright (C) 2010 Sébastien Beau
# Copyright 2015 Camptocamp SA (Damien Crier)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -25,8 +24,6 @@ from openerp import models, api, fields, _
from openerp.exceptions import Warning
from openerp import sql_db
# from openerp import pooler
import logging
_logger = logging.getLogger(__name__)
@@ -177,7 +174,7 @@ class AccountEasyReconcile(models.Model):
readonly=True
)
last_history = fields.Many2one('easy.reconcile.history',
string='readonly=True',
string='Last history', readonly=True,
compute='_last_history',
)
company_id = fields.Many2one('res.company', string='Company')
@@ -253,7 +250,7 @@ class AccountEasyReconcile(models.Model):
self.env['easy.reconcile.history'].create(
{
'easy_reconcile_id': rec.id,
'date': fields.datetime.now(),
'date': fields.Datetime.now(),
'reconcile_ids': [
(4, rid) for rid in reconcile_ids
],
@@ -269,7 +266,7 @@ class AccountEasyReconcile(models.Model):
"The reconcile task %s had an exception: %s",
rec.name, e.message
)
message = "There was an error during reconciliation : %s" \
message = _("There was an error during reconciliation : %s") \
% e.message
rec.message_post(body=message)
self.env['easy.reconcile.history'].create(
@@ -287,8 +284,7 @@ class AccountEasyReconcile(models.Model):
return True
# @api.model
# def _no_history(self, rec):
@api.multi
def _no_history(self):
""" Raise an `orm.except_orm` error, supposed to
be called when there is no history on the reconciliation
@@ -327,7 +323,8 @@ class AccountEasyReconcile(models.Model):
@api.multi
def open_partial_reconcile(self):
""" Open the view of move line with the unreconciled move lines"""
""" Open the view of move line with the partially
reconciled move lines"""
self.ensure_one()
obj_move_line = self.env['account.move.line']
lines = obj_move_line.search(

View File

@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2012 Camptocamp SA
# Copyright 2015 Camptocamp SA (Damien Crier)
# Author: Guewen Baconnier, Damien Crier
# Copyright 2012, 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -33,7 +32,7 @@ class EasyReconcileHistory(models.Model):
@api.one
@api.depends('reconcile_ids', 'reconcile_partial_ids')
def _reconcile_line_ids(self):
def _get_reconcile_line_ids(self):
move_line_ids = []
for reconcile in self.reconcile_ids:
move_lines = reconcile.mapped('line_id')
@@ -68,13 +67,13 @@ class EasyReconcileHistory(models.Model):
comodel_name='account.move.line',
relation='account_move_line_history_rel',
string='Reconciled Items',
_compute='_reconcile_line_ids'
compute='_get_reconcile_line_ids'
)
partial_line_ids = fields.Many2many(
comodel_name='account.move.line',
relation='account_move_line_history_partial_rel',
string='Partially Reconciled Items',
_compute='_reconcile_line_ids'
compute='_get_reconcile_line_ids'
)
company_id = fields.Many2one(
'res.company',

View File

@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Leonardo Pistone
# Copyright 2014 Camptocamp SA
# Copyright 2015 Camptocamp SA (Damien Crier)
# Author: Leonardo Pistone, Damien Crier
# Copyright 2014, 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -30,7 +29,7 @@ class AccountConfigSettings(models.TransientModel):
related="company_id.reconciliation_commit_every",
string="How often to commit when performing automatic "
"reconciliation.",
help="""Leave zero to commit only at the end of the process."""
help="Leave zero to commit only at the end of the process."
)
@api.multi

View File

@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2012-2013 Camptocamp SA (Guewen Baconnier)
# Copyright 2012-2013, 2015 Camptocamp SA (Guewen Baconnier, Damien Crier)
# Copyright (C) 2010 Sébastien Beau
# Copyright 2015 Camptocamp SA (Damien Crier)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as