~vauxoo/openerp-mexico-localization/l10n_mx_chart_of_accounts_v7_dev_negrin

« back to all changes in this revision

Viewing changes to l10n_mx_facturae/wizard/wizard_invoice_facturae_txt.py

  • Committer: moylop260
  • Date: 2012-09-25 17:58:19 UTC
  • Revision ID: moylop260@vauxoo.com-20120925175819-ft17uqu44ed0d9dy
[FIX][10n_mx_facturae][wizard_invoice_facturae_txt] Add filter invoice_cancel & internal_number <> False

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
            ( 'state', 'in', ['open', 'paid', 'cancel'] ),
132
132
            ( 'date_invoice', '>=', date_start.strftime("%Y-%m-%d %H:%M:%S") ),
133
133
            ( 'date_invoice', '<', date_end.strftime("%Y-%m-%d %H:%M:%S") ),
134
 
            #( 'number', '<>', False )
 
134
            ( 'number', '<>', False ),
135
135
            ], order='date_invoice', context=context)
136
136
    )
137
137
    
141
141
            ( 'state', 'in', ['cancel'] ),
142
142
            ( 'date_invoice_cancel', '>=', date_start.strftime("%Y-%m-%d %H:%M:%S") ),
143
143
            ( 'date_invoice_cancel', '<', date_end.strftime("%Y-%m-%d %H:%M:%S") ),
144
 
            #( 'number', '<>', False )
 
144
            ( 'number', '<>', False ),
145
145
            ], order='date_invoice', context=context)
146
146
    )
147
147
    invoice_ids = list(set(invoice_ids))
167
167
            ( 'state', 'in', ['open', 'paid', 'cancel'] ),
168
168
            ( 'date_invoice', '>=', date_start ),
169
169
            ( 'date_invoice', '<', date_end ),
170
 
            ( 'number', '<>', False )
171
 
        ], order='date_invoice', context=context)
172
 
    )
173
 
    
 
170
            ( 'internal_number', '<>', False ),
 
171
        ], order='date_invoice', context=context)
 
172
    )
 
173
    invoice_ids.extend(
 
174
        invoice_obj.search(cr, uid, [
 
175
            ( 'type', 'in', ['out_invoice', 'out_refund'] ),
 
176
            ( 'state', 'in', ['cancel'] ),
 
177
            ( 'date_invoice_cancel', '>=', date_start ),
 
178
            ( 'date_invoice_cancel', '<', date_end ),
 
179
            ( 'internal_number', '<>', False ),
 
180
        ], order='date_invoice', context=context)
 
181
    )
174
182
    return {'invoice_ids': invoice_ids}
175
183
 
176
184