return {
}
+
+ def wkf_action_close(self, cr, uid, ids, context=None):
+ # Check that a register is not closed with a zero balance if it started with a positive balance
+ for record in self.browse(cr, uid, ids, context=context):
+ for st in record.statement_ids:
+
+ if st.balance_start>0 and not st.balance_end_real:
+ # The pos manager can close sessions with 0 for the end balance.
+ if not self.pool.get('ir.model.access').check_groups(cr, uid, "point_of_sale.group_pos_manager"):
+ raise osv.except_osv( _('Please check your ending balance!'),
+ _("Your ending balance is zero, don't forget to enter it before closing the session! Leave around 20-30 EUR in the register."))
+ return super(pos_session, self).wkf_action_close(cr, uid, ids, context)
+
pos_session()