text: Odoo Help
  Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
  CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
  show existing products of a customer in a tab
  I am new in python, I've added a drop-down field so I can select a customer and seen his/her existing products in a tab.
  but I cant show the list of existing products of a customer, how can I do it, can anyone help me please.
  Hi,
  One option is to create a One2many compute field on res.partner model and call that on a tab in customer form view. So when you open the customer form, under a "Products" tab, you may see the existing products of the customer. You may check the tutorial on how to create a One2many compute or functional field. Or else you may contact me on akhilpsivan01@gmail.com for further help.
  For example, you may try by adding the following code:
  in your .py file:
  class project_task(models.Model):
  _inherit = "project.task"
  customer = fields.Many2one('res.partner', string="Search Customer Name")
  products = fields.One2many('product.template', compute='_get_products', string="Products")
  @api.one
  @api.depends('customer')
  def _get_products(self):
  if self.customer:
  product_list = self.env['product.supplierinfo'].search([('name.id','=',self.customer.id)])
  if product_list:
  p_list = []
  for supp in product_list:
  p_list.append(supp.product_tmpl_id.id)
  prod = self.env['product.template'].browse(p_list)
  self.products = prod
  in your xml file:
  >
  About This Community
  Odoo Training Center
  Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now