[FIX] point_of_sale: Fix initial balance for bank type

The balance start should only be set with the ending balance of the
previous session when journal type  is 'cash'. When the journal type
is 'bank', it must be 0.

Fine tuning of this commit: 46d0b461cd

opw:1981984

closes odoo/odoo#34735

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
Valerian Dorcy
2019-07-10 09:45:15 +00:00
committed by Goffin Simon
parent 0eee7c68ff
commit 6d9fdb643d
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -209,7 +209,7 @@ class PosSession(models.Model):
'journal_id': journal.id,
'user_id': self.env.user.id,
'name': pos_name,
'balance_start': self.env["account.bank.statement"]._get_opening_balance(journal.id)
'balance_start': self.env["account.bank.statement"]._get_opening_balance(journal.id) if journal.type == 'cash' else 0
}
statements.append(ABS.with_context(ctx).sudo(uid).create(st_values).id)
+11
View File
@@ -0,0 +1,11 @@
France, 2019-07-04
I hereby agree to the terms of the Odoo Individual Contributor License
Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this
declaration.
Signed,
Valérian Dorcy valerian.dorcy@gmail.com https://github.com/dorcyv