summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerian Dorcy <valerian.dorcy@gmail.com>2019-07-04 10:13:12 +0000
committerGoffin Simon <sig@odoo.com>2019-07-10 09:45:15 +0000
commit6d9fdb643da514553dc0f370fbe4f7cf391d2a3b (patch)
treedd24b3f4732f0d281e9c73047383d4d3b2be4184
parent0eee7c68ff427a1c27cc265d56423d65b7e14c0f (diff)
[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) <sig@openerp.com>
-rw-r--r--addons/point_of_sale/models/pos_session.py2
-rw-r--r--doc/cla/individual/dorcyv.md11
2 files changed, 12 insertions, 1 deletions
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