~franciscolercari/openerp-venezuela-localization/7.0-Question-241744

« back to all changes in this revision

Viewing changes to l10n_ve_withholding_iva/model/wh_iva.py

  • Committer: Humberto Arocha
  • Date: 2013-12-17 16:40:51 UTC
  • Revision ID: humbertoarocha@gmail.com-20131217164051-b857qa04sbf6aqor

[FIX][l10n_ve_withholding_iva] Fixing Default Fortnight

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
        else:
237
237
            return False
238
238
 
 
239
    def _get_fortnight(self, cr, uid, context=None):
 
240
        """ Return currency to use
 
241
        """
 
242
        context = context or {}
 
243
        dt = time.strftime('%Y-%m-%d')
 
244
        return time.strptime(dt, '%Y-%m-%d').tm_mday <= 15 and 'False' or 'True'
 
245
 
239
246
    def _get_currency(self, cr, uid, context):
240
247
        """ Return currency to use
241
248
        """
287
294
        'company_id': lambda self, cr, uid, context: \
288
295
                self.pool.get('res.users').browse(cr, uid, uid,
289
296
                    context=context).company_id.id,
290
 
        "fortnight": 'False',
 
297
        "fortnight": _get_fortnight,
291
298
    }
292
299
 
293
300
    def action_cancel(self, cr, uid, ids, context=None):