|
|
@ -29,6 +29,8 @@ class AgedPartnerBalanceWizard(models.TransientModel): |
|
|
|
account_ids = fields.Many2many( |
|
|
|
comodel_name='account.account', |
|
|
|
string='Filter accounts', |
|
|
|
domain=[('reconcile', '=', True)], |
|
|
|
required=True, |
|
|
|
) |
|
|
|
receivable_accounts_only = fields.Boolean() |
|
|
|
payable_accounts_only = fields.Boolean() |
|
|
@ -61,6 +63,10 @@ class AgedPartnerBalanceWizard(models.TransientModel): |
|
|
|
res['domain']['partner_ids'] += self._get_partner_ids_domain() |
|
|
|
return res |
|
|
|
|
|
|
|
@api.onchange('account_ids') |
|
|
|
def onchange_account_ids(self): |
|
|
|
return {'domain': {'account_ids': [('reconcile', '=', True)]}} |
|
|
|
|
|
|
|
@api.onchange('receivable_accounts_only', 'payable_accounts_only') |
|
|
|
def onchange_type_accounts_only(self): |
|
|
|
"""Handle receivable/payable accounts only change.""" |
|
|
@ -72,9 +78,9 @@ class AgedPartnerBalanceWizard(models.TransientModel): |
|
|
|
domain += [('internal_type', '=', 'receivable')] |
|
|
|
elif self.payable_accounts_only: |
|
|
|
domain += [('internal_type', '=', 'payable')] |
|
|
|
elif not self.receivable_accounts_only and not self.payable_accounts_only: |
|
|
|
domain += [('reconcile', '=', True)] |
|
|
|
self.account_ids = self.env['account.account'].search(domain) |
|
|
|
else: |
|
|
|
self.account_ids = None |
|
|
|
|
|
|
|
@api.multi |
|
|
|
def _print_report(self, report_type): |
|
|
|