Skip to content

Commit

Permalink
[REF] account_interests: make module more inheritable
Browse files Browse the repository at this point in the history
X-original-commit: ed33d24
  • Loading branch information
zaoral committed Oct 12, 2022
1 parent 32dc907 commit 5e33632
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions account_interests/models/res_company_interest.py
Expand Up @@ -120,18 +120,23 @@ 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()

journal = self.env['account.journal'].search([
('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:
Expand Down

0 comments on commit 5e33632

Please sign in to comment.