[PYTHON][VIEW] +nrt is optionnal for each pos
[burette/nrt_point_of_sale.git] / account_cash_statement.py
index c4155e3..1b2faec 100644 (file)
@@ -35,11 +35,11 @@ class account_cash_statement(orm.Model):
         """
         Put same closing date for account_bank_statement as pos session start_at date.
         """
-        self.pool.get('pos.session')
         res = super(account_cash_statement, self).button_confirm_cash(cr, uid, ids, context=context)
         for statement in self.browse(cr, uid, ids, context=context):
             if statement.pos_session_id:
-                return self.write(cr, uid, [statement.id], {'closing_date': statement.pos_session_id.start_at}, context=context)
+                if statement.pos_session_id.config_id.nrt:
+                    return self.write(cr, uid, [statement.id], {'closing_date': statement.pos_session_id.start_at}, context=context)
         return res
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: