31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
from odoo import models, fields
|
|
|
|
|
|
class FusionSyncLog(models.Model):
|
|
"""Log sync operations for auditing and debugging."""
|
|
_name = 'fusion.sync.log'
|
|
_description = 'Inventory Sync Log'
|
|
_order = 'create_date desc'
|
|
_rec_name = 'summary'
|
|
|
|
config_id = fields.Many2one('fusion.sync.config', string='Sync Config',
|
|
required=True, ondelete='cascade')
|
|
direction = fields.Selection([
|
|
('pull', 'Pull (Remote -> Local)'),
|
|
('push', 'Push (Local -> Remote)'),
|
|
], string='Direction', required=True)
|
|
sync_type = fields.Selection([
|
|
('product', 'Product Catalog'),
|
|
('stock', 'Stock Levels'),
|
|
('full', 'Full Sync'),
|
|
], string='Type', required=True)
|
|
status = fields.Selection([
|
|
('success', 'Success'),
|
|
('partial', 'Partial'),
|
|
('error', 'Error'),
|
|
], string='Status', required=True)
|
|
summary = fields.Char(string='Summary')
|
|
details = fields.Text(string='Details')
|
|
product_count = fields.Integer(string='Products Affected')
|