Browse Source

[IMP] Align with open invoice wizard: check date range, minor cleanup.

pull/367/head
os-kng 9 years ago
committed by Jordi Ballester
parent
commit
28674278cd
  1. 16
      account_financial_report_qweb/wizard/aged_partner_balance_wizard.py
  2. 2
      account_financial_report_qweb/wizard/open_invoice_wizard.py

16
account_financial_report_qweb/wizard/aged_partner_balance_wizard.py

@ -4,6 +4,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from datetime import datetime
from openerp.exceptions import Warning as UserError
from openerp import api, fields, models
@ -13,12 +14,11 @@ class AccountAgedTrialBalance(models.TransientModel):
_description = 'Aged partner balanced'
company_id = fields.Many2one(
comodel_name='res.company',
'res.company',
string='Company',
required=True
required=True,
default=lambda s: s.env.user.company_id
)
date_from = fields.Date('Date from')
date_to = fields.Date('Date to')
target_move = fields.Selection([('posted', 'All Posted Entries'),
('all', 'All Entries')],
string='Target Moves',
@ -53,6 +53,14 @@ class AccountAgedTrialBalance(models.TransientModel):
def onchange_atdate(self):
self.until_date = self.at_date
@api.onchange('until_date')
def onchange_untildate(self):
# ---- until_date must be always >= of at_date
if self.until_date:
if self.until_date < self.at_date:
raise UserError(
'Until Date must be equal or greater than At Date')
@api.multi
def check_report(self):
return True

2
account_financial_report_qweb/wizard/open_invoice_wizard.py

@ -56,7 +56,7 @@ class OpenInvoiceWizard(models.TransientModel):
if self.until_date:
if self.until_date < self.at_date:
raise UserError(
'Until Date must be equal or greater then At Date')
'Until Date must be equal or greater than At Date')
@api.multi
def print_report(self):

Loading…
Cancel
Save