~unifield-team/unifield-wm/us-671-homere

« back to all changes in this revision

Viewing changes to analytic_distribution/account_invoice_refund.py

  • Committer: jf
  • Date: 2015-07-30 12:32:15 UTC
  • mfrom: (2542.10.9 unifield-wm)
  • Revision ID: jfb@tempo-consulting.fr-20150730123215-shhjwx7p7iiw6qxb
US-192 [IMP] Accounting documents: check posting date and document date are in the same FY

lp:~unifield-team/unifield-wm/us-192

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
        Permits to adapt refund creation
105
105
        """
106
106
        if form.get('document_date', False):
107
 
            if date < form['document_date']:
108
 
                raise osv.except_osv(_('Error'), _('Posting date should be later than Document Date.'))
 
107
            self.pool.get('finance.tools').check_document_date(cr, uid,
 
108
                form['document_date'], date)
109
109
            return self.pool.get('account.invoice').refund(cr, uid, inv_ids, date, period, description, journal_id, form['document_date'])
110
110
        else:
111
111
            return self.pool.get('account.invoice').refund(cr, uid, inv_ids, date, period, description, journal_id)
115
115
        Permits to adapt invoice creation
116
116
        """
117
117
        if form.get('document_date', False) and form.get('date', False):
118
 
            if form['date'] < form['document_date']:
119
 
                raise osv.except_osv(_('Error'), _('Posting date should be later than Document Date.'))
 
118
            self.pool.get('finance.tools').check_document_date(cr, uid,
 
119
                form['document_date'], form['date'])
120
120
            data.update({'document_date': form['document_date']})
121
121
        return super(account_invoice_refund, self)._hook_create_invoice(cr, uid, data, form)
122
122