fix: Odoo 19 compatibility — tree→list views, remove search group wrappers, remove numbercall
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -106,6 +106,34 @@ class WooInstance(models.Model):
|
||||
self.ensure_one()
|
||||
self.odoo_api_key = secrets.token_urlsafe(32)
|
||||
|
||||
def action_view_product_maps(self):
|
||||
"""Open product mapping list filtered by this instance."""
|
||||
self.ensure_one()
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'Product Mapping',
|
||||
'res_model': 'woo.product.map',
|
||||
'view_mode': 'list,form',
|
||||
'domain': [('instance_id', '=', self.id)],
|
||||
'context': {'default_instance_id': self.id},
|
||||
}
|
||||
|
||||
def action_view_sync_errors(self):
|
||||
"""Open sync log filtered to errors for this instance."""
|
||||
self.ensure_one()
|
||||
twenty_four_ago = fields.Datetime.subtract(fields.Datetime.now(), hours=24)
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'Sync Errors (24h)',
|
||||
'res_model': 'woo.sync.log',
|
||||
'view_mode': 'list,form',
|
||||
'domain': [
|
||||
('instance_id', '=', self.id),
|
||||
('state', '=', 'failed'),
|
||||
('create_date', '>=', twenty_four_ago),
|
||||
],
|
||||
}
|
||||
|
||||
def _log_sync(self, sync_type, direction, record_ref, state, message=''):
|
||||
"""Create a woo.sync.log record for this instance."""
|
||||
self.ensure_one()
|
||||
|
||||
Reference in New Issue
Block a user