From 6d9fdb643da514553dc0f370fbe4f7cf391d2a3b Mon Sep 17 00:00:00 2001 From: Valerian Dorcy Date: Thu, 4 Jul 2019 10:13:12 +0000 Subject: [PATCH] [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: 46d0b461cdf246fdd1b7922401a9f1859a4fe55d opw:1981984 closes odoo/odoo#34735 Signed-off-by: Simon Goffin (sig) --- addons/point_of_sale/models/pos_session.py | 2 +- doc/cla/individual/dorcyv.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 doc/cla/individual/dorcyv.md diff --git a/addons/point_of_sale/models/pos_session.py b/addons/point_of_sale/models/pos_session.py index b6eea3cf8a2..97233e9bbca 100644 --- a/addons/point_of_sale/models/pos_session.py +++ b/addons/point_of_sale/models/pos_session.py @@ -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) diff --git a/doc/cla/individual/dorcyv.md b/doc/cla/individual/dorcyv.md new file mode 100644 index 00000000000..d29652c3e72 --- /dev/null +++ b/doc/cla/individual/dorcyv.md @@ -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