0

i want to display all the vendors of product when i select one in sales order lines

i tried this code

vendors = fields.Many2one(related='product_id.seller_ids_name')

it works but not as expected

as you see in the image i get only one vendor of the selected product, what i want is display all the vendors of that product (product A) not only one

enter image description here

Can you help me with that ?

thanks

Zoro
  • 47
  • 5

1 Answers1

0

You have to use a Many2many field if you want to show multiple vendors in sale order line.

vendor_ids = fields.Many2many(comodel_name_of_vendor_model, string='Vendors', related='source_field.related_value')

Please make sure that your source field is also a Many2many field.

Jeremy Gillbert
  • 133
  • 2
  • 10