server-tools icon indicating copy to clipboard operation
server-tools copied to clipboard

Audit log: Getting error when closing POS Session

Open SodexisTeam opened this issue 2 months ago • 4 comments

Describe the bug

On Audit log rule we set "Model" as "Journal entry" and "Type" as "Full log"

In POS after we done transcation when we try to close the register we getting error and it's not allowed to close the session.

And also at Accounting module We facing same issue when creating a new bank statement line in enterprise edition.

For reference please check the below video link: https://app.screencastify.com/watch/3vXIt4VOXDlVpTSppHb7?checkOrg=2a828e02-a88a-45ac-b72d-7c4d9a522f89

Image Image

SodexisTeam avatar Oct 23 '25 12:10 SodexisTeam

Can't see the important part of the error message. Can you copy its text?

StefanRijnhart avatar Nov 07 '25 15:11 StefanRijnhart

Hello,

Here is the copy of Error message

Odoo Server Error

RPC_ERROR Odoo Server Error

Occured on oca-server-tools-18-0-5562381b17f2.runboat.odoo-community.org on model pos.session on 2025-11-13 07:35:48 GMT

Traceback (most recent call last): File "/opt/odoo/odoo/http.py", line 2166, in _transactioning return service_model.retrying(func, env=self.env) File "/opt/odoo/odoo/service/model.py", line 156, in retrying result = func() File "/opt/odoo/odoo/http.py", line 2133, in _serve_ir_http response = self.dispatcher.dispatch(rule.endpoint, args) File "/opt/odoo/odoo/http.py", line 2381, in dispatch result = self.request.registry['ir.http']._dispatch(endpoint) File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 333, in _dispatch result = endpoint(**request.params) File "/opt/odoo/odoo/http.py", line 754, in route_wrapper result = endpoint(self, *args, **params_ok) File "/opt/odoo/addons/web/controllers/dataset.py", line 42, in call_button action = call_kw(request.env[model], method, args, kwargs) File "/opt/odoo/odoo/api.py", line 535, in call_kw result = getattr(recs, name)(*args, **kwargs) File "/opt/odoo/addons/point_of_sale/models/pos_session.py", line 409, in action_pos_session_closing_control return session.action_pos_session_validate(balancing_account, amount_to_balance, bank_payment_method_diffs) File "/opt/odoo/addons/point_of_sale/models/pos_session.py", line 414, in action_pos_session_validate return self.action_pos_session_close(balancing_account, amount_to_balance, bank_payment_method_diffs) File "/opt/odoo/addons/point_of_sale/models/pos_session.py", line 421, in action_pos_session_close return self._validate_session(balancing_account, amount_to_balance, bank_payment_method_diffs) File "/opt/odoo/addons/point_of_sale/models/pos_session.py", line 440, in _validate_session data = self.with_company(self.company_id).with_context(check_move_validity=False, skip_invoice_sync=True)._create_account_move(balancing_account, amount_to_balance, bank_payment_method_diffs) File "/opt/odoo/addons/point_of_sale/models/pos_session.py", line 818, in _create_account_move data = self._create_cash_statement_lines_and_cash_move_lines(data) File "/opt/odoo/addons/point_of_sale/models/pos_session.py", line 1223, in _create_cash_statement_lines_and_cash_move_lines combine_cash_statement_lines = BankStatementLine.create(combine_cash_statement_line_vals).mapped('move_id.line_ids').filtered(lambda line: line.account_id.account_type == 'asset_receivable') File "", line 2, in create File "/opt/odoo/odoo/api.py", line 498, in _model_create_multi return create(self, arg) File "/opt/odoo/addons/account/models/account_bank_statement_line.py", line 427, in create st_line.move_id.write(to_write) File "/mnt/data/odoo-addons-dir/auditlog/models/rule.py", line 457, in write_full old_values = {d["id"]: d for d in records_write.read(fields_list)} File "/opt/odoo/odoo/models.py", line 3857, in read self._origin.fetch(fields) File "/opt/odoo/odoo/models.py", line 4153, in fetch fetched = self._fetch_query(query, fields_to_fetch) File "/opt/odoo/odoo/models.py", line 4264, in _fetch_query field.read(fetched) File "/opt/odoo/odoo/fields.py", line 4646, in read lines = comodel.search_fetch(domain, field_names) File "/opt/odoo/odoo/models.py", line 1781, in search_fetch return self._fetch_query(query, fields_to_fetch) File "/opt/odoo/odoo/models.py", line 4240, in _fetch_query rows = self.env.execute_query(query.select(*sql_terms)) File "/opt/odoo/odoo/api.py", line 992, in execute_query self.flush_query(query) File "/opt/odoo/odoo/api.py", line 984, in flush_query self[model_name].flush_model(field_names) File "/opt/odoo/odoo/models.py", line 6768, in flush_model self._recompute_model(fnames) File "/opt/odoo/odoo/models.py", line 7332, in _recompute_model self._recompute_field(field) File "/opt/odoo/odoo/models.py", line 7360, in _recompute_field field.recompute(records) File "/opt/odoo/odoo/fields.py", line 1463, in recompute apply_except_missing(self.compute_value, recs) File "/opt/odoo/odoo/fields.py", line 1436, in apply_except_missing func(records) File "/opt/odoo/odoo/fields.py", line 1485, in compute_value records._compute_field_value(self) File "/opt/odoo/odoo/models.py", line 5297, in _compute_field_value fields.determine(field.compute, self) File "/opt/odoo/odoo/fields.py", line 110, in determine return needle(*args) File "/opt/odoo/addons/account/models/account_bank_statement_line.py", line 295, in _compute_internal_index st_line.internal_index = f'{st_line.date.strftime("%Y%m%d")}'
AttributeError: 'bool' object has no attribute 'strftime'

The above server error caused the following client error: RPC_ERROR: Odoo Server Error RPC_ERROR at makeErrorFromResponse (http://oca-server-tools-18-0-5562381b17f2.runboat.odoo-community.org/web/assets/4054ddb/web.assets_web.min.js:3163:165) at XMLHttpRequest. (http://oca-server-tools-18-0-5562381b17f2.runboat.odoo-community.org/web/assets/4054ddb/web.assets_web.min.js:3168:13)

SodexisTeam avatar Nov 13 '25 07:11 SodexisTeam

Thanks. Which version of auditlog are you running?

StefanRijnhart avatar Nov 13 '25 07:11 StefanRijnhart

18.0.2.0.2

SodexisTeam avatar Nov 13 '25 08:11 SodexisTeam