Skip to content

Conversation

@kirca
Copy link

@kirca kirca commented Nov 1, 2025

use model.browse() to check if the record exists.
model.search() by id doesn't work.

@pedrobaeza pedrobaeza added this to the 18.0 milestone Nov 3, 2025
Obj = self.env[self.model_id.model]
record = Obj.search([("id", "=", self.record_id)], limit=1)
if not record:
record = Obj.browse(self.record_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
record = Obj.browse(self.record_id)
record = Obj.browse(self.record_id).exists()

use model.browse() to check if the record exists.
model.search() by `id` doesn't work.
@kirca kirca force-pushed the 18.0-fix-printer_zpl2-test_record_id branch from 1502c2d to 78f27a9 Compare November 3, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants