Skip to content

Commit 50151cc

Browse files
committed
precommit + readme
1 parent 51e2195 commit 50151cc

File tree

9 files changed

+94
-40
lines changed

9 files changed

+94
-40
lines changed

pos_cash_move_reason/README.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ POS cash in-out reason
3333
|badge1| |badge2| |badge3| |badge4| |badge5|
3434

3535
This module allow to define some reasons for the functionality of
36-
"Put Money In" and "Take Money Out" available in point of sale session.
36+
"Cash In / Out" available in point of sale session.
3737

3838
So, with this module it's possible to impact directly an expense or income
3939
account which is defined on the related reasons and create according
@@ -77,6 +77,8 @@ to enable the feature.
7777
Usage
7878
=====
7979

80+
**In backoffice**
81+
8082
* Go to your current session
8183

8284
* Click on the button "Put Money In" or "Take Money Out"
@@ -88,12 +90,24 @@ Usage
8890

8991
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_cash_move_reason/static/description/wizard_pos_move_reason_form.png
9092

91-
* When closing the session, an account move will be created, with two lines,
93+
* An account move will be created, with two lines,
9294
one with the default journal account, and one with the expense / income
9395
reason account.
9496

9597
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_cash_move_reason/static/description/account_move_form.png
9698

99+
**In POS UI**
100+
101+
* Click on Cash In / Out
102+
103+
* Choose Cash In or Cash Out then write the amount
104+
105+
* Choose a Reason
106+
107+
* If it has a Journal, choose Journal and confirm
108+
109+
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_cash_move_reason/static/description/pos_cash_move_ui.png
110+
97111
Known issues / Roadmap
98112
======================
99113

@@ -105,6 +119,10 @@ hide native obsolete actions available on the model ``pos.session``
105119
Changelog
106120
=========
107121

122+
16.0.2.0.0 (2025-07-27)
123+
~~~~~~~~~~~~~~~~~~~~~~~
124+
* [IMP] This module works directly on POS UI
125+
108126
16.0.1.0.0 (2025-07-27)
109127
~~~~~~~~~~~~~~~~~~~~~~~
110128
* [MIG] Port module to version 16.0.

pos_cash_move_reason/models/pos_session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
44

5-
from odoo import fields, models
5+
from odoo import _, fields, models
6+
from odoo.exceptions import UserError
67

78

89
class PosSession(models.Model):

pos_cash_move_reason/readme/DESCRIPTION.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This module allow to define some reasons for the functionality of
2-
"Put Money In" and "Take Money Out" available in point of sale session.
2+
"Cash In / Out" available in point of sale session.
33

44
So, with this module it's possible to impact directly an expense or income
55
account which is defined on the related reasons and create according

pos_cash_move_reason/readme/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
16.0.2.0.0 (2025-07-27)
2+
~~~~~~~~~~~~~~~~~~~~~~~
3+
* [IMP] This module works directly on POS UI
4+
15
16.0.1.0.0 (2025-07-27)
26
~~~~~~~~~~~~~~~~~~~~~~~
37
* [MIG] Port module to version 16.0.

pos_cash_move_reason/readme/USAGE.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**In backoffice**
2+
13
* Go to your current session
24

35
* Click on the button "Put Money In" or "Take Money Out"
@@ -9,8 +11,20 @@
911

1012
.. figure:: ../static/description/wizard_pos_move_reason_form.png
1113

12-
* When closing the session, an account move will be created, with two lines,
14+
* An account move will be created, with two lines,
1315
one with the default journal account, and one with the expense / income
1416
reason account.
1517

1618
.. figure:: ../static/description/account_move_form.png
19+
20+
**In POS UI**
21+
22+
* Click on Cash In / Out
23+
24+
* Choose Cash In or Cash Out then write the amount
25+
26+
* Choose a Reason
27+
28+
* If it has a Journal, choose Journal and confirm
29+
30+
.. figure:: ../static/description/pos_cash_move_ui.png

pos_cash_move_reason/static/description/index.html

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h1>POS cash in-out reason</h1>
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377377
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pos/tree/16.0/pos_cash_move_reason"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_cash_move_reason"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pos&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>This module allow to define some reasons for the functionality of
379-
Put Money In” and “Take Money Out” available in point of sale session.</p>
379+
Cash In / Out” available in point of sale session.</p>
380380
<p>So, with this module it’s possible to impact directly an expense or income
381381
account which is defined on the related reasons and create according
382382
accounting entries.</p>
@@ -395,17 +395,18 @@ <h1>POS cash in-out reason</h1>
395395
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
396396
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
397397
<li><a class="reference internal" href="#changelog" id="toc-entry-4">Changelog</a><ul>
398-
<li><a class="reference internal" href="#section-1" id="toc-entry-5">16.0.1.0.0 (2025-07-27)</a></li>
399-
<li><a class="reference internal" href="#section-2" id="toc-entry-6">12.0.3.0.0 (2019-08-13)</a></li>
400-
<li><a class="reference internal" href="#section-3" id="toc-entry-7">8.0.2.0.0 (2018-06-25)</a></li>
401-
<li><a class="reference internal" href="#section-4" id="toc-entry-8">8.0.1.0.0 (2017-06-08)</a></li>
398+
<li><a class="reference internal" href="#section-1" id="toc-entry-5">16.0.2.0.0 (2025-07-27)</a></li>
399+
<li><a class="reference internal" href="#section-2" id="toc-entry-6">16.0.1.0.0 (2025-07-27)</a></li>
400+
<li><a class="reference internal" href="#section-3" id="toc-entry-7">12.0.3.0.0 (2019-08-13)</a></li>
401+
<li><a class="reference internal" href="#section-4" id="toc-entry-8">8.0.2.0.0 (2018-06-25)</a></li>
402+
<li><a class="reference internal" href="#section-5" id="toc-entry-9">8.0.1.0.0 (2017-06-08)</a></li>
402403
</ul>
403404
</li>
404-
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-9">Bug Tracker</a></li>
405-
<li><a class="reference internal" href="#credits" id="toc-entry-10">Credits</a><ul>
406-
<li><a class="reference internal" href="#authors" id="toc-entry-11">Authors</a></li>
407-
<li><a class="reference internal" href="#contributors" id="toc-entry-12">Contributors</a></li>
408-
<li><a class="reference internal" href="#maintainers" id="toc-entry-13">Maintainers</a></li>
405+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-10">Bug Tracker</a></li>
406+
<li><a class="reference internal" href="#credits" id="toc-entry-11">Credits</a><ul>
407+
<li><a class="reference internal" href="#authors" id="toc-entry-12">Authors</a></li>
408+
<li><a class="reference internal" href="#contributors" id="toc-entry-13">Contributors</a></li>
409+
<li><a class="reference internal" href="#maintainers" id="toc-entry-14">Maintainers</a></li>
409410
</ul>
410411
</li>
411412
</ul>
@@ -433,6 +434,7 @@ <h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
433434
</div>
434435
<div class="section" id="usage">
435436
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
437+
<p><strong>In backoffice</strong></p>
436438
<ul class="simple">
437439
<li>Go to your current session</li>
438440
<li>Click on the button “Put Money In” or “Take Money Out”</li>
@@ -448,13 +450,23 @@ <h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
448450
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_cash_move_reason/static/description/wizard_pos_move_reason_form.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_cash_move_reason/static/description/wizard_pos_move_reason_form.png" />
449451
</div>
450452
<ul class="simple">
451-
<li>When closing the session, an account move will be created, with two lines,
453+
<li>An account move will be created, with two lines,
452454
one with the default journal account, and one with the expense / income
453455
reason account.</li>
454456
</ul>
455457
<div class="figure">
456458
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_cash_move_reason/static/description/account_move_form.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_cash_move_reason/static/description/account_move_form.png" />
457459
</div>
460+
<p><strong>In POS UI</strong></p>
461+
<ul class="simple">
462+
<li>Click on Cash In / Out</li>
463+
<li>Choose Cash In or Cash Out then write the amount</li>
464+
<li>Choose a Reason</li>
465+
<li>If it has a Journal, choose Journal and confirm</li>
466+
</ul>
467+
<div class="figure">
468+
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_cash_move_reason/static/description/pos_cash_move_ui.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_cash_move_reason/static/description/pos_cash_move_ui.png" />
469+
</div>
458470
</div>
459471
<div class="section" id="known-issues-roadmap">
460472
<h2><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h2>
@@ -466,13 +478,19 @@ <h2><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h2>
466478
<div class="section" id="changelog">
467479
<h2><a class="toc-backref" href="#toc-entry-4">Changelog</a></h2>
468480
<div class="section" id="section-1">
469-
<h3><a class="toc-backref" href="#toc-entry-5">16.0.1.0.0 (2025-07-27)</a></h3>
481+
<h3><a class="toc-backref" href="#toc-entry-5">16.0.2.0.0 (2025-07-27)</a></h3>
470482
<ul class="simple">
471-
<li>[MIG] Port module to version 16.0.</li>
483+
<li>[IMP] This module works directly on POS UI</li>
472484
</ul>
473485
</div>
474486
<div class="section" id="section-2">
475-
<h3><a class="toc-backref" href="#toc-entry-6">12.0.3.0.0 (2019-08-13)</a></h3>
487+
<h3><a class="toc-backref" href="#toc-entry-6">16.0.1.0.0 (2025-07-27)</a></h3>
488+
<ul class="simple">
489+
<li>[MIG] Port module to version 16.0.</li>
490+
</ul>
491+
</div>
492+
<div class="section" id="section-3">
493+
<h3><a class="toc-backref" href="#toc-entry-7">12.0.3.0.0 (2019-08-13)</a></h3>
476494
<ul class="simple">
477495
<li>[MIG] Port module to version 12.0.</li>
478496
<li>[REF] Don’t use <tt class="docutils literal">product.product</tt> model for Reasons, because Odoo remove
@@ -483,46 +501,46 @@ <h3><a class="toc-backref" href="#toc-entry-6">12.0.3.0.0 (2019-08-13)</a></h3>
483501
Instead, use new transient model <tt class="docutils literal">wizard.pos.move.reason</tt>.</li>
484502
</ul>
485503
</div>
486-
<div class="section" id="section-3">
487-
<h3><a class="toc-backref" href="#toc-entry-7">8.0.2.0.0 (2018-06-25)</a></h3>
504+
<div class="section" id="section-4">
505+
<h3><a class="toc-backref" href="#toc-entry-8">8.0.2.0.0 (2018-06-25)</a></h3>
488506
<ul class="simple">
489507
<li>[REF] Minor code refactoring.</li>
490508
</ul>
491509
</div>
492-
<div class="section" id="section-4">
493-
<h3><a class="toc-backref" href="#toc-entry-8">8.0.1.0.0 (2017-06-08)</a></h3>
510+
<div class="section" id="section-5">
511+
<h3><a class="toc-backref" href="#toc-entry-9">8.0.1.0.0 (2017-06-08)</a></h3>
494512
<ul class="simple">
495513
<li>First Version of the module.</li>
496514
</ul>
497515
</div>
498516
</div>
499517
<div class="section" id="bug-tracker">
500-
<h2><a class="toc-backref" href="#toc-entry-9">Bug Tracker</a></h2>
518+
<h2><a class="toc-backref" href="#toc-entry-10">Bug Tracker</a></h2>
501519
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/issues">GitHub Issues</a>.
502520
In case of trouble, please check there if your issue has already been reported.
503521
If you spotted it first, help us to smash it by providing a detailed and welcomed
504522
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_cash_move_reason%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
505523
<p>Do not contact contributors directly about support or help with technical issues.</p>
506524
</div>
507525
<div class="section" id="credits">
508-
<h2><a class="toc-backref" href="#toc-entry-10">Credits</a></h2>
526+
<h2><a class="toc-backref" href="#toc-entry-11">Credits</a></h2>
509527
<div class="section" id="authors">
510-
<h3><a class="toc-backref" href="#toc-entry-11">Authors</a></h3>
528+
<h3><a class="toc-backref" href="#toc-entry-12">Authors</a></h3>
511529
<ul class="simple">
512530
<li>ACSONE SA/NV</li>
513531
<li>GRAP</li>
514532
</ul>
515533
</div>
516534
<div class="section" id="contributors">
517-
<h3><a class="toc-backref" href="#toc-entry-12">Contributors</a></h3>
535+
<h3><a class="toc-backref" href="#toc-entry-13">Contributors</a></h3>
518536
<ul class="simple">
519537
<li>Sylvain LE GAL &lt;<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>&gt;</li>
520538
<li>Quentin DUPONT</li>
521539
<li>Dhara Solanki &lt;<a class="reference external" href="mailto:dhara.solanki&#64;initos.com">dhara.solanki&#64;initos.com</a>&gt;</li>
522540
</ul>
523541
</div>
524542
<div class="section" id="maintainers">
525-
<h3><a class="toc-backref" href="#toc-entry-13">Maintainers</a></h3>
543+
<h3><a class="toc-backref" href="#toc-entry-14">Maintainers</a></h3>
526544
<p>This module is maintained by the OCA.</p>
527545
<a class="reference external image-reference" href="https://odoo-community.org">
528546
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
173 KB
Loading

pos_cash_move_reason/static/src/js/CashMoveButtonPatch.esm.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ Copyright (C) 2026-Today: GRAP (https://www.grap.coop)
44
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
55
*/
66
odoo.define("pos_cash_move_reason.CashMoveButtonPatch", function (require) {
7-
8-
97
const CashMoveButton = require("point_of_sale.CashMoveButton");
108
const Registries = require("point_of_sale.Registries");
119
const {_t} = require("web.core");

pos_cash_move_reason/static/src/js/CashMovePopupPatch.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Copyright (C) 2026-Today: GRAP (https://www.grap.coop)
44
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
55
*/
66
odoo.define("pos_cash_move_reason.CashMovePopupPatch", function (require) {
7+
"use strict";
8+
79
const CashMovePopup = require("point_of_sale.CashMovePopup");
810
const {patch} = require("web.utils");
911
const {useState} = owl;
@@ -22,7 +24,7 @@ odoo.define("pos_cash_move_reason.CashMovePopupPatch", function (require) {
2224
},
2325
onClickMoveReason(reason_id) {
2426
this.state.inputMoveReason = reason_id;
25-
this.state.inputMoveReasonJournal = ""; // Reset
27+
this.state.inputMoveReasonJournal = "";
2628

2729
/* Get Journals linked to Move Reason*/
2830
const reason = this.env.pos.pos_move_reason.find((r) => r.id === reason_id);
@@ -41,20 +43,19 @@ odoo.define("pos_cash_move_reason.CashMovePopupPatch", function (require) {
4143
this.state.inputMoveReason = "";
4244
this.state.inputMoveReasonJournal = "";
4345
this.state.inputMoveReasonJournalFiltered = [];
44-
return this._super(...arguments);
46+
return this._super(type);
4547
},
4648

4749
/* Filter Move Reasons according to cash IN or OUT*/
4850
get filteredMoveReasons() {
49-
const ids = this.state.inputMoveReasonFiltered;
5051
let res = [];
51-
if (this.state.inputType == "in") {
52+
if (this.state.inputType === "in") {
5253
res = this.env.pos.pos_move_reason.filter(
53-
(reason) => reason.is_income_reason == true
54+
(reason) => reason.is_income_reason === true
5455
);
55-
} else if (this.state.inputType == "out") {
56+
} else if (this.state.inputType === "out") {
5657
res = this.env.pos.pos_move_reason.filter(
57-
(reason) => reason.is_expense_reason == true
58+
(reason) => reason.is_expense_reason === true
5859
);
5960
}
6061
return res;
@@ -67,7 +68,7 @@ odoo.define("pos_cash_move_reason.CashMovePopupPatch", function (require) {
6768
const res = this.env.pos.account_journal.filter((j) => ids.includes(j.id));
6869

6970
/* Choose journal if there is just one*/
70-
if (res.length == 1) {
71+
if (res.length === 1) {
7172
this.state.inputMoveReasonJournal = res[0].id;
7273
}
7374

@@ -87,14 +88,14 @@ odoo.define("pos_cash_move_reason.CashMovePopupPatch", function (require) {
8788

8889
/* Add new required fields */
8990
confirm() {
90-
if (this.state.inputMoveReason == "") {
91+
if (this.state.inputMoveReason === "") {
9192
this.state.inputHasError = true;
9293
this.errorMessage = this.env._t("Select one Reason before confirming.");
9394
return;
9495
}
9596
if (
9697
this.state.inputMoveReasonJournalFiltered.length > 0 &&
97-
this.state.inputMoveReasonJournal == ""
98+
this.state.inputMoveReasonJournal === ""
9899
) {
99100
this.state.inputHasError = true;
100101
this.errorMessage = this.env._t(

0 commit comments

Comments
 (0)