X-Git-Url: http://git.cyclocoop.org/?p=burette%2Fnrt_point_of_sale.git;a=blobdiff_plain;f=point_of_sale.py;fp=point_of_sale.py;h=71b2eb6676926eb2202b94826b4588bb96a53574;hp=70f7c3fcce9072b0a38a37606624d1641a7b1053;hb=805e36cb5fd89d7d74c50ddd6e2e66e46248e2b6;hpb=72fe25042c12a865510836739a83b7ab68c336c9 diff --git a/point_of_sale.py b/point_of_sale.py index 70f7c3f..71b2eb6 100644 --- a/point_of_sale.py +++ b/point_of_sale.py @@ -75,15 +75,12 @@ class pos_session(orm.Model): def wkf_action_closing_control(self, cr, uid, ids, context=None): """ - Disable default start_at date - Piece of this code was copied from - addons/point_of_sale/point_of_sale.py:397 + Put same stop_at date in pos_session as its start_at date """ + res = super(pos_session, self).wkf_action_closing_control(cr, uid, ids, context=context) for session in self.browse(cr, uid, ids, context=context): - for statement in session.statement_ids: - if (statement != session.cash_register_id) and (statement.balance_end != statement.balance_end_real): - self.pool.get('account.bank.statement').write(cr, uid, [statement.id], {'balance_end_real': statement.balance_end}) - return True + self.write(cr, uid, [session.id], {'stop_at': session.start_at}, context=context) + return res def onchange_start_at(self, cr, uid, ids, start_at, context=None): """Define same stop_at as start_at"""