[IMP] account_mass_reconcile: black, isort, prettier
parent
1051a91b35
commit
7318bddc2b
|
@ -137,7 +137,7 @@ class MassReconcileAdvanced(models.AbstractModel):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _compare_matcher_values(cls, key, values, opposite_values):
|
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
|
and return True if it matches
|
||||||
"""
|
"""
|
||||||
for value, ovalue in product(values, opposite_values):
|
for value, ovalue in product(values, opposite_values):
|
||||||
|
@ -165,7 +165,7 @@ class MassReconcileAdvanced(models.AbstractModel):
|
||||||
return MassReconcileAdvanced._compare_matcher_values(mkey, mvalue, omvalue)
|
return MassReconcileAdvanced._compare_matcher_values(mkey, mvalue, omvalue)
|
||||||
|
|
||||||
def _compare_opposite(self, move_line, opposite_move_line, matchers):
|
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.
|
and if they all match, return True.
|
||||||
|
|
||||||
If all the matchers match for a move line and an opposite move line,
|
If all the matchers match for a move line and an opposite move line,
|
||||||
|
|
|
@ -23,7 +23,7 @@ class MassReconcileBase(models.AbstractModel):
|
||||||
# other fields are inherited from mass.reconcile.options
|
# other fields are inherited from mass.reconcile.options
|
||||||
|
|
||||||
def automatic_reconcile(self):
|
def automatic_reconcile(self):
|
||||||
""" Reconciliation method called from the view.
|
"""Reconciliation method called from the view.
|
||||||
|
|
||||||
:return: list of reconciled ids
|
:return: list of reconciled ids
|
||||||
"""
|
"""
|
||||||
|
@ -31,7 +31,7 @@ class MassReconcileBase(models.AbstractModel):
|
||||||
return self._action_rec()
|
return self._action_rec()
|
||||||
|
|
||||||
def _action_rec(self):
|
def _action_rec(self):
|
||||||
""" Must be inherited to implement the reconciliation
|
"""Must be inherited to implement the reconciliation
|
||||||
|
|
||||||
:return: list of reconciled ids
|
:return: list of reconciled ids
|
||||||
"""
|
"""
|
||||||
|
@ -39,7 +39,7 @@ class MassReconcileBase(models.AbstractModel):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _base_columns():
|
def _base_columns():
|
||||||
""" Mandatory columns for move lines queries
|
"""Mandatory columns for move lines queries
|
||||||
An extra column aliased as ``key`` should be defined
|
An extra column aliased as ``key`` should be defined
|
||||||
in each query."""
|
in each query."""
|
||||||
aml_cols = (
|
aml_cols = (
|
||||||
|
@ -129,7 +129,7 @@ class MassReconcileBase(models.AbstractModel):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _reconcile_lines(self, lines, allow_partial=False):
|
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
|
:param list lines: list of dict of move lines, they must at least
|
||||||
contain values for : id, debit, credit
|
contain values for : id, debit, credit
|
||||||
|
|
|
@ -213,7 +213,7 @@ class AccountMassReconcile(models.Model):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _no_history(self):
|
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
|
be called when there is no history on the reconciliation
|
||||||
task.
|
task.
|
||||||
"""
|
"""
|
||||||
|
@ -246,7 +246,7 @@ class AccountMassReconcile(models.Model):
|
||||||
return self._open_move_line_list(lines.ids or [], name)
|
return self._open_move_line_list(lines.ids or [], name)
|
||||||
|
|
||||||
def last_history_reconcile(self):
|
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
|
and return the action which opens move lines reconciled
|
||||||
"""
|
"""
|
||||||
if not self.last_history:
|
if not self.last_history:
|
||||||
|
@ -255,7 +255,7 @@ class AccountMassReconcile(models.Model):
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def run_scheduler(self, run_all=None):
|
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
|
This function is mostly here to be used with cron task
|
||||||
|
|
||||||
:param run_all: if set it will ingore lookup and launch
|
:param run_all: if set it will ingore lookup and launch
|
||||||
|
|
|
@ -5,7 +5,7 @@ from odoo import _, api, fields, models
|
||||||
|
|
||||||
|
|
||||||
class MassReconcileHistory(models.Model):
|
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
|
Each history stores the list of reconciliations done
|
||||||
"""
|
"""
|
||||||
|
@ -45,7 +45,7 @@ class MassReconcileHistory(models.Model):
|
||||||
)
|
)
|
||||||
|
|
||||||
def _open_move_lines(self):
|
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
|
the reconciled move lines
|
||||||
|
|
||||||
:param history_id: id of the history
|
:param history_id: id of the history
|
||||||
|
@ -66,7 +66,7 @@ class MassReconcileHistory(models.Model):
|
||||||
}
|
}
|
||||||
|
|
||||||
def open_reconcile(self):
|
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
|
with the reconciled move lines
|
||||||
|
|
||||||
:param history_ids: id of the record as int or long
|
:param history_ids: id of the record as int or long
|
||||||
|
|
Loading…
Reference in New Issue