from odoo import fields, models, api

class SaleOrderLineExt(models.Model):
    _inherit = 'sale.order.line'
    categ_id = fields.Many2one('product.category', string="catégorie")

    @api.onchange('categ_id')
    def _onchange_categ(self):
        return {'domain': {
            'product_id': [
                ('categ_id', '=', self.categ_id.id)
            ]
        }}

4a53dc23128ef289b441cfbba28e2a7a15a50367
<mask token>


class SaleOrderLineExt(models.Model):
    <mask token>
    <mask token>
    <mask token>

<mask token>


class SaleOrderLineExt(models.Model):
    <mask token>
    <mask token>

    @api.onchange('categ_id')
    def _onchange_categ(self):
        return {'domain': {'product_id': [('categ_id', '=', self.categ_id.id)]}
            }

<mask token>


class SaleOrderLineExt(models.Model):
    _inherit = 'sale.order.line'
    categ_id = fields.Many2one('product.category', string='catégorie')

    @api.onchange('categ_id')
    def _onchange_categ(self):
        return {'domain': {'product_id': [('categ_id', '=', self.categ_id.id)]}
            }

from odoo import fields, models, api


class SaleOrderLineExt(models.Model):
    _inherit = 'sale.order.line'
    categ_id = fields.Many2one('product.category', string='catégorie')

    @api.onchange('categ_id')
    def _onchange_categ(self):
        return {'domain': {'product_id': [('categ_id', '=', self.categ_id.id)]}
            }

from odoo import fields, models, api

class SaleOrderLineExt(models.Model):
    _inherit = 'sale.order.line'
    categ_id = fields.Many2one('product.category', string="catégorie")

    @api.onchange('categ_id')
    def _onchange_categ(self):
        return {'domain': {
            'product_id': [
                ('categ_id', '=', self.categ_id.id)
            ]
        }}
