~scigghiateam/andreacometa-addons/6.0

« back to all changes in this revision

Viewing changes to force_sale_subscriptions/sale.py

  • Committer: Francesco Apruzzese
  • Date: 2013-02-14 10:46:00 UTC
  • Revision ID: cescoap@gmail.com-20130214104600-jbl1u0x6auzcn980
[FIX] data forza abbonamento

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
                        if not cron_ids:
39
39
                                raise osv.except_osv(_('Azione non valida!'), _('Nessun rinnovo abbonamento previsto per questo ordine!'))
40
40
                                return False
41
 
                        next_time = datetime.datetime.today() + datetime.timedelta(seconds=240)
 
41
                        next_time = datetime.datetime.today() + datetime.timedelta(seconds=300)
 
42
                        if '.' in next_time:
 
43
                                next_time = str(next_time).split('.')[0]
42
44
                        cron_obj.write(cr, uid, cron_ids, {'nextcall':next_time, 'numbercall':1, 'doall':True, 'interval_type':'minutes'})
43
45
                self.write(cr, uid, ids, {'subscription_end_date':next_time})
44
46
                return False
45
 
                
46
 
                                        
 
47
 
47
48
        def onchange_abbonamento(self, cr, uid, ids, data_inizio, product_id):
48
49
                res = {'value': {'subscription_start_date': data_inizio, 'subscription_end_date': False}}
49
50
                if not data_inizio and not product_id: