[FIX] point_of_sale: prevent rounding modification with an open session

Prior to this commit, the rounding setting could be modified while
a session was open. This could potentially cause accounting
discrepancies and lead to unbalanced account moves.

opw-3677480

closes odoo/odoo#158625

X-original-commit: 021302a270028373ab519ea1d5409ffb73ee8424
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
Pedram (pebr)
2024-03-25 17:50:05 +00:00
parent 8865312f7c
commit adc04e2bb2
@@ -60,15 +60,15 @@
<field name="pos_auto_validate_terminal_payment"/>
</setting>
<setting string="Cash Rounding" invisible="is_kiosk_mode" documentation="/applications/sales/point_of_sale/pricing/cash_rounding.html" help="Define the smallest coinage of the currency used to pay by cash">
<field name="pos_cash_rounding"/>
<field name="pos_cash_rounding" readonly="pos_has_active_session"/>
<div class="content-group mt16" invisible="not pos_cash_rounding">
<div class="row mt16">
<label string="Rounding Method" for="pos_rounding_method" class="col-lg-3 o_light_label" />
<field name="pos_rounding_method" required="pos_cash_rounding" domain="[('company_id', '=', company_id)]"/>
<field name="pos_rounding_method" required="pos_cash_rounding" domain="[('company_id', '=', company_id)]" readonly="pos_has_active_session"/>
</div>
<div class="row mt16">
<div class="col">
<field name="pos_only_round_cash_method"/>
<field name="pos_only_round_cash_method" readonly="pos_has_active_session"/>
<label string="Only on cash methods" for="pos_only_round_cash_method" class="o_light_label" />
</div>
</div>