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
18 lines
495 B
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import api, models
|
|
|
|
|
|
class MembershipLine(models.Model):
|
|
_inherit = "membership.membership_line"
|
|
|
|
@api.model_create_multi
|
|
def create(self, vals_list):
|
|
res = super().create(vals_list)
|
|
for line in res:
|
|
discount = line.account_invoice_line.discount
|
|
if discount:
|
|
line.member_price *= discount / 100.0
|
|
|
|
return res
|