I’m working on a custom wizard and need some help defining a domain between two Many2one fields.
Here’s the setup:
class StockMoveRequestReportWizard(models.TransientModel): _name = "stock.move.request.report.wizard" _description = "Stock Move Request Report Wizard" source_store_id = fields.Many2one( 'res.store', string='Source Store', default=lambda self: self.env.user.store_ids, ) destination_store_id = fields.Many2one( 'res.store', string='Destination Store', )
The res.store model has a company_id field.
What I want to achieve is:
- When a source_store_id is selected, the destination_store_id field should only show stores that belong to a different company than the selected source store.