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.

24 lines
826 B

  1. # Copyright 2019 Tecnativa - David Vidal
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  3. from odoo import fields, models
  4. class ResPartner(models.Model):
  5. _inherit = "res.partner"
  6. customer_global_discount_ids = fields.Many2many(
  7. comodel_name="global.discount",
  8. relation="customer_global_discount_rel",
  9. column1="partner_id",
  10. column2="global_discount_id",
  11. string="Sale Global Discounts",
  12. domain=[("discount_scope", "=", "sale")],
  13. )
  14. supplier_global_discount_ids = fields.Many2many(
  15. comodel_name="global.discount",
  16. relation="supplier_global_discount_rel",
  17. column1="partner_id",
  18. column2="global_discount_id",
  19. string="Purchase Global Discounts",
  20. domain=[("discount_scope", "=", "purchase")],
  21. )