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.

18 lines
495 B

  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import api, models
  4. class MembershipLine(models.Model):
  5. _inherit = "membership.membership_line"
  6. @api.model_create_multi
  7. def create(self, vals_list):
  8. res = super().create(vals_list)
  9. for line in res:
  10. discount = line.account_invoice_line.discount
  11. if discount:
  12. line.member_price *= discount / 100.0
  13. return res