[FIX] point_of_sale: Closing a cash control session

Before the fix:
When creating a new session with Cash control POS then it was impossible to close the session.

After the fix:
The same flow as in 9.0 when closing a session

opw:691517
This commit is contained in:
Goffin Simon
2016-11-03 15:04:22 +01:00
parent b2eb54abe5
commit 1d2ca93213
2 changed files with 5 additions and 1 deletions
@@ -230,6 +230,10 @@ class PosSession(models.Model):
if not session.config_id.cash_control:
session.action_pos_session_close()
@api.multi
def action_pos_session_validate(self):
self.action_pos_session_close()
@api.multi
def action_pos_session_close(self):
# Close CashBox
@@ -23,7 +23,7 @@
<button name="action_pos_session_closing_control" type="object" string="Validate Closing &amp; Post Entries"
attrs="{'invisible' : ['|', ('cash_control', '=', True),('state', '!=', 'opened')]}"
class="oe_highlight"/>
<button name="action_pos_session_closing_control" type="object" string="Validate Closing &amp; Post Entries" states="closing_control"
<button name="action_pos_session_validate" type="object" string="Validate Closing &amp; Post Entries" states="closing_control"
class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="opening_control,opened,closing_control,closed" nolabel="1" />