[FIX] account: one day period should not be used while generating invoice, one day...
authorRifakat <rha@tinyerp.com>
Wed, 20 Jun 2012 09:54:35 +0000 (15:24 +0530)
committerRifakat <rha@tinyerp.com>
Wed, 20 Jun 2012 09:54:35 +0000 (15:24 +0530)
bzr revid: rha@tinyerp.com-20120620095435-ws0dr4g3cz5l4r23

addons/account/account.py

index c165a7f..b7c76ac 100644 (file)
@@ -1050,6 +1050,9 @@ class account_period(osv.osv):
         ids = self.search(cr, uid, args, context=context)
         if not ids:
             raise osv.except_osv(_('Error !'), _('No period defined for this date: %s !\nPlease create one.')%dt)
+        for period in self.browse(cr, uid, ids, context=context):
+            if period.date_start == period.date_stop:
+                ids.remove(period.id)
         return ids
 
     def action_draft(self, cr, uid, ids, *args):