Skip to content

Commit

Permalink
[IMP] fix close button with cash control can't be reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanjay Jamod committed Apr 26, 2017
1 parent 0245228 commit 67adfdd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
11 changes: 0 additions & 11 deletions addons/point_of_sale/models/pos_config.py
Expand Up @@ -253,17 +253,6 @@ def open_ui(self):
'target': 'self',
}

@api.multi
def open_existing_session_cb_close(self):
""" open session button
If the pos is configured in cash control, set in closing control state
"""
self.ensure_one()
if self.current_session_id.cash_control:
self.current_session_id.action_pos_session_closing_control()
return self.open_session_cb()

@api.multi
def open_session_cb(self):
""" new session button
Expand Down
4 changes: 1 addition & 3 deletions addons/point_of_sale/views/point_of_sale_dashboard.xml
Expand Up @@ -72,9 +72,7 @@

<button t-if="record.current_session_state.raw_value === 'opening_control'" class="btn btn-primary" name="open_existing_session_cb" type="object">Open Session</button>

<button t-if="record.current_session_state.raw_value === 'opened'" class="btn btn-default" name="open_existing_session_cb_close" type="object">Close</button>

<button t-if="record.current_session_state.raw_value === 'closing_control'" class="btn btn-default" name="open_existing_session_cb" type="object">Close</button>
<button t-if="_.contains(['opened', 'closing_control'], record.current_session_state.raw_value)" class="btn btn-default" name="open_existing_session_cb" type="object">Close</button>
<button t-if="!record.current_session_id.raw_value" class="btn btn-primary" name="open_session_cb" type="object">New Session</button>
</div>
<div class="col-xs-6 o_kanban_primary_right">
Expand Down

0 comments on commit 67adfdd

Please sign in to comment.