from odoo import api, fields, models


class WooCategoryMap(models.Model):
    _name = 'woo.category.map'
    _description = 'WooCommerce Category Mapping'
    _order = 'odoo_category_id'

    instance_id = fields.Many2one('woo.instance', required=True, ondelete='cascade')
    odoo_category_id = fields.Many2one('product.category', string='Odoo Category')
    woo_category_id = fields.Integer(string='WC Category ID', required=True)
    woo_category_name = fields.Char(string='WC Category Name')
    woo_category_slug = fields.Char(string='WC Category Slug')
    company_id = fields.Many2one('res.company', required=True, default=lambda self: self.env.company)
