[IMP] point_of_sale: Send Context Closing POS Session

Sending a context when you are closing a `pos.session` will allow you to
make some validations/actions only when the closing is being done from the UI.
For example, sending values for new fields or a message that includes
something from the pos, like the Cashier ID, name, etc.

Also, it will help more when it is necessary to inherit the function in a
simpler way, to avoid having to overwrite it.

closes odoo/odoo#106044

X-original-commit: 3f7d6833b8c85a0c3469eced160bd72884c18d22
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
This commit is contained in:
CarmenMiranda
2022-11-18 15:01:08 +01:00
parent 34aa021342
commit fa9d207e67
@@ -130,6 +130,7 @@ odoo.define('point_of_sale.ClosePosPopup', function(require) {
model: 'pos.session',
method: 'close_session_from_ui',
args: [this.env.pos.pos_session.id, bankPaymentMethodDiffPairs],
context: this.env.session.user_context,
});
if (!response.successful) {
return this.handleClosingError(response);