diff --git a/account_interests/models/res_company_interest.py b/account_interests/models/res_company_interest.py index 6a22a0c93..c5302d9d5 100644 --- a/account_interests/models/res_company_interest.py +++ b/account_interests/models/res_company_interest.py @@ -120,6 +120,15 @@ def create_interest_invoices(self): # seteamos proxima corrida en hoy mas un periodo rec.next_date = interests_date + next_delta + def _get_move_line_domains(self, to_date): + self.ensure_one() + move_line_domain = [ + ('account_id', 'in', self.receivable_account_ids.ids), + ('full_reconcile_id', '=', False), + ('date_maturity', '<', to_date) + ] + return move_line_domain + def create_invoices(self, to_date, groupby='partner_id'): self.ensure_one() @@ -127,11 +136,7 @@ def create_invoices(self, to_date, groupby='partner_id'): ('type', '=', 'sale'), ('company_id', '=', self.company_id.id)], limit=1) - move_line_domain = [ - ('account_id', 'in', self.receivable_account_ids.ids), - ('full_reconcile_id', '=', False), - ('date_maturity', '<', to_date) - ] + move_line_domain = self._get_move_line_domains(to_date) # Check if a filter is set if self.domain: