From 3fb8eb7d9e93dd145601901ebec932e614c9bd8f Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Fri, 5 Mar 2021 11:10:23 +0100 Subject: [PATCH] [IMP] account_mass_reconcile: black, isort, prettier --- .../models/base_advanced_reconciliation.py | 4 ++-- account_mass_reconcile/models/base_reconciliation.py | 8 ++++---- account_mass_reconcile/models/mass_reconcile.py | 6 +++--- account_mass_reconcile/models/mass_reconcile_history.py | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/account_mass_reconcile/models/base_advanced_reconciliation.py b/account_mass_reconcile/models/base_advanced_reconciliation.py index 3e036fae..2d8064e7 100644 --- a/account_mass_reconcile/models/base_advanced_reconciliation.py +++ b/account_mass_reconcile/models/base_advanced_reconciliation.py @@ -137,7 +137,7 @@ class MassReconcileAdvanced(models.AbstractModel): @classmethod def _compare_matcher_values(cls, key, values, opposite_values): - """ Compare every values from a matcher vs an opposite matcher + """Compare every values from a matcher vs an opposite matcher and return True if it matches """ for value, ovalue in product(values, opposite_values): @@ -165,7 +165,7 @@ class MassReconcileAdvanced(models.AbstractModel): return MassReconcileAdvanced._compare_matcher_values(mkey, mvalue, omvalue) def _compare_opposite(self, move_line, opposite_move_line, matchers): - """ Iterate over the matchers of the move lines vs opposite move lines + """Iterate over the matchers of the move lines vs opposite move lines and if they all match, return True. If all the matchers match for a move line and an opposite move line, diff --git a/account_mass_reconcile/models/base_reconciliation.py b/account_mass_reconcile/models/base_reconciliation.py index 909c84e6..9c90017f 100644 --- a/account_mass_reconcile/models/base_reconciliation.py +++ b/account_mass_reconcile/models/base_reconciliation.py @@ -23,7 +23,7 @@ class MassReconcileBase(models.AbstractModel): # other fields are inherited from mass.reconcile.options def automatic_reconcile(self): - """ Reconciliation method called from the view. + """Reconciliation method called from the view. :return: list of reconciled ids """ @@ -31,7 +31,7 @@ class MassReconcileBase(models.AbstractModel): return self._action_rec() def _action_rec(self): - """ Must be inherited to implement the reconciliation + """Must be inherited to implement the reconciliation :return: list of reconciled ids """ @@ -39,7 +39,7 @@ class MassReconcileBase(models.AbstractModel): @staticmethod def _base_columns(): - """ Mandatory columns for move lines queries + """Mandatory columns for move lines queries An extra column aliased as ``key`` should be defined in each query.""" aml_cols = ( @@ -129,7 +129,7 @@ class MassReconcileBase(models.AbstractModel): return None def _reconcile_lines(self, lines, allow_partial=False): - """ Try to reconcile given lines + """Try to reconcile given lines :param list lines: list of dict of move lines, they must at least contain values for : id, debit, credit diff --git a/account_mass_reconcile/models/mass_reconcile.py b/account_mass_reconcile/models/mass_reconcile.py index 5e9673f1..a5ec4606 100644 --- a/account_mass_reconcile/models/mass_reconcile.py +++ b/account_mass_reconcile/models/mass_reconcile.py @@ -213,7 +213,7 @@ class AccountMassReconcile(models.Model): return True def _no_history(self): - """ Raise an `orm.except_orm` error, supposed to + """Raise an `orm.except_orm` error, supposed to be called when there is no history on the reconciliation task. """ @@ -246,7 +246,7 @@ class AccountMassReconcile(models.Model): return self._open_move_line_list(lines.ids or [], name) def last_history_reconcile(self): - """ Get the last history record for this reconciliation profile + """Get the last history record for this reconciliation profile and return the action which opens move lines reconciled """ if not self.last_history: @@ -255,7 +255,7 @@ class AccountMassReconcile(models.Model): @api.model def run_scheduler(self, run_all=None): - """ Launch the reconcile with the oldest run + """Launch the reconcile with the oldest run This function is mostly here to be used with cron task :param run_all: if set it will ingore lookup and launch diff --git a/account_mass_reconcile/models/mass_reconcile_history.py b/account_mass_reconcile/models/mass_reconcile_history.py index 11ef62c1..4d17a920 100644 --- a/account_mass_reconcile/models/mass_reconcile_history.py +++ b/account_mass_reconcile/models/mass_reconcile_history.py @@ -5,7 +5,7 @@ from odoo import _, api, fields, models class MassReconcileHistory(models.Model): - """ Store an history of the runs per profile + """Store an history of the runs per profile Each history stores the list of reconciliations done """ @@ -45,7 +45,7 @@ class MassReconcileHistory(models.Model): ) def _open_move_lines(self): - """ For an history record, open the view of move line with + """For an history record, open the view of move line with the reconciled move lines :param history_id: id of the history @@ -66,7 +66,7 @@ class MassReconcileHistory(models.Model): } def open_reconcile(self): - """ For an history record, open the view of move line + """For an history record, open the view of move line with the reconciled move lines :param history_ids: id of the record as int or long