Browse Source

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

pull/196/head
os-kng 9 years ago
committed by Leonardo Pistone
parent
commit
bc0dee3908
  1. 20
      account_financial_report_qweb/wizard/aged_partner_balance_wizard.py
  2. 2
      account_financial_report_qweb/wizard/open_invoice_wizard.py

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

Loading…
Cancel
Save