You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
690 B

  1. # Copyright 2021 Tecnativa - Carlos Dauden
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
  3. from odoo import models
  4. class Pricelist(models.Model):
  5. _inherit = "product.pricelist"
  6. def show_pricelist_partners(self):
  7. if len(self) == 1:
  8. domain = [("property_product_pricelist", "=", self.id)]
  9. else:
  10. domain = [("property_product_pricelist", "in", self.ids)]
  11. partners = self.env["res.partner"].search(domain)
  12. xmlid = "base.action_partner_form"
  13. action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
  14. action["domain"] = [
  15. ("id", "in", partners.ids),
  16. ]
  17. return action