hi every one
in odoo 18 I want to edit the stock.picking form and if I select partner
the products in the Operations tab must be shown like this the user try to pick a product he see only the products that have the same partner in his vendor list
and I try this code
class StockPickingCo(models.Model):
_inherit = 'stock.picking'
@api.onchange('partner_id')
def _onchange_partner_id_filter_products(self):
print("_onchange_partner_id_filter_products")
if self.partner_id:
return {
'domain': {
'move_ids_without_package.product_id': [
('seller_ids.partner_id', '=', self.partner_id.id)
]
}
}
return {
'domain': {
'move_ids_without_package.product_id': []
}
}
and this
class StockMove(models.Model):
_inherit = 'stock.move'
@api.onchange('product_id')
def _onchange_product_id_domain(self):
print("_onchange_product_id_domain")
if self.picking_id and self.picking_id.partner_id:
print("_onchange_product_id_domain - 0", self.picking_id)
return {
'domain': {
'product_id': [
('seller_ids.partner_id', '=', self.picking_id.partner_id.id)
]
}
}
return {}
but it's not working can any one help me on this or giving me any idea to make it working